Prechádzať zdrojové kódy

org-element-cache: Consider non-PROPERTIES drawers robust

* lisp/org-element.el (org-element--cache-for-removal): Drawers are
generally robust elements (they cannot be changed if a non-sensitive
change is made inside their contents).  The only exception is
PROPERTIES drawer that may switch back and forth between ordinary
drawer and properties drawer depending on its contents.  The old code
treated all possible drawer as non-robust for this reason, degrading
performance on large LOGBOOK drawers that are now processed much
faster since they do not need to be removed and re-parsed on every
single change.
Ihor Radchenko 3 rokov pred
rodič
commit
69985367cd
1 zmenil súbory, kde vykonal 4 pridanie a 1 odobranie
  1. 4 1
      lisp/org-element.el

+ 4 - 1
lisp/org-element.el

@@ -6631,7 +6631,10 @@ known element in cache (it may start after END)."
 	(while up
 	  (if (let ((type (org-element-type up)))
                 (or (and (memq type '( center-block dynamic-block
-                                       quote-block special-block))
+                                       quote-block special-block
+                                       drawer))
+                         (or (not (eq type 'drawer))
+                             (not (string= "PROPERTIES" (org-element-property :drawer-name up))))
                          ;; Sensitive change.  This is
                          ;; unconditionally non-robust change.
                          (not org-element--cache-change-warning)