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.
This commit is contained in:
Ihor Radchenko 2021-10-16 23:41:00 +08:00
parent fede2588e4
commit fe6cefdaaf
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 5 additions and 0 deletions

View File

@ -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.