[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org 514e3a9cd2 08/13: org-export: Suppress cache persis
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org 514e3a9cd2 08/13: org-export: Suppress cache persistence in buffer copies during export |
Date: |
Fri, 7 Oct 2022 01:57:51 -0400 (EDT) |
branch: externals/org
commit 514e3a9cd26e150f6ee7251433e14701b62f7e98
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>
org-export: Suppress cache persistence in buffer copies during export
* lisp/org-element.el (org-element-cache-reset): Add new optional
argument that suppresses all persistence-related calculations.
* lisp/org-table.el (org-element-cache-reset):
* lisp/org.el (org-element-cache-reset): Update function signature.
* lisp/ox.el (org-export--generate-copy-script): Do not try to use
cache persistence in throwaway buffer copies.
Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://list.orgmode.org/m2zgef774u.fsf@me.com/T/#t
---
lisp/org-element.el | 8 +++++---
lisp/org-table.el | 2 +-
lisp/org.el | 2 +-
lisp/ox.el | 2 +-
4 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/lisp/org-element.el b/lisp/org-element.el
index 7ce2eb2ceb..7b26e877e3 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -7238,16 +7238,18 @@ Each element indicates the latest
`org-element--cache-change-tic' when
change did not contain gaps.")
;;;###autoload
-(defun org-element-cache-reset (&optional all)
+(defun org-element-cache-reset (&optional all no-persistance)
"Reset cache in current buffer.
When optional argument ALL is non-nil, reset cache in all Org
-buffers."
+buffers.
+When optional argument NO-PERSISTANCE is non-nil, do not try to update
+the cache persistence in the buffer."
(interactive "P")
(dolist (buffer (if all (buffer-list) (list (current-buffer))))
(with-current-buffer (or (buffer-base-buffer buffer) buffer)
(when (and org-element-use-cache (derived-mode-p 'org-mode))
;; Only persist cache in file buffers.
- (when (buffer-file-name)
+ (when (and (buffer-file-name) (not no-persistance))
(when (not org-element-cache-persistent)
(org-persist-unregister 'org-element--headline-cache
(current-buffer))
(org-persist-unregister 'org-element--cache (current-buffer)))
diff --git a/lisp/org-table.el b/lisp/org-table.el
index 5362b5f8f4..a65abf850e 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -59,7 +59,7 @@
(declare-function org-element-parse-buffer "org-element" (&optional
granularity visible-only))
(declare-function org-element-property "org-element" (property element))
(declare-function org-element-type "org-element" (element))
-(declare-function org-element-cache-reset "org-element" (&optional all))
+(declare-function org-element-cache-reset "org-element" (&optional all
no-persistence))
(declare-function org-entry-get "org" (pom property &optional inherit
literal-nil))
(declare-function org-export-create-backend "ox" (&rest rest) t)
(declare-function org-export-data-with-backend "ox" (data backend info))
diff --git a/lisp/org.el b/lisp/org.el
index 075b6397f4..640493d224 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -168,7 +168,7 @@ Stars are put in group 1 and the trimmed body in group 2.")
(declare-function org-element-at-point "org-element" (&optional pom
cached-only))
(declare-function org-element-at-point-no-context "org-element" (&optional
pom))
(declare-function org-element-cache-refresh "org-element" (pos))
-(declare-function org-element-cache-reset "org-element" (&optional all))
+(declare-function org-element-cache-reset "org-element" (&optional all
no-persistence))
(declare-function org-element-cache-map "org-element" (func &rest keys))
(declare-function org-element-contents "org-element" (element))
(declare-function org-element-context "org-element" (&optional element))
diff --git a/lisp/ox.el b/lisp/ox.el
index 65c0b39167..5142700c13 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -2671,7 +2671,7 @@ The function assumes BUFFER's major mode is `org-mode'."
(when str (erase-buffer) (insert str))
;; Make org-element-cache not complain about changed buffer
;; state.
- (org-element-cache-reset)
+ (org-element-cache-reset nil 'no-persistence)
;; Narrowing.
(when narrowing
(apply #'narrow-to-region narrowing))
- [elpa] externals/org 5a167f6ef2 02/13: org-element-cache-reset: Never use cache persistence in non-file buffers, (continued)
- [elpa] externals/org 5a167f6ef2 02/13: org-element-cache-reset: Never use cache persistence in non-file buffers, ELPA Syncer, 2022/10/07
- [elpa] externals/org b45911d41e 06/13: org-export-copy-buffer: Prevent saving to disk, ELPA Syncer, 2022/10/07
- [elpa] externals/org 09fd5f886a 07/13: org-html-format-latex: Avoid unnecessary string allocation, ELPA Syncer, 2022/10/07
- [elpa] externals/org 2f4de60980 12/13: ob-emacs-lisp: Don't print arguments of post-process arguments to stdout, ELPA Syncer, 2022/10/07
- [elpa] externals/org 0be36ac13e 10/13: org-html-format-latex: Prevent save prompt for temporary buffer, ELPA Syncer, 2022/10/07
- [elpa] externals/org 7f3a6cf6e7 11/13: org-capture: Add template hook properties, ELPA Syncer, 2022/10/07
- [elpa] externals/org 279bee087d 01/13: org-element-clock-line-re: Fix Emacs 26 compatibility after e305755b1, ELPA Syncer, 2022/10/07
- [elpa] externals/org aa90e5b59c 03/13: org-export-with-buffer-copy: Avoid all the hooks, not just `org-mode-hook', ELPA Syncer, 2022/10/07
- [elpa] externals/org 4cb1b8ebd0 04/13: org-export-ignored-local-variables: Do not copy cache, ELPA Syncer, 2022/10/07
- [elpa] externals/org 0551eba40c 05/13: org-export-get-ordinal: Cache results, ELPA Syncer, 2022/10/07
- [elpa] externals/org 514e3a9cd2 08/13: org-export: Suppress cache persistence in buffer copies during export,
ELPA Syncer <=
- [elpa] externals/org dcdf98a564 09/13: org-export-copy-buffer: Update declarations, ELPA Syncer, 2022/10/07
- [elpa] externals/org fc8e375b9b 13/13: Begin messages about executing code blocks with a capital letter, ELPA Syncer, 2022/10/07