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

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

[elpa] externals/org 4a2cf81 1/4: org-element--cache-for-removal: Fix ha


From: ELPA Syncer
Subject: [elpa] externals/org 4a2cf81 1/4: org-element--cache-for-removal: Fix handling edits before first section
Date: Tue, 30 Nov 2021 07:57:25 -0500 (EST)

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

    org-element--cache-for-removal: Fix handling edits before first section
    
    * lisp/org-element.el (org-element--cache-for-removal): Consider edits
    within blank before first section destructive and make cache delete
    the section even though the edits are technically before its
    beginning.
---
 lisp/org-element.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lisp/org-element.el b/lisp/org-element.el
index 6577971..4543e30 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -6688,8 +6688,11 @@ known element in cache (it may start after END)."
                               t)))
                      ;; If UP is org-data, the situation is similar to
                      ;; headline case.  We just need to re-parse the
-                     ;; org-data itself.
-                     (when (eq 'org-data (org-element-type up))
+                     ;; org-data itself, unless the change is made
+                     ;; within blank lines at BOB (that could
+                     ;; potentially alter first-section).
+                     (when (and (eq 'org-data (org-element-type up))
+                                (>= beg (org-element-property :contents-begin 
up)))
                        (org-element-set-element up (org-with-point-at 1 
(org-element-org-data-parser)))
                        (org-element--cache-log-message "Found non-robust 
change invalidating org-data. Re-parsing: %S"
                                             (org-element--format-element up))



reply via email to

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