[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 0f7ceb4803 4/9: org-export-as: Do not update buffer settings when
From: |
Eli Zaretskii |
Subject: |
master 0f7ceb4803 4/9: org-export-as: Do not update buffer settings when not modified |
Date: |
Thu, 16 Jun 2022 04:09:43 -0400 (EDT) |
branch: master
commit 0f7ceb4803cabcb3c406fa7c27ccb7625096058e
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Eli Zaretskii <eliz@gnu.org>
org-export-as: Do not update buffer settings when not modified
* lisp/org/ox.el (org-export-as): Use `buffer-chars-modified-tick' and
avoid extra invocations of `org-set-regexps-and-options' and
`org-update-radio-target-regexp' when the buffer is not changed.
Also, disable folding checks. Folding is irrelevant inside export
buffer.
---
lisp/org/ox.el | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/lisp/org/ox.el b/lisp/org/ox.el
index b431d71193..a4512270c9 100644
--- a/lisp/org/ox.el
+++ b/lisp/org/ox.el
@@ -2956,11 +2956,12 @@ Return code as a string."
(mapcar (lambda (o) (and (eq (nth 4 o) 'parse) (nth 1 o)))
(append (org-export-get-all-options backend)
org-export-options-alist))))
- tree)
+ tree modified-tick)
;; Update communication channel and get parse tree. Buffer
;; isn't parsed directly. Instead, all buffer modifications
;; and consequent parsing are undertaken in a temporary copy.
(org-export-with-buffer-copy
+ (font-lock-mode -1)
;; Run first hook with current back-end's name as argument.
(run-hook-with-args 'org-export-before-processing-hook
(org-export-backend-name backend))
@@ -2972,6 +2973,7 @@ Return code as a string."
;; potentially invasive changes.
(org-set-regexps-and-options)
(org-update-radio-target-regexp)
+ (setq modified-tick (buffer-chars-modified-tick))
;; Possibly execute Babel code. Re-run a macro expansion
;; specifically for {{{results}}} since inline source blocks
;; may have generated some more. Refresh buffer properties
@@ -2979,8 +2981,10 @@ Return code as a string."
(when org-export-use-babel
(org-babel-exp-process-buffer)
(org-macro-replace-all '(("results" . "$1")) parsed-keywords)
- (org-set-regexps-and-options)
- (org-update-radio-target-regexp))
+ (unless (eq modified-tick (buffer-chars-modified-tick))
+ (org-set-regexps-and-options)
+ (org-update-radio-target-regexp))
+ (setq modified-tick (buffer-chars-modified-tick)))
;; Run last hook with current back-end's name as argument.
;; Update buffer properties and radio targets one last time
;; before parsing.
@@ -2988,8 +2992,10 @@ Return code as a string."
(save-excursion
(run-hook-with-args 'org-export-before-parsing-hook
(org-export-backend-name backend)))
- (org-set-regexps-and-options)
- (org-update-radio-target-regexp)
+ (unless (eq modified-tick (buffer-chars-modified-tick))
+ (org-set-regexps-and-options)
+ (org-update-radio-target-regexp))
+ (setq modified-tick (buffer-chars-modified-tick))
;; Update communication channel with environment.
(setq info
(org-combine-plists
- master updated (fdd4dc6bdf -> 217c41c7b0), Eli Zaretskii, 2022/06/16
- master d21412df06 3/9: org-export-resolve-id-link: Pre-cache all the ids in the parse tree, Eli Zaretskii, 2022/06/16
- master 5b3d4e7bf0 1/9: org-export-get-footnote-definition: Pre-cache references in parse tree, Eli Zaretskii, 2022/06/16
- master 3236dedc2d 2/9: org-export-resolve-fuzyy-link: Pre-cache all possible search cells, Eli Zaretskii, 2022/06/16
- master 217c41c7b0 9/9: Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs, Eli Zaretskii, 2022/06/16
- master f94e93a6ee 7/9: org-cite-list-citations: Cache footnote-definition searches, Eli Zaretskii, 2022/06/16
- master 0f7ceb4803 4/9: org-export-as: Do not update buffer settings when not modified,
Eli Zaretskii <=
- master 979308b4ca 5/9: org-export-data: Concatenate strings in temporary buffer for performance, Eli Zaretskii, 2022/06/16
- master 4f37a3b299 6/9: org-element-map: Avoid repetitive `plist-get' call, Eli Zaretskii, 2022/06/16
- master b3cbcebd9a 8/9: Speed up Org to Texinfo generation, Eli Zaretskii, 2022/06/16