Subject: bug#15888: 24.3.50; Eval-after-load eval'ed twice

From: "Sebastien Vauban" <[email-masked]>
Date: Wed, 13 Nov 2013 22:27:46 +0100

Hello,

With the following minimal configuration file:

--8<---------------cut here---------------start------------->8---
(add-to-list 'load-path "~/Public/Repositories/org-mode/testing")
(add-to-list 'load-path "~/Public/Repositories/org-mode/contrib/lisp")
(add-to-list 'load-path "~/Public/Repositories/org-mode/lisp")

;; getting started
(require 'org-loaddefs)
(add-to-list 'auto-mode-alist '("\\.txt\\'" . org-mode))
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))

(with-eval-after-load "org"
  (message "Eval this when Org is loaded")
  (sit-for 3)
  (message ""))
--8<---------------cut here---------------end--------------->8---

the code block in the `with-eval-after-load' is eval'ed twice whenever an Org
file is loaded.

Best regards,
  Seb

In GNU Emacs 24.3.50.1 (i686-pc-mingw32)
 of 2013-10-19 on LEG570
Bzr revision: 114715 [email-masked]
Windowing system distributor `Microsoft Corp.', version 6.2.9200
Configured using:
 `configure --enable-checking 'CFLAGS=-O0 -g3' CPPFLAGS=-DGLYPH_DEBUG=1'

Important settings:
  value of $LANG: en_US.utf8
  locale-coding-system: cp1252
  default enable-multibyte-characters: t

Major mode: Group

Minor modes in effect:
  gnus-topic-mode: t
  global-auto-complete-mode: t
  gnus-undo-mode: t
  auto-image-file-mode: t
  recentf-mode: t
  shell-dirtrack-mode: t
  helm-match-plugin-mode: t
  helm-occur-match-plugin-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
d:/Users/sva/.emacs.d/elpa/graphviz-dot-mode-20120821.1835/graphviz-dot-mode hides ~/.emacs.d/site-lisp/graphviz-dot-mode
~/Public/Repositories/org-mode/lisp/org hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org
~/Public/Repositories/org-mode/contrib/lisp/org-wl hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-wl
~/Public/Repositories/org-mode/lisp/org-w3m hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-w3m
~/Public/Repositories/org-mode/contrib/lisp/org-vm hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-vm
~/Public/Repositories/org-mode/lisp/org-version hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-version
~/Public/Repositories/org-mode/lisp/org-timer hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-timer
~/Public/Repositories/org-mode/lisp/org-table hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-table
~/Public/Repositories/org-mode/lisp/org-src hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-src
~/Public/Repositories/org-mode/lisp/org-rmail hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-rmail
~/Public/Repositories/org-mode/lisp/org-protocol hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-protocol
~/Public/Repositories/org-mode/lisp/org-plot hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-plot
~/Public/Repositories/org-mode/lisp/org-pcomplete hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-pcomplete
~/Public/Repositories/org-mode/lisp/org-mouse hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-mouse
~/Public/Repositories/org-mode/lisp/org-mobile hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-mobile
~/Public/Repositories/org-mode/lisp/org-mhe hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-mhe
~/Public/Repositories/org-mode/contrib/lisp/org-mew hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-mew
~/Public/Repositories/org-mode/lisp/org-macs hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-macs
~/Public/Repositories/org-mode/lisp/org-loaddefs hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-loaddefs
~/Public/Repositories/org-mode/lisp/org-list hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-list
~/Public/Repositories/org-mode/lisp/org-irc hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-irc
~/Public/Repositories/org-mode/lisp/org-install hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-install
~/Public/Repositories/org-mode/lisp/org-inlinetask hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-inlinetask
~/Public/Repositories/org-mode/lisp/org-info hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-info
~/Public/Repositories/org-mode/lisp/org-indent hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-indent
~/Public/Repositories/org-mode/lisp/org-id hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-id
~/Public/Repositories/org-mode/lisp/org-habit hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-habit
~/Public/Repositories/org-mode/lisp/org-gnus hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-gnus
~/Public/Repositories/org-mode/lisp/org-footnote hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-footnote
~/Public/Repositories/org-mode/lisp/org-feed hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-feed
~/Public/Repositories/org-mode/lisp/org-faces hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-faces
~/Public/Repositories/org-mode/lisp/org-eshell hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-eshell
~/Public/Repositories/org-mode/lisp/org-entities hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-entities
~/Public/Repositories/org-mode/lisp/org-element hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-element
~/Public/Repositories/org-mode/lisp/org-docview hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-docview
~/Public/Repositories/org-mode/lisp/org-datetree hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-datetree
~/Public/Repositories/org-mode/lisp/org-ctags hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-ctags
~/Public/Repositories/org-mode/lisp/org-crypt hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-crypt
~/Public/Repositories/org-mode/lisp/org-compat hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-compat
~/Public/Repositories/org-mode/lisp/org-colview hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-colview
~/Public/Repositories/org-mode/lisp/org-clock hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-clock
~/Public/Repositories/org-mode/lisp/org-capture hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-capture
~/Public/Repositories/org-mode/lisp/org-bibtex hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-bibtex
~/Public/Repositories/org-mode/lisp/org-bbdb hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-bbdb
~/Public/Repositories/org-mode/lisp/org-attach hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-attach
~/Public/Repositories/org-mode/lisp/org-archive hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-archive
~/Public/Repositories/org-mode/lisp/org-agenda hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/org-agenda
~/Public/Repositories/org-mode/lisp/ob hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob
~/Public/Repositories/org-mode/lisp/ob-tangle hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-tangle
~/Public/Repositories/org-mode/lisp/ob-table hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-table
~/Public/Repositories/org-mode/lisp/ob-sqlite hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-sqlite
~/Public/Repositories/org-mode/lisp/ob-sql hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-sql
~/Public/Repositories/org-mode/lisp/ob-shen hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-shen
~/Public/Repositories/org-mode/lisp/ob-sh hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-sh
~/Public/Repositories/org-mode/lisp/ob-screen hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-screen
~/Public/Repositories/org-mode/lisp/ob-scheme hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-scheme
~/Public/Repositories/org-mode/lisp/ob-scala hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-scala
~/Public/Repositories/org-mode/lisp/ob-sass hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-sass
~/Public/Repositories/org-mode/lisp/ob-ruby hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-ruby
~/Public/Repositories/org-mode/lisp/ob-ref hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-ref
~/Public/Repositories/org-mode/lisp/ob-R hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-R
~/Public/Repositories/org-mode/lisp/ob-python hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-python
~/Public/Repositories/org-mode/lisp/ob-plantuml hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-plantuml
~/Public/Repositories/org-mode/lisp/ob-picolisp hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-picolisp
~/Public/Repositories/org-mode/lisp/ob-perl hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-perl
~/Public/Repositories/org-mode/lisp/ob-org hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-org
~/Public/Repositories/org-mode/lisp/ob-octave hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-octave
~/Public/Repositories/org-mode/lisp/ob-ocaml hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-ocaml
~/Public/Repositories/org-mode/lisp/ob-mscgen hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-mscgen
~/Public/Repositories/org-mode/lisp/ob-maxima hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-maxima
~/Public/Repositories/org-mode/lisp/ob-matlab hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-matlab
~/Public/Repositories/org-mode/lisp/ob-lob hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-lob
~/Public/Repositories/org-mode/lisp/ob-lisp hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-lisp
~/Public/Repositories/org-mode/lisp/ob-lilypond hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-lilypond
~/Public/Repositories/org-mode/lisp/ob-ledger hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-ledger
~/Public/Repositories/org-mode/lisp/ob-latex hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-latex
~/Public/Repositories/org-mode/lisp/ob-keys hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-keys
~/Public/Repositories/org-mode/lisp/ob-js hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-js
~/Public/Repositories/org-mode/lisp/ob-java hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-java
~/Public/Repositories/org-mode/lisp/ob-io hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-io
~/Public/Repositories/org-mode/lisp/ob-haskell hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-haskell
~/Public/Repositories/org-mode/lisp/ob-gnuplot hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-gnuplot
~/Public/Repositories/org-mode/lisp/ob-fortran hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-fortran
~/Public/Repositories/org-mode/lisp/ob-exp hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-exp
~/Public/Repositories/org-mode/lisp/ob-eval hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-eval
~/Public/Repositories/org-mode/lisp/ob-emacs-lisp hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-emacs-lisp
~/Public/Repositories/org-mode/lisp/ob-dot hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-dot
~/Public/Repositories/org-mode/lisp/ob-ditaa hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-ditaa
~/Public/Repositories/org-mode/lisp/ob-css hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-css
~/Public/Repositories/org-mode/lisp/ob-comint hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-comint
~/Public/Repositories/org-mode/lisp/ob-clojure hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-clojure
~/Public/Repositories/org-mode/lisp/ob-calc hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-calc
~/Public/Repositories/org-mode/lisp/ob-C hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-C
~/Public/Repositories/org-mode/lisp/ob-awk hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-awk
~/Public/Repositories/org-mode/lisp/ob-asymptote hides c:/Program Files (x86)/emacs-r114715-20131019-w32/share/emacs/24.3.50/lisp/org/ob-asymptote

Features:
(shadow sort gnus-cite gnus-alias nnir emacsbug helm-command helm-elisp
helm-eval helm-mode gnus-topic mail-extr utf-7 nndraft nnmh nnimap parse-time
utf7 gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art
mm-uu mml2015 mm-view mml-smime smime dig gnus-cache bbdb-message sendmail
epa-file epa epg epg-config netrc gnutls network-stream starttls tls nntp
gnus-leuven gnus-dired bbdb-gnus bbdb-mua bbdb-com crm bbdb bbdb-site timezone
saveplace server auto-complete-config auto-complete popup time-stamp copyright
vc-dispatcher vc-svn org-table git-commit vc-git org-id org-gnus gnus-sum nnoo
gnus-group gnus-undo nnmail mail-source gnus-start gnus-spec gnus-int
gnus-range message rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse
rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus-win
gnus gnus-ems nnheader mail-utils org-habit org-agenda org-info org-element
org-mime org-crypt ob-sql ob-sh ob-python ob-org ob-ledger ob-latex ob-gnuplot
ob-dot ob-ditaa ob-calc calc-store calc-trail calc-ext calc calc-loaddefs
calc-macs ob-awk ob-R appt diary-lib diary-loaddefs org-inlinetask mule-util
org org-macro org-footnote org-pcomplete org-list org-faces org-entities
org-version ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table ob-keys
ob-exp ob-comint ob-core ob-eval org-compat org-macs cal-menu calendar
cal-loaddefs eldoc edebug redshank skeleton paredit hideshow filecache
image-file bookmark pp recentf tree-widget wid-edit ido helm-files image-dired
whitespace flyspell ispell noutline outline tramp tramp-compat tramp-loaddefs
trampver shell pcomplete format-spec ffap thingatpt helm-buffers helm-elscreen
helm-tags helm-bookmark helm-adaptative helm-info helm-net browse-url xml url
url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf
url-util url-parse auth-source eieio byte-opt bytecomp byte-compile cconv
eieio-core gnus-util mm-util mail-prsvr password-cache url-vars mailcap
helm-plugin helm-locate helm-help helm-match-plugin helm-grep helm-regexp grep
helm-external helm-utils dired-sort-map dired-single dired+ dired-x dired-aux
dired compile comint ansi-color ring helm emacs-leuven leuven-theme yasnippet
help-mode find-func paren mic-paren hl-tags-mode derived org-loaddefs uniquify
helm-config helm-aliases diff-mode- easy-mmode edmacro kmacro idle-require
finder-inf tex-site auto-complete-autoloads bbdb-autoloads
gnuplot-mode-autoloads idle-require-autoloads info easymenu lcs-autoloads
pager-autoloads rainbow-mode-autoloads tidy-autoloads tracking-autoloads
shorten-autoloads package cl-macs gv advice help-fns cl cl-loaddefs cl-lib
time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp
w32-common-fns disp-table w32-win w32-vars tool-bar dnd fontset image
regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan
thai tai-viet lao korean japanese hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple
abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule custom
widget hashtable-print-readable backquote make-network-process w32notify w32
multi-tty emacs)

-- 
Sebastien Vauban