From fe6cefdaaf020c315031a139a7b9bc443cbefc5c Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Sat, 16 Oct 2021 23:41:00 +0800 Subject: [PATCH] ox.el: Support cache during export * lisp/ox.el (org-export-ignored-local-variables): Preserve cache state in export buffer. (org-export--generate-copy-script): Fix cache confusion about buffer change tic. --- lisp/ox.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lisp/ox.el b/lisp/ox.el index d89706c20..75881cfdb 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -260,6 +260,8 @@ rules.") (defconst org-export-ignored-local-variables '(org-font-lock-keywords + org-element--cache-change-tic org-element--cache-change-tic org-element--cache-size + org-element--cache-sync-keys-value org-element--cache-change-warning org-element--cache org-element--cache-objects org-element--cache-sync-keys org-element--cache-sync-requests org-element--cache-sync-timer) "List of variables not copied through upon buffer duplication. @@ -2614,6 +2616,9 @@ The function assumes BUFFER's major mode is `org-mode'." (set (make-local-variable var) val)) ;; Whole buffer contents. (insert str) + ;; Make org-element-cache not complain about changed buffer + ;; state. + (org-element-cache-reset) ;; Narrowing. (apply #'narrow-to-region narrowing) ;; Current position of point.