From f7403e56eb4446c43cefc396eec599a92245501f Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Thu, 21 Oct 2021 14:58:40 +0800 Subject: [PATCH] org-element--cache-submit-request: Re-enable future-change * lisp/org-element.el (org-element--cache-submit-request): Re-enable FUTURE-CHANGE argument in `org-element--cache-sync' call. Without this argument, cache can be processed incorrectly because elements within changed region may be shifted and not deleted in subsequent phase 0 request. --- lisp/org-element.el | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lisp/org-element.el b/lisp/org-element.el index 42f97b433..e07f631f5 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -6668,9 +6668,7 @@ change, as an integer." ;; yet to the otherwise correct part of the cache (i.e, before ;; the first request). (org-element--cache-log-message "Adding new phase 0 request") - ;; FIXME: Disabling this optimisation to hunt errors. - ;; (when next (org-element--cache-sync (current-buffer) end beg)) - (when next (org-element--cache-sync (current-buffer) end)) + (when next (org-element--cache-sync (current-buffer) end beg)) (let ((first (org-element--cache-for-removal beg end offset))) (if first (push (let ((first-beg (org-element-property :begin first))