Merge branch 'bugfix'

This commit is contained in:
Nicolas Goaziou 2021-12-18 15:41:13 +01:00
commit 2b7ea20346
1 changed files with 6 additions and 9 deletions

View File

@ -187,15 +187,12 @@ source code blocks by languages matching a regular expression.
Return a list whose CAR is the tangled file name."
(interactive "fFile to tangle: \nP")
(let ((visited-p (find-buffer-visiting (expand-file-name file)))
to-be-removed)
(prog1
(save-window-excursion
(find-file file)
(setq to-be-removed (current-buffer))
(mapcar #'expand-file-name (org-babel-tangle nil target-file lang-re)))
(unless visited-p
(kill-buffer to-be-removed)))))
(let ((visited (find-buffer-visiting file))
(buffer (or visited (find-file-noselect file))))
(with-current-buffer buffer
(org-with-wide-buffer
(mapcar #'expand-file-name (org-babel-tangle nil target-file lang-re))))
(unless visited (kill-buffer buffer))))
(defun org-babel-tangle-publish (_ filename pub-dir)
"Tangle FILENAME and place the results in PUB-DIR."