Преглед на файлове

org-element--cache-for-removal: Improve performance

* lisp/org-element.el (org-element--cache-for-removal): Directly check
for headline at point instead of running full
`org-element--current-element' that is matching a large number of
regexps.
Ihor Radchenko преди 2 години
родител
ревизия
93821b431c
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      lisp/org-element.el

+ 2 - 1
lisp/org-element.el

@@ -6909,7 +6909,8 @@ known element in cache (it may start after END)."
                           (not (> end (org-element-property :end up)))
                           (let ((current (org-with-point-at (org-element-property :begin up)
                                            (org-element-with-disabled-cache
-                                             (org-element--current-element (point-max))))))
+                                             (and (looking-at-p org-element-headline-re)
+                                                  (org-element-headline-parser nil t))))))
                             (when (eq 'headline (org-element-type current))
                               (org-element--cache-log-message
                                "Found non-robust headline that can be updated individually: %S"