From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ralf Angeli Newsgroups: gmane.emacs.devel Subject: Re: declare-function from included file Date: Wed, 19 Mar 2008 19:57:07 +0100 Message-ID: <874pb2zgn0.fsf@photon.caeruleus.net> References: <75y78fk08w.fsf@fencepost.gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1205953060 22569 80.91.229.12 (19 Mar 2008 18:57:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 19 Mar 2008 18:57:40 +0000 (UTC) Cc: emacs-devel@gnu.org To: Glenn Morris Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 19 19:58:10 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Jc3UG-0001kf-MD for ged-emacs-devel@m.gmane.org; Wed, 19 Mar 2008 19:58:09 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jc3Tg-0000bv-Ko for ged-emacs-devel@m.gmane.org; Wed, 19 Mar 2008 14:57:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jc3Tc-0000Yy-GS for emacs-devel@gnu.org; Wed, 19 Mar 2008 14:57:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jc3Tb-0000XE-Jc for emacs-devel@gnu.org; Wed, 19 Mar 2008 14:57:28 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jc3Tb-0000X3-Gv for emacs-devel@gnu.org; Wed, 19 Mar 2008 14:57:27 -0400 Original-Received: from moutng.kundenserver.de ([212.227.126.171]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jc3TX-0008T1-KE; Wed, 19 Mar 2008 14:57:23 -0400 Original-Received: from photon.caeruleus.net (p54A53F50.dip0.t-ipconnect.de [84.165.63.80]) by mrelayeu.kundenserver.de (node=mrelayeu8) with ESMTP (Nemesis) id 0ML31I-1Jc3TI2KUQ-0003rT; Wed, 19 Mar 2008 19:57:11 +0100 In-Reply-To: <75y78fk08w.fsf@fencepost.gnu.org> (Glenn Morris's message of "Tue, 18 Mar 2008 20:47:59 -0400") X-Provags-ID: V01U2FsdGVkX1/sNNjCH5nGGo9ANBAslTTA/Y99H55N5/qE+mP tP4RMkAS9hNZACJPgpQrA6Fkgc75syJiP/2bNgkvPnDdunQC0e pKdZWnfdg4pFeoM5OtwMA== X-detected-kernel: by monty-python.gnu.org: Linux 2.6? (barebone, rare!) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:92996 Archived-At: * Glenn Morris (2008-03-19) writes: > Ralf Angeli wrote: > >> is it possible to put calls to `declare-function' in a file to be >> included during byte compilation? The following does not seem not work: > > No, because by design declare-function only has an effect when being > _compiled_, and you're not compiling the code in the included file. > (At least, I think that explains it.) Hm, this is what I suspected as well. >> I can silence the byte compiler by using (fset 'bar (lambda (&rest >>args) nil)) in include.el instead of the `declare-function' call. >> Would this be a better alternative? > > That looks ugly to me, and could break loading of the non-compiled > code. Why is that? Would the body of `eval-when-compile' be executed in this case? That's the only thing I can imagine causing trouble. > Why not just put your declare-function statements in the right > file? Though I guess the whole point of this is that you don't want > to. Yes, it clutters the file contents. And the package -- we are talking about RefTeX here -- is supposed to work with Emacs 21 and XEmacs as well. This means one would have to define `declare-function' in every file it is used in case Emacs or XEmacs does not provide it. This is how it's done in Gnus at the moment and it looks quite clunky. If the `declare-function' statements where in a separate file, one could define `declare-function' only once. > Or live with the warnings. Personally I'm not bothered too much by them but since we are talking about code which is part of Emacs this is likely not an option. -- Ralf