org-element-cache-reset: Do not persist caches for non-file buffers

This commit is contained in:
Ihor Radchenko 2022-01-12 20:32:33 +08:00
parent 1c79af13df
commit 38a681fdae
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 2 additions and 1 deletions

View File

@ -7125,7 +7125,8 @@ buffers."
(when (not org-element-cache-persistent) (when (not org-element-cache-persistent)
(org-persist-unregister 'org-element--headline-cache (current-buffer)) (org-persist-unregister 'org-element--headline-cache (current-buffer))
(org-persist-unregister 'org-element--cache (current-buffer))) (org-persist-unregister 'org-element--cache (current-buffer)))
(when org-element-cache-persistent (when (and org-element-cache-persistent
(buffer-file-name (current-buffer)))
(org-persist-register 'org-element--cache (current-buffer)) (org-persist-register 'org-element--cache (current-buffer))
(org-persist-register 'org-element--headline-cache (org-persist-register 'org-element--headline-cache
(current-buffer) (current-buffer)