File tree Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -7238,16 +7238,18 @@ Each element indicates the latest `org-element--cache-change-tic' when
72387238change did not contain gaps.")
72397239
72407240;;;###autoload
7241- (defun org-element-cache-reset (&optional all)
7241+ (defun org-element-cache-reset (&optional all no-persistance )
72427242 "Reset cache in current buffer.
72437243When optional argument ALL is non-nil, reset cache in all Org
7244- buffers."
7244+ buffers.
7245+ When optional argument NO-PERSISTANCE is non-nil, do not try to update
7246+ the cache persistence in the buffer."
72457247 (interactive "P")
72467248 (dolist (buffer (if all (buffer-list) (list (current-buffer))))
72477249 (with-current-buffer (or (buffer-base-buffer buffer) buffer)
72487250 (when (and org-element-use-cache (derived-mode-p 'org-mode))
72497251 ;; Only persist cache in file buffers.
7250- (when (buffer-file-name)
7252+ (when (and ( buffer-file-name) (not no-persistance) )
72517253 (when (not org-element-cache-persistent)
72527254 (org-persist-unregister 'org-element--headline-cache (current-buffer))
72537255 (org-persist-unregister 'org-element--cache (current-buffer)))
Original file line number Diff line number Diff line change 5959(declare-function org-element-parse-buffer "org-element" (&optional granularity visible-only))
6060(declare-function org-element-property "org-element" (property element))
6161(declare-function org-element-type "org-element" (element))
62- (declare-function org-element-cache-reset "org-element" (&optional all))
62+ (declare-function org-element-cache-reset "org-element" (&optional all no-persistence ))
6363(declare-function org-entry-get "org" (pom property &optional inherit literal-nil))
6464(declare-function org-export-create-backend "ox" (&rest rest) t)
6565(declare-function org-export-data-with-backend "ox" (data backend info))
Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ Stars are put in group 1 and the trimmed body in group 2.")
168168(declare-function org-element-at-point "org-element" (&optional pom cached-only))
169169(declare-function org-element-at-point-no-context "org-element" (&optional pom))
170170(declare-function org-element-cache-refresh "org-element" (pos))
171- (declare-function org-element-cache-reset "org-element" (&optional all))
171+ (declare-function org-element-cache-reset "org-element" (&optional all no-persistence ))
172172(declare-function org-element-cache-map "org-element" (func &rest keys))
173173(declare-function org-element-contents "org-element" (element))
174174(declare-function org-element-context "org-element" (&optional element))
Original file line number Diff line number Diff line change @@ -2671,7 +2671,7 @@ The function assumes BUFFER's major mode is `org-mode'."
26712671 (when str (erase-buffer) (insert str))
26722672 ;; Make org-element-cache not complain about changed buffer
26732673 ;; state.
2674- (org-element-cache-reset)
2674+ (org-element-cache-reset nil 'no-persistence )
26752675 ;; Narrowing.
26762676 (when narrowing
26772677 (apply #'narrow-to-region narrowing))
You can’t perform that action at this time.
0 commit comments