From: "Drew Adams" <drew.adams@oracle.com>
To: "'Le Wang'" <l26wang@gmail.com>,
"'Juanma Barranquero'" <lekktu@gmail.com>
Cc: emacs-devel@gnu.org
Subject: RE: when to call provide, first or last?
Date: Mon, 27 Feb 2012 06:05:46 -0800 [thread overview]
Message-ID: <A5BD4B83974C41B7BA5EAF215E386EED@us.oracle.com> (raw)
In-Reply-To: <CAM=K+ioNray+7UTj45AxJ2akJnzLSWqU3XS6vMYb+2P0AbgK0Q@mail.gmail.com>
> I'm just trying to clarify what the idiomatic way to use it is.
Put it last, EXCEPT for this situation described in section `(elisp) Named
Features':
"Although top-level calls to `require' are evaluated during byte
compilation, `provide' calls are not. Therefore, you can ensure that a
file of definitions is loaded before it is byte-compiled by including a
`provide' followed by a `require' for the same feature, as in the
following example.
(provide 'my-feature) ; Ignored by byte compiler,
; evaluated by `load'.
(require 'my-feature) ; Evaluated by byte compiler.
The compiler ignores the `provide', then processes the `require' by
loading the file in question. Loading the file does execute the
`provide' call, so the subsequent `require' call does nothing when the
file is loaded."
> Maybe a summary of this discussion should be in the manual?
Consider filing a doc bug, after you've reread pertinent parts of the manual and
are still convinced that improvement is in order.
next prev parent reply other threads:[~2012-02-27 14:05 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-27 12:47 when to call provide, first or last? Le Wang
2012-02-27 12:59 ` Juanma Barranquero
2012-02-27 13:09 ` Le Wang
2012-02-27 13:25 ` Juanma Barranquero
2012-02-27 13:32 ` Le Wang
2012-02-27 13:44 ` Juanma Barranquero
2012-02-27 13:57 ` Le Wang
2012-02-27 14:05 ` Drew Adams [this message]
2012-02-27 13:35 ` Stefan Monnier
2012-02-27 13:42 ` Le Wang
2012-02-27 14:25 ` Stefan Monnier
2012-02-27 15:08 ` Harald Hanche-Olsen
2012-02-27 15:46 ` Le Wang
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.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=A5BD4B83974C41B7BA5EAF215E386EED@us.oracle.com \
--to=drew.adams@oracle.com \
--cc=emacs-devel@gnu.org \
--cc=l26wang@gmail.com \
--cc=lekktu@gmail.com \
/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.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).