Selaa lähdekoodia

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.
Christian Dietrich 5 vuotta sitten
vanhempi
commit
a72466ce8d
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      lisp/ob-tangle.el

+ 1 - 1
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