From 38a681fdaeae697f64974952bad63fce40f59ceb Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Wed, 12 Jan 2022 20:32:33 +0800 Subject: [PATCH] org-element-cache-reset: Do not persist caches for non-file buffers --- lisp/org-element.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org-element.el b/lisp/org-element.el index d556ab2ee..307b93b3f 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -7125,7 +7125,8 @@ buffers." (when (not org-element-cache-persistent) (org-persist-unregister 'org-element--headline-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--headline-cache (current-buffer)