emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] bug#15888: 24.3.50; Eval-after-load eval'ed twice


From: Nick Dokos
Subject: Re: [O] bug#15888: 24.3.50; Eval-after-load eval'ed twice
Date: Sat, 16 Nov 2013 22:06:17 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Nicolas Goaziou <address@hidden> writes:


>> 0cecf32a0ae559266555b96668dc305710366c96 is the first bad commit
>> commit 0cecf32a0ae559266555b96668dc305710366c96
>> Author: Nicolas Goaziou <address@hidden>
>> 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




reply via email to

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