From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: bug#15888: 24.3.50; Eval-after-load eval'ed twice Date: Sat, 16 Nov 2013 22:06:17 -0500 Message-ID: <87wqk7hgly.fsf@gmail.com> References: <868uws6lgt.fsf@somewhere.org> <86ob5mxktp.fsf@somewhere.org> <4jppq1ha35.fsf__32040.8881329515$1384535048$gmane$org@fencepost.gnu.org> <87txfdy2cu.fsf@alphaville.bos.redhat.com> <87mwl5jz3q.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55563) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vhsh0-0000fg-W5 for emacs-orgmode@gnu.org; Sat, 16 Nov 2013 22:06:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vhsgu-000597-PV for emacs-orgmode@gnu.org; Sat, 16 Nov 2013 22:06:34 -0500 Received: from plane.gmane.org ([80.91.229.3]:41735) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vhsgu-000593-BU for emacs-orgmode@gnu.org; Sat, 16 Nov 2013 22:06:28 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Vhsgt-00045J-6F for emacs-orgmode@gnu.org; Sun, 17 Nov 2013 04:06:27 +0100 Received: from pool-108-7-96-134.bstnma.fios.verizon.net ([108.7.96.134]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 17 Nov 2013 04:06:27 +0100 Received: from ndokos by pool-108-7-96-134.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 17 Nov 2013 04:06:27 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Nicolas Goaziou writes: >> 0cecf32a0ae559266555b96668dc305710366c96 is the first bad commit >> commit 0cecf32a0ae559266555b96668dc305710366c96 >> Author: Nicolas Goaziou >> 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=20 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(# nil "/home/nick/src/emacs/org/org-mo= de/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(# nil "/home/nick/src/emacs/org/org-mod= e/lisp/org-element.el" nil t) load-with-code-conversion("/home/nick/src/emacs/org/org-mode/lisp/org-ele= ment.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-r= eset (quote all)))) (lambda (var val) (set var val) (if (fboundp (quote org-element-cache-res= et)) (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 lo= cally 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 var= iable 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 expor= t, 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 ru= n the following command after the change:\n\n \\[universal-argument] \\[or= g-element-cache-reset]" :group org-footnote :initialize custom-initialize-s= et :set (lambda (var val) (set var val) (if (fboundp (quote org-element-cac= he-reset)) (progn (org-element-cache-reset (quote all))))) :type (choice (s= tring :tag "Collect footnotes under heading") (const :tag "Define footnotes= locally" nil))) eval-buffer(# nil "/home/nick/src/emacs/org/org-mo= de/lisp/org-footnote.el" nil t) load-with-code-conversion("/home/nick/src/emacs/org/org-mode/lisp/org-foo= tnote.el" "/home/nick/src/emacs/org/org-mode/lisp/org-footnote.el" nil t) require(org-footnote) eval-buffer(# 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(# "~/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(# 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(# "~/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. --=20 Nick