>From 7901afc9c9b535cf2b5a523c4610ada37a468dfb Mon Sep 17 00:00:00 2001 From: Christian Dietrich Date: Tue, 13 Aug 2019 15:43:03 +0200 Subject: [PATCH] Fix bug in org-babel-tangle-file with symlinked files Assume that there is file A and symlink B that points to file A. If there is an open buffer that points to A and we call (org-babel-tangle-file "B"), then this function kills the buffer since get-file-buffer does not follow symlinks. --- lisp/ob-tangle.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el index f9f785910..7dbd618a6 100644 --- a/lisp/ob-tangle.el +++ b/lisp/ob-tangle.el @@ -174,7 +174,7 @@ export file for all source blocks. Optional argument LANG can be used to limit the exported source code blocks by language. Return a list whose CAR is the tangled file name." (interactive "fFile to tangle: \nP") - (let ((visited-p (get-file-buffer (expand-file-name file))) + (let ((visited-p (find-buffer-visiting (expand-file-name file))) to-be-removed) (prog1 (save-window-excursion -- 2.23.0.rc1