emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: "Mark A. Hershberger" <mah@everybody.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: 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	[thread overview]
Message-ID: <87twrsmzwy.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87oai3yre6.fsf@flynn.nichework.com> (Mark A. Hershberger's message of "Wed, 19 Aug 2015 16:06:41 -0400")

Hello,

"Mark A. Hershberger" <mah@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	other threads:[~2015-08-21 15:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-19 20:06 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/)] Mark A. Hershberger
2015-08-21 15:20 ` Nicolas Goaziou [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87twrsmzwy.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=mah@everybody.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).