From: Le Wang <l26wang@gmail.com>
To: Barry Margolin <barmar@alum.mit.edu>
Cc: help-gnu-emacs@gnu.org
Subject: Re: eval-after-load causes void-variable error
Date: Fri, 18 Jan 2013 09:35:18 +0800 [thread overview]
Message-ID: <CAM=K+ipf=PLPqJB7kV3z8ganbPM0vyGO1AYEbYwxoWtmFetJTg@mail.gmail.com> (raw)
In-Reply-To: <barmar-EFE6FE.19070017012013@news.eternal-september.org>
On Fri, Jan 18, 2013 at 8:07 AM, Barry Margolin <barmar@alum.mit.edu> wrote:
> When you use a feature name rather than a filename (i.e. a symbol rather
> than a string) in eval-after-load, it evals as soon as the feature is
> provided, not after the file is loaded. ffap.el contains
>
> (provide 'ffap)
>
> at the beginning of the file, so your expression gets evaluated before
> ffap-alist has been initialized. It really should be at the end, since
> the feature doesn't really exist until the whole file is loaded.
Definitely using the filename is preferred, however reading the source
of `eval-after-load' on 24.2.1 it seems like this has been "fixed".
;; For features, the after-load-alist elements get run when `provide' is
;; called rather than at the end of the file. So add an indirection to
;; make sure that `form' is really run "after-load" in case the provide
;; call happens early.
> --
> Barry Margolin, barmar@alum.mit.edu
> Arlington, MA
> *** PLEASE post questions in newsgroups, not directly to me ***
--
Le
next prev parent reply other threads:[~2013-01-18 1:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-17 23:53 eval-after-load causes void-variable error Sean McAfee
2013-01-18 0:07 ` Barry Margolin
2013-01-18 1:35 ` Le Wang [this message]
2013-01-18 3:21 ` Dmitry Gutov
[not found] ` <mailman.17773.1358479324.855.help-gnu-emacs@gnu.org>
2013-01-18 5:15 ` Barry Margolin
2013-01-18 7:19 ` Dmitry Gutov
[not found] ` <mailman.17789.1358493580.855.help-gnu-emacs@gnu.org>
2013-01-18 17:57 ` Sean McAfee
2013-01-18 18:08 ` Barry Margolin
2013-01-18 19:04 ` Eli Zaretskii
[not found] ` <mailman.17839.1358535836.855.help-gnu-emacs@gnu.org>
2013-01-18 19:17 ` Barry Margolin
2013-01-18 18:34 ` Dmitry Gutov
2013-01-18 18:00 ` Barry Margolin
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAM=K+ipf=PLPqJB7kV3z8ganbPM0vyGO1AYEbYwxoWtmFetJTg@mail.gmail.com' \
--to=l26wang@gmail.com \
--cc=barmar@alum.mit.edu \
--cc=help-gnu-emacs@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.