Re: [PATCH] emacs: Fix "not defined at runtime" warning
authorAustin Clements <amdragon@MIT.EDU>
Thu, 9 Aug 2012 14:12:11 +0000 (10:12 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:49:00 +0000 (09:49 -0800)
fa/ac3470dd33417e5f6d73d4bfbabf9b3d34969f [new file with mode: 0644]

diff --git a/fa/ac3470dd33417e5f6d73d4bfbabf9b3d34969f b/fa/ac3470dd33417e5f6d73d4bfbabf9b3d34969f
new file mode 100644 (file)
index 0000000..a01ff6d
--- /dev/null
@@ -0,0 +1,129 @@
+Return-Path: <amdragon@mit.edu>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 63F0A431FAF\r
+       for <notmuch@notmuchmail.org>; Thu,  9 Aug 2012 07:12:21 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id sfB3iB-1X07U for <notmuch@notmuchmail.org>;\r
+       Thu,  9 Aug 2012 07:12:20 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-4.mit.edu (DMZ-MAILSEC-SCANNER-4.MIT.EDU\r
+       [18.9.25.15])\r
+       by olra.theworths.org (Postfix) with ESMTP id BF5ED431FAE\r
+       for <notmuch@notmuchmail.org>; Thu,  9 Aug 2012 07:12:20 -0700 (PDT)\r
+X-AuditID: 1209190f-b7f306d0000008b4-e2-5023c544195d\r
+Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])\r
+       by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 1F.FE.02228.445C3205; Thu,  9 Aug 2012 10:12:20 -0400 (EDT)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q79ECFRT020589; \r
+       Thu, 9 Aug 2012 10:12:16 -0400\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+       (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q79ECBdU023712\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Thu, 9 Aug 2012 10:12:14 -0400 (EDT)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1SzTT9-0001an-6N; Thu, 09 Aug 2012 10:12:11 -0400\r
+Date: Thu, 9 Aug 2012 10:12:11 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Tomi Ollila <tomi.ollila@iki.fi>\r
+Subject: Re: [PATCH] emacs: Fix "not defined at runtime" warning\r
+Message-ID: <20120809141211.GG11179@mit.edu>\r
+References: <1344462010-5349-1-git-send-email-amdragon@mit.edu>\r
+       <m2628scxsf.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <m2628scxsf.fsf@guru.guru-group.fi>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFmphleLIzCtJLcpLzFFi42IRYrdT0XU5qhxg0LhFxOL6zZnMFm9WzmN1\r
+       YPI4/HUhi8ezVbeYA5iiuGxSUnMyy1KL9O0SuDKWnpvDXNDDX/H51ynGBsaf3F2MnBwSAiYS\r
+       q+csYYSwxSQu3FvP1sXIxSEksI9R4sjRf4wQznpGiSlzn0A5J5gkfsxdwgLhLGGU2DWrhQWk\r
+       n0VARWLT+9VsIDabgIbEtv3LweaKAMUftK1nBbGZBaQlvv1uZgKxhQUcJA5uXQ4W5xXQkdi8\r
+       fBYziC0kkCqxobMZKi4ocXLmExaIXi2JG/9eAvVygM1Z/o8DJMwpYCDROPEEWIko0KopJ7ex\r
+       TWAUmoWkexaS7lkI3QsYmVcxyqbkVunmJmbmFKcm6xYnJ+blpRbpmujlZpbopaaUbmIEBTan\r
+       JP8Oxm8HlQ4xCnAwKvHwXlqrFCDEmlhWXJl7iFGSg0lJlJdtv3KAEF9SfkplRmJxRnxRaU5q\r
+       8SFGCQ5mJRHeO31AOd6UxMqq1KJ8mJQ0B4uSOO/VlJv+QgLpiSWp2ampBalFMFkZDg4lCd51\r
+       R4AaBYtS01Mr0jJzShDSTBycIMN5gIZfAqnhLS5IzC3OTIfIn2JUlBLnPQ+SEABJZJTmwfXC\r
+       Es8rRnGgV4R594JU8QCTFlz3K6DBTECDD4sqgQwuSURISTUwltc/7EkvXdgnO+VbCENOx4Ev\r
+       B7d97IhUnThtR8XkPSWmkmZxl9XDm47MevfJYfm8O/HZR5cdWjdrdv+t6zeVSiw6F3D4HG7d\r
+       WNDJuta9+Nly05TH+7xsbqnpywo/+5sarz2VgfVF67TUTWUcatbxnaduM3Rfvea+KVREOO6a\r
+       c2mqlM+UJ3lNSizFGYmGWsxFxYkAhz4Z7hcDAAA=\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 09 Aug 2012 14:12:21 -0000\r
+\r
+Quoth Tomi Ollila on Aug 09 at 10:46 am:\r
+> On Thu, Aug 09 2012, Austin Clements <amdragon@MIT.EDU> wrote:\r
+> \r
+> > Previously, the Emacs byte compiler produced the warning\r
+> >\r
+> >     the function `remove-if-not' might not be defined at runtime.\r
+> >\r
+> > because we only required cl at compile-time (not runtime).  This fixes\r
+> > this warning by requiring cl at runtime, ensuring that the definition\r
+> > of remove-if-not is available.\r
+> > ---\r
+> \r
+> LGTM. \r
+> \r
+> It took me a while to understand this. Now I just don't understand\r
+> how did this work before. And why (require 'cl) is enough as \r
+> remove-if-not is defined in cl-seq.el -- cl-seq.el requires cl\r
+> but not vice-versa -- or at least I don't see that. Anyway\r
+> (require 'cl) is the common way.\r
+\r
+This worked before in practice because 'cl is inevitably loaded by\r
+some package, somewhere, but I'm sure it could be broken by a\r
+sufficiently stripped down Emacs environment.\r
+\r
+(require 'cl) is enough because cl.el contains\r
+  (load "cl-loaddefs" nil 'quiet)\r
+and cl-loaddefs.el defines an autoload for remove-if-not that in turn\r
+loads cl-seq the first time remove-if-not is called.\r
+\r
+In fact, we *can't* (require 'cl-seq) because cl-seq.el never (provide\r
+'cl-seq)s.  We could (load ...) it, but the fact that it never\r
+provides a package name strongly suggests that the division of cl into\r
+separate files is an implementation detail.\r
+\r
+> Tomi\r
+> \r
+> >  emacs/notmuch-lib.el |    2 +-\r
+> >  1 file changed, 1 insertion(+), 1 deletion(-)\r
+> >\r
+> > diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el\r
+> > index 30db58f..900235b 100644\r
+> > --- a/emacs/notmuch-lib.el\r
+> > +++ b/emacs/notmuch-lib.el\r
+> > @@ -24,7 +24,7 @@\r
+> >  (require 'mm-view)\r
+> >  (require 'mm-decode)\r
+> >  (require 'json)\r
+> > -(eval-when-compile (require 'cl))\r
+> > +(require 'cl)\r
+> >  \r
+> >  (defvar notmuch-command "notmuch"\r
+> >    "Command to run the notmuch binary.")\r