branch: externals/org
commit cfe4b17d968791e3e39a1d48fd0002d87952deb6
Author: Ihor Radchenko <[email protected]>
Commit: Ihor Radchenko <[email protected]>
org-element-cache: Optimise changed property drawer detection
* lisp/org-element.el (org-element--cache-for-removal): Only force
re-parsing headlines when the changed region falls within the headline
before property drawer end position.
---
lisp/org-element.el | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lisp/org-element.el b/lisp/org-element.el
index 13e3ceb..c7418f9 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -6674,9 +6674,11 @@ known element in cache (it may start after END)."
(goto-char (point-min))
(while (and (org-at-comment-p)
(bolp)) (forward-line))
;; Should not see property
- ;; drawer inside robust
+ ;; drawer within changed
;; region.
- (not (looking-at
org-property-drawer-re)))))
+ (save-match-data
+ (or (not (looking-at
org-property-drawer-re))
+ (> beg (match-end 0)))))))
(_ 'robust)))))
;; UP is a robust greater element containing changes.
;; We only need to extend its ending boundaries.