From: Austin Clements <amdragon@MIT.EDU>
To: Tomi Ollila <tomi.ollila@iki.fi>
Cc: notmuch@notmuchmail.org
Subject: Re: [PATCH] emacs: Fix "not defined at runtime" warning
Date: Thu, 9 Aug 2012 10:12:11 -0400 [thread overview]
Message-ID: <20120809141211.GG11179@mit.edu> (raw)
In-Reply-To: <m2628scxsf.fsf@guru.guru-group.fi>
Quoth Tomi Ollila on Aug 09 at 10:46 am:
> On Thu, Aug 09 2012, Austin Clements <amdragon@MIT.EDU> wrote:
>
> > Previously, the Emacs byte compiler produced the warning
> >
> > the function `remove-if-not' might not be defined at runtime.
> >
> > because we only required cl at compile-time (not runtime). This fixes
> > this warning by requiring cl at runtime, ensuring that the definition
> > of remove-if-not is available.
> > ---
>
> LGTM.
>
> It took me a while to understand this. Now I just don't understand
> how did this work before. And why (require 'cl) is enough as
> remove-if-not is defined in cl-seq.el -- cl-seq.el requires cl
> but not vice-versa -- or at least I don't see that. Anyway
> (require 'cl) is the common way.
This worked before in practice because 'cl is inevitably loaded by
some package, somewhere, but I'm sure it could be broken by a
sufficiently stripped down Emacs environment.
(require 'cl) is enough because cl.el contains
(load "cl-loaddefs" nil 'quiet)
and cl-loaddefs.el defines an autoload for remove-if-not that in turn
loads cl-seq the first time remove-if-not is called.
In fact, we *can't* (require 'cl-seq) because cl-seq.el never (provide
'cl-seq)s. We could (load ...) it, but the fact that it never
provides a package name strongly suggests that the division of cl into
separate files is an implementation detail.
> Tomi
>
> > emacs/notmuch-lib.el | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
> > index 30db58f..900235b 100644
> > --- a/emacs/notmuch-lib.el
> > +++ b/emacs/notmuch-lib.el
> > @@ -24,7 +24,7 @@
> > (require 'mm-view)
> > (require 'mm-decode)
> > (require 'json)
> > -(eval-when-compile (require 'cl))
> > +(require 'cl)
> >
> > (defvar notmuch-command "notmuch"
> > "Command to run the notmuch binary.")
next prev parent reply other threads:[~2012-08-09 14:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-08 21:40 [PATCH] emacs: Fix "not defined at runtime" warning Austin Clements
2012-08-09 7:46 ` Tomi Ollila
2012-08-09 14:12 ` Austin Clements [this message]
2012-08-09 7:54 ` Jameson Graef Rollins
2012-08-09 14:13 ` Austin Clements
2012-08-12 19:49 ` David Bremner
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://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120809141211.GG11179@mit.edu \
--to=amdragon@mit.edu \
--cc=notmuch@notmuchmail.org \
--cc=tomi.ollila@iki.fi \
/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://yhetil.org/notmuch.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).