Hello,

"Mark A. Hershberger" <m...@everybody.org> writes:

> While composing an email in mu4e, I get the following backtrace.  It
> looks like this is because mu4e switches buffers between the time
> org-element-cache-reset is called and the time that
> org-element--cache-sync is called.

Does the following change solve the issue?


diff --git a/lisp/org-element.el b/lisp/org-element.el
index 8f41ab2..3179fae 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -4903,6 +4903,7 @@ This function assumes `org-element--cache' is a valid AVL 
tree."
 (defsubst org-element--cache-active-p ()
   "Non-nil when cache is active in current buffer."
   (and org-element-use-cache
+       org-element--cache
        (or (derived-mode-p 'org-mode) orgstruct-mode)))
 
 (defun org-element--cache-find (pos &optional side)
@@ -5615,7 +5616,8 @@ buffers."
   (interactive "P")
   (dolist (buffer (if all (buffer-list) (list (current-buffer))))
     (with-current-buffer buffer
-      (when (org-element--cache-active-p)
+      (when (and org-element-use-cache
+                (or (derived-mode-p 'org-mode) orgstruct-mode))
        (org-set-local 'org-element--cache
                       (avl-tree-create #'org-element--cache-compare))
        (org-set-local 'org-element--cache-objects (make-hash-table :test #'eq))


Regards,

-- 
Nicolas Goaziou

Reply via email to