Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 63F0A431FAF for ; Thu, 9 Aug 2012 07:12:21 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sfB3iB-1X07U for ; Thu, 9 Aug 2012 07:12:20 -0700 (PDT) Received: from dmz-mailsec-scanner-4.mit.edu (DMZ-MAILSEC-SCANNER-4.MIT.EDU [18.9.25.15]) by olra.theworths.org (Postfix) with ESMTP id BF5ED431FAE for ; Thu, 9 Aug 2012 07:12:20 -0700 (PDT) X-AuditID: 1209190f-b7f306d0000008b4-e2-5023c544195d Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP id 1F.FE.02228.445C3205; Thu, 9 Aug 2012 10:12:20 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q79ECFRT020589; Thu, 9 Aug 2012 10:12:16 -0400 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q79ECBdU023712 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Thu, 9 Aug 2012 10:12:14 -0400 (EDT) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) (envelope-from ) id 1SzTT9-0001an-6N; Thu, 09 Aug 2012 10:12:11 -0400 Date: Thu, 9 Aug 2012 10:12:11 -0400 From: Austin Clements To: Tomi Ollila Subject: Re: [PATCH] emacs: Fix "not defined at runtime" warning Message-ID: <20120809141211.GG11179@mit.edu> References: <1344462010-5349-1-git-send-email-amdragon@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmphleLIzCtJLcpLzFFi42IRYrdT0XU5qhxg0LhFxOL6zZnMFm9WzmN1 YPI4/HUhi8ezVbeYA5iiuGxSUnMyy1KL9O0SuDKWnpvDXNDDX/H51ynGBsaf3F2MnBwSAiYS q+csYYSwxSQu3FvP1sXIxSEksI9R4sjRf4wQznpGiSlzn0A5J5gkfsxdwgLhLGGU2DWrhQWk n0VARWLT+9VsIDabgIbEtv3LweaKAMUftK1nBbGZBaQlvv1uZgKxhQUcJA5uXQ4W5xXQkdi8 fBYziC0kkCqxobMZKi4ocXLmExaIXi2JG/9eAvVygM1Z/o8DJMwpYCDROPEEWIko0KopJ7ex TWAUmoWkexaS7lkI3QsYmVcxyqbkVunmJmbmFKcm6xYnJ+blpRbpmujlZpbopaaUbmIEBTan JP8Oxm8HlQ4xCnAwKvHwXlqrFCDEmlhWXJl7iFGSg0lJlJdtv3KAEF9SfkplRmJxRnxRaU5q 8SFGCQ5mJRHeO31AOd6UxMqq1KJ8mJQ0B4uSOO/VlJv+QgLpiSWp2ampBalFMFkZDg4lCd51 R4AaBYtS01Mr0jJzShDSTBycIMN5gIZfAqnhLS5IzC3OTIfIn2JUlBLnPQ+SEABJZJTmwfXC Es8rRnGgV4R594JU8QCTFlz3K6DBTECDD4sqgQwuSURISTUwltc/7EkvXdgnO+VbCENOx4Ev B7d97IhUnThtR8XkPSWmkmZxl9XDm47MevfJYfm8O/HZR5cdWjdrdv+t6zeVSiw6F3D4HG7d WNDJuta9+Nly05TH+7xsbqnpywo/+5sarz2VgfVF67TUTWUcatbxnaduM3Rfvea+KVREOO6a c2mqlM+UJ3lNSizFGYmGWsxFxYkAhz4Z7hcDAAA= Cc: notmuch@notmuchmail.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2012 14:12:21 -0000 Quoth Tomi Ollila on Aug 09 at 10:46 am: > On Thu, Aug 09 2012, Austin Clements 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.")