unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: Fix "not defined at runtime" warning
@ 2012-08-08 21:40 Austin Clements
  2012-08-09  7:46 ` Tomi Ollila
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Austin Clements @ 2012-08-08 21:40 UTC (permalink / raw)
  To: notmuch

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.
---
 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.")
-- 
1.7.10

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] emacs: Fix "not defined at runtime" warning
  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
  2012-08-09  7:54 ` Jameson Graef Rollins
  2012-08-12 19:49 ` David Bremner
  2 siblings, 1 reply; 6+ messages in thread
From: Tomi Ollila @ 2012-08-09  7:46 UTC (permalink / raw)
  To: Austin Clements, notmuch

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.

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.")
> -- 
> 1.7.10
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] emacs: Fix "not defined at runtime" warning
  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  7:54 ` Jameson Graef Rollins
  2012-08-09 14:13   ` Austin Clements
  2012-08-12 19:49 ` David Bremner
  2 siblings, 1 reply; 6+ messages in thread
From: Jameson Graef Rollins @ 2012-08-09  7:54 UTC (permalink / raw)
  To: Austin Clements, notmuch

[-- Attachment #1: Type: text/plain, Size: 1108 bytes --]

On Wed, Aug 08 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.
> ---
>  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.")

LGTM.  I think it would be good to finally just give in a require cl, so
we can finally put to rest the long standing schizophrenia we've had in
regards to using it, and maybe finally kill the compile warnings that
keep popping up.

jamie.

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] emacs: Fix "not defined at runtime" warning
  2012-08-09  7:46 ` Tomi Ollila
@ 2012-08-09 14:12   ` Austin Clements
  0 siblings, 0 replies; 6+ messages in thread
From: Austin Clements @ 2012-08-09 14:12 UTC (permalink / raw)
  To: Tomi Ollila; +Cc: notmuch

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.")

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] emacs: Fix "not defined at runtime" warning
  2012-08-09  7:54 ` Jameson Graef Rollins
@ 2012-08-09 14:13   ` Austin Clements
  0 siblings, 0 replies; 6+ messages in thread
From: Austin Clements @ 2012-08-09 14:13 UTC (permalink / raw)
  To: Jameson Graef Rollins; +Cc: notmuch

Quoth Jameson Graef Rollins on Aug 09 at 12:54 am:
> On Wed, Aug 08 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.
> > ---
> >  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.")
> 
> LGTM.  I think it would be good to finally just give in a require cl, so
> we can finally put to rest the long standing schizophrenia we've had in
> regards to using it, and maybe finally kill the compile warnings that
> keep popping up.

I think we already gave in [0], we just weren't very thorough about
it.

[0] id:"m262g864dz.fsf@wal122.wireless-pennnet.upenn.edu"

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] emacs: Fix "not defined at runtime" warning
  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  7:54 ` Jameson Graef Rollins
@ 2012-08-12 19:49 ` David Bremner
  2 siblings, 0 replies; 6+ messages in thread
From: David Bremner @ 2012-08-12 19:49 UTC (permalink / raw)
  To: Austin Clements, notmuch

Austin Clements <amdragon@MIT.EDU> writes:

> Previously, the Emacs byte compiler produced the warning
>
>     the function `remove-if-not' might not be defined at runtime.

pushed, 

d

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-08-12 19:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2012-08-09  7:54 ` Jameson Graef Rollins
2012-08-09 14:13   ` Austin Clements
2012-08-12 19:49 ` David Bremner

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).