emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <ndokos@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: bug#15888: 24.3.50; Eval-after-load eval'ed twice
Date: Sat, 16 Nov 2013 22:06:17 -0500	[thread overview]
Message-ID: <87wqk7hgly.fsf@gmail.com> (raw)
In-Reply-To: 87mwl5jz3q.fsf@gmail.com

Nicolas Goaziou <n.goaziou@gmail.com> writes:


>> 0cecf32a0ae559266555b96668dc305710366c96 is the first bad commit
>> commit 0cecf32a0ae559266555b96668dc305710366c96
>> Author: Nicolas Goaziou <n.goaziou@gmail.com>
>> Date:   Sun Oct 27 11:09:17 2013 +0100
>
> Well. The only thing related to load/autoload I can think of is calling
> `org-element-cache-reset' in `org-mode' and `org-set-modules'.
>
> Could you try to replace these calls with
>
>   (when (fboundp 'org-element-cache-reset) (org-element-cache-reset))
>
> and test again?
>

I started emacs with 

  emacs -Q -L ~/src/emacs/org/org-mode/lisp -l double-load.el

where double-load.el looks like this:

--8<---------------cut here---------------start------------->8---

(defun foobar ()
  (message "LOADED") (sit-for 3) (message ""))

(setq org-load-hook (function foobar))
--8<---------------cut here---------------end--------------->8---

and edebugged foobar. Then I did a C-x C-f foo.org. It stopped twice
at foobar and I got backtraces (this is with the version that includes
the change you suggested above). The first time it stopped, the backtrace
looked like this:

--8<---------------cut here---------------start------------->8---
  foobar()
  run-hooks(org-load-hook)
  eval-buffer(#<buffer  *load*-343984> nil "/home/nick/src/emacs/org/org-mode/lisp/org.el" nil t)
  load-with-code-conversion("/home/nick/src/emacs/org/org-mode/lisp/org.el" "/home/nick/src/emacs/org/org-mode/lisp/org.el" nil t)
  require(org)
  eval-buffer(#<buffer  *load*-57513> nil "/home/nick/src/emacs/org/org-mode/lisp/org-element.el" nil t)
  load-with-code-conversion("/home/nick/src/emacs/org/org-mode/lisp/org-element.el" "/home/nick/src/emacs/org/org-mode/lisp/org-element.el" nil t)
  (org-element-cache-reset (quote all))
  (progn (org-element-cache-reset (quote all)))
  (if (fboundp (quote org-element-cache-reset)) (progn (org-element-cache-reset (quote all))))
  (lambda (var val) (set var val) (if (fboundp (quote org-element-cache-reset)) (progn (org-element-cache-reset (quote all)))))(org-footnote-section "Footnotes")
  custom-initialize-set(org-footnote-section "Footnotes")
  custom-declare-variable(org-footnote-section "Footnotes" "Outline heading containing footnote definitions.\n\nThis can be nil, to place footnotes locally at the end of the\ncurrent outline node.  If can also be the name of a special\noutline heading under which footnotes should be put.\n\nThis variable defines the place where Org puts the definition\nautomatically, i.e. when creating the footnote, and when sorting\nthe notes.  However, by hand you may place definitions\n*anywhere*.\n\nIf this is a string, during export, all subtrees starting with\nthis heading will be ignored.\n\nIf you don't use the customize interface to change this variable,\nyou will need to run the following command after the change:\n\n  \\[universal-argument] \\[org-element-cache-reset]" :group org-footnote :initialize custom-initialize-set :set (lambda (var val) (set var val) (if (fboundp (quote org-element-cache-reset)) (progn (org-element-cache-reset (quote all))))) :type (choice (string :tag "Collect footnotes under heading") (const :tag "Define footnotes locally" nil)))
  eval-buffer(#<buffer  *load*-118381> nil "/home/nick/src/emacs/org/org-mode/lisp/org-footnote.el" nil t)
  load-with-code-conversion("/home/nick/src/emacs/org/org-mode/lisp/org-footnote.el" "/home/nick/src/emacs/org/org-mode/lisp/org-footnote.el" nil t)
  require(org-footnote)
  eval-buffer(#<buffer  *load*> nil "/home/nick/src/emacs/org/org-mode/lisp/org.el" nil t)
  load-with-code-conversion("/home/nick/src/emacs/org/org-mode/lisp/org.el" "/home/nick/src/emacs/org/org-mode/lisp/org.el" nil t)
  org-mode()
  set-auto-mode-0(org-mode nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(t t)
  find-file-noselect-1(#<buffer foo.org> "~/src/emacs/org/org-mode/foo.org" nil nil "~/src/emacs/org/org-mode/foo.org" nil)
  find-file-noselect("~/src/emacs/org/org-mode/foo.org" nil nil t)
  find-file("~/src/emacs/org/org-mode/foo.org" t)
  call-interactively(find-file nil nil)
  command-execute(find-file)

--8<---------------cut here---------------end--------------->8---

The second time it stopped, the backtrace looked like this:

--8<---------------cut here---------------start------------->8---
  foobar()
  run-hooks(org-load-hook)
  eval-buffer(#<buffer  *load*> nil "/home/nick/src/emacs/org/org-mode/lisp/org.el" nil t)
  load-with-code-conversion("/home/nick/src/emacs/org/org-mode/lisp/org.el" "/home/nick/src/emacs/org/org-mode/lisp/org.el" nil t)
  org-mode()
  set-auto-mode-0(org-mode nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(t t)
  find-file-noselect-1(#<buffer foo.org> "~/src/emacs/org/org-mode/foo.org" nil nil "~/src/emacs/org/org-mode/foo.org" nil)
  find-file-noselect("~/src/emacs/org/org-mode/foo.org" nil nil t)
  find-file("~/src/emacs/org/org-mode/foo.org" t)
  call-interactively(find-file nil nil)
  command-execute(find-file)
--8<---------------cut here---------------end--------------->8---

Hope this helps.

-- 
Nick

  parent reply	other threads:[~2013-11-17  3:06 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <868uws6lgt.fsf@somewhere.org>
     [not found] ` <mailman.6013.1384380609.10748.bug-gnu-emacs@gnu.org>
     [not found]   ` <864n7f7u8d.fsf@somewhere.org>
     [not found]     ` <mailman.6027.1384398545.10748.bug-gnu-emacs@gnu.org>
     [not found]       ` <8638myzu9t.fsf@somewhere.org>
2013-11-14 22:01         ` bug#15888: 24.3.50; Eval-after-load eval'ed twice Glenn Morris
2013-11-15  6:04           ` Bastien
     [not found]             ` <87y54qdwvh.fsf-E3UqQZAQFPqWIDz0JBNUog@public.gmane.org>
2013-11-15  8:33               ` Sebastien Vauban
     [not found]         ` <83siuyiyq4.fsf@gnu.org>
     [not found]           ` <83siuyiyq4.fsf-mXXj517/zsQ@public.gmane.org>
2013-11-15  8:16             ` Sebastien Vauban
     [not found]           ` <868uwqxeoj.fsf@somewhere.org>
2013-11-15  8:42             ` Eli Zaretskii
     [not found]             ` <83iovuhx8w.fsf@gnu.org>
     [not found]               ` <83iovuhx8w.fsf-mXXj517/zsQ@public.gmane.org>
2013-11-15  9:06                 ` Sebastien Vauban
     [not found]               ` <86siuyvxtn.fsf@somewhere.org>
2013-11-15 10:34                 ` Eli Zaretskii
     [not found]                 ` <mailman.6245.1384511726.10748.bug-gnu-emacs@gnu.org>
     [not found]                   ` <mailman.6245.1384511726.10748.bug-gnu-emacs-mXXj517/zsQ@public.gmane.org>
2013-11-15 13:01                     ` Sebastien Vauban
2013-11-15 14:15                       ` Stefan Monnier
     [not found]                       ` <jwvbo1l4utn.fsf-monnier+emacsbugs@gnu.org>
     [not found]                         ` <jwvbo1l4utn.fsf-monnier+emacsbugs-mXXj517/zsQ@public.gmane.org>
2013-11-15 14:27                           ` Sebastien Vauban
2013-11-15 14:35                       ` Eli Zaretskii
2013-11-15  0:06 ` Josh
2013-11-19 20:07   ` Sebastien Vauban
     [not found] ` <CANdFEAEdD1rKvXOwi+ktROSqYXTGg3tbEgTd-hHe10Zfa7YbsQ@mail.gmail.com>
2013-11-15  2:30   ` Glenn Morris
     [not found]   ` <oofvqygzwk.fsf@fencepost.gnu.org>
     [not found]     ` <oofvqygzwk.fsf-iW7gFb+/I3LZHJUXO5efmti2O/JbrIOy@public.gmane.org>
2013-11-15  6:04       ` Sebastien Vauban
     [not found]     ` <86ob5mxktp.fsf@somewhere.org>
2013-11-15 17:02       ` Glenn Morris
2013-11-15 17:57         ` Nick Dokos
2013-11-15 18:31           ` Nicolas Goaziou
2013-11-17  1:23             ` Nick Dokos
2013-11-17  3:06             ` Nick Dokos [this message]
2013-11-17  8:59               ` Nicolas Goaziou
2013-11-17 13:41                 ` Nick Dokos
2013-11-17 18:05                   ` Nick Dokos
     [not found]       ` <4jppq1ha35.fsf@fencepost.gnu.org>
2013-11-17 19:45         ` Glenn Morris
     [not found]         ` <mailman.6434.1384717570.10748.bug-gnu-emacs@gnu.org>
     [not found]           ` <868uws6lgt.fsf-oHC15RC7JGTNLxjTenLetw@public.gmane.org>
2013-11-19 20:05             ` Sebastien Vauban
2013-11-20  4:06               ` Nick Dokos
2013-11-23 14:05                 ` Nicolas Goaziou
2013-12-04 20:48                   ` Sebastien Vauban
2013-12-04 21:35                     ` Nicolas Goaziou
2020-05-22 12:51                       ` Bastien

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=87wqk7hgly.fsf@gmail.com \
    --to=ndokos@gmail.com \
    --cc=emacs-orgmode@gnu.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).