org-element--cache-persist-before-write: Avoid saving in non-org buffers
* lisp/org-element.el (org-element--cache-persist-before-write): Do not try to save cache when buffer is not in Org mode and when cache is not initialised. Fixes https://list.orgmode.org/CAFyQvY1rEbL8LJWSR-q6sNgwS1_+Assyd=Jmv1YgeeQ_R3Yn5g@mail.gmail.com/T/#u
This commit is contained in:
parent
ced2b33357
commit
1492fc5857
|
@ -6874,7 +6874,9 @@ The element is: %S\n The real element is: %S\n Cache around :begin:\n%S\n%S\n%S"
|
||||||
(when (and org-element-use-cache
|
(when (and org-element-use-cache
|
||||||
buffer
|
buffer
|
||||||
org-element-cache-persistent
|
org-element-cache-persistent
|
||||||
(eq var 'org-element--cache))
|
(eq var 'org-element--cache)
|
||||||
|
(derived-mode-p 'org-mode)
|
||||||
|
org-element--cache)
|
||||||
(with-current-buffer buffer
|
(with-current-buffer buffer
|
||||||
;; Cleanup cache request keys to avoid collisions during next
|
;; Cleanup cache request keys to avoid collisions during next
|
||||||
;; Emacs session.
|
;; Emacs session.
|
||||||
|
|
Loading…
Reference in New Issue