[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org fbcd71e856 2/4: org-babel-tangle: Do note erase the
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org fbcd71e856 2/4: org-babel-tangle: Do note erase the existing tangle target before overwriting |
Date: |
Fri, 15 Dec 2023 06:58:23 -0500 (EST) |
branch: externals/org
commit fbcd71e856fb6c1fbf432c63ffd1c37546aecfcd
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>
org-babel-tangle: Do note erase the existing tangle target before
overwriting
* lisp/ob-tangle.el (org-babel-tangle): Do not remove the existing
tangle target file, if any. `write-region' later will overwrite it
anyway, while removing may be unexpected if the existing target is a
symlink.
Reported-by: Cletip Cletip <clement020302@gmail.com>
Link:
https://list.orgmode.org/orgmode/CAPHku6O9NfVMAfmE3_ahmpJea_2Qm0mJMFX6qPpT8uiQ94KMZA@mail.gmail.com/
---
lisp/ob-tangle.el | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el
index bd772928a2..ef1fb5a7b7 100644
--- a/lisp/ob-tangle.el
+++ b/lisp/ob-tangle.el
@@ -313,9 +313,8 @@ matching a regular expression."
(compare-buffer-substrings
nil nil nil
tangle-buf nil nil)))))))
- ;; erase previous file
- (when (file-exists-p file-name)
- (delete-file file-name))
+ ;; We do not erase, but overwrite previous file
+ ;; to preserve any existing symlinks.
(write-region nil nil file-name)
(mapc (lambda (mode) (set-file-modes file-name mode))
modes))
(push file-name path-collector))))))