[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Bug: org-element--cache-sync called after switching buffers [8.3

From: Nicolas Goaziou
Subject: Re: [O] Bug: org-element--cache-sync called after switching buffers [8.3.1 (8.3.1-16-gf6aa53-elpa @ /home/mah/.emacs.d/elpa/org-20150810/)]
Date: Fri, 21 Aug 2015 17:20:13 +0200


"Mark A. Hershberger" <address@hidden> 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 
 (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))


Nicolas Goaziou

reply via email to

[Prev in Thread] Current Thread [Next in Thread]