emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org 1525a5a64e 2/2: org-babel-load-file: Do not rely on


From: ELPA Syncer
Subject: [elpa] externals/org 1525a5a64e 2/2: org-babel-load-file: Do not rely on `org-babel-tangle-file' making changes
Date: Sun, 29 May 2022 23:57:43 -0400 (EDT)

branch: externals/org
commit 1525a5a64e9ad5b014596c74aab7291165b7292a
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>

    org-babel-load-file: Do not rely on `org-babel-tangle-file' making changes
    
    * lisp/org.el (org-babel-load-file): Update modification time even
    when `org-babel-tangle-file' does not actually modify the tangled
    file.  This makes sure that modify-time comparison logic does not make
    Org re-tangle Org file that had been changed but the changes did not
    affect the tangled code.
    
    See https://orgmode.org/list/t5j75h$dbo$1@ciao.gmane.io
---
 lisp/org.el | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lisp/org.el b/lisp/org.el
index 0eb819f235..95dff27ad7 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -256,6 +256,12 @@ byte-compiled before it is loaded."
             tangled-file
             (file-attribute-modification-time
              (file-attributes (file-truename file))))
+      ;; Make sure that tangled file modification time is
+      ;; updated even when `org-babel-tangle-file' does not make changes.
+      ;; This avoids re-tangling changed FILE where the changes did
+      ;; not affect the tangled code.
+      (when (file-exists-p tangled-file)
+        (set-file-times tangled-file))
       (org-babel-tangle-file file
                              tangled-file
                              (rx string-start



reply via email to

[Prev in Thread] Current Thread [Next in Thread]