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

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

[elpa] externals/org 266aac1186: org-element--cache-persist-before-write


From: ELPA Syncer
Subject: [elpa] externals/org 266aac1186: org-element--cache-persist-before-write: Warn when writing incorrect cache
Date: Wed, 20 Sep 2023 09:58:16 -0400 (EDT)

branch: externals/org
commit 266aac1186256aaf3fb1bb1181ee83d548092d12
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>

    org-element--cache-persist-before-write: Warn when writing incorrect cache
    
    * lisp/org-element.el (org-element--cache-persist-before-write): When
    the cache being written has elements without parent, warn the user.
---
 lisp/org-element.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/org-element.el b/lisp/org-element.el
index 162aeda289..aa809e14f0 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -7359,7 +7359,10 @@ The element is: %S\n The real element is: %S\n Cache 
around :begin:\n%S\n%S\n%S"
                     (lambda (el2)
                       (unless (org-element-type-p el2 'plain-text)
                         (org-element-put-property el2 :buffer nil)))
-                    nil nil nil 'with-affiliated 'no-undefer))
+                    nil nil nil 'with-affiliated 'no-undefer)
+                  (when (and (not (org-element-parent el)) (not 
(org-element-type-p el 'org-data)))
+                    (org-element--cache-warn
+                     "Got element without parent when writing cache to 
disk.\n%S" el)))
                 org-element--cache)
                nil)
             'forbid))



reply via email to

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