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

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

[elpa] externals-release/org 7e6b55b8fd 2/2: org-element--cache-active-p


From: ELPA Syncer
Subject: [elpa] externals-release/org 7e6b55b8fd 2/2: org-element--cache-active-p: Fix when cache is disabled in indirect buffers
Date: Sun, 4 Dec 2022 08:58:01 -0500 (EST)

branch: externals-release/org
commit 7e6b55b8fdd9a3908dfafb23531762ae4c0ae1d5
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>

    org-element--cache-active-p: Fix when cache is disabled in indirect buffers
    
    * lisp/org-element.el (org-element--cache-active-p): Consider cache
    disabled when any of the indirect buffers do not have modification
    detection.  This can be important when one uses
    `combine-after-change-calls' inside an indirect buffers disabling
    `after-change-functions' temporarily in the indirect buffer.
    
    Reported-by: Feng Shu <tumashu@163.com>
    Link: https://orgmode.org/list/87359z8ssb.fsf@163.com
---
 lisp/org-element.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/org-element.el b/lisp/org-element.el
index 48ede9c528..1f36775a7b 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -5717,7 +5717,11 @@ This function assumes `org-element--headline-cache' is a 
valid AVL tree."
               ;; `combine-change-calls' because the buffer is potentially
               ;; changed without notice (the change will be registered
               ;; after exiting the `combine-change-calls' body though).
-              (memq #'org-element--cache-after-change 
after-change-functions))))))
+              (catch :inhibited
+                (org-fold-core-cycle-over-indirect-buffers
+                  (unless (memq #'org-element--cache-after-change 
after-change-functions)
+                    (throw :inhibited nil)))
+                t))))))
 
 ;; FIXME: Remove after we establish that hashing is effective.
 (defun org-element-cache-hash-show-statistics ()



reply via email to

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