From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [drew.adams@oracle.com: RE: weirddefadvicebugwithbyte-compilation] Date: Tue, 13 Dec 2005 06:30:54 +0200 Message-ID: References: Reply-To: Eli Zaretskii NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1134448323 27677 80.91.229.2 (13 Dec 2005 04:32:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 13 Dec 2005 04:32:03 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 13 05:31:54 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Em1ok-0005p1-0w for ged-emacs-devel@m.gmane.org; Tue, 13 Dec 2005 05:31:10 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Em1pF-0008SD-Uz for ged-emacs-devel@m.gmane.org; Mon, 12 Dec 2005 23:31:41 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Em1p2-0008S7-FB for emacs-devel@gnu.org; Mon, 12 Dec 2005 23:31:28 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Em1p0-0008Rv-VD for emacs-devel@gnu.org; Mon, 12 Dec 2005 23:31:28 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Em1p0-0008Rs-SN for emacs-devel@gnu.org; Mon, 12 Dec 2005 23:31:26 -0500 Original-Received: from [192.114.186.17] (helo=gandalf.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Em1qq-0004Z1-IF for emacs-devel@gnu.org; Mon, 12 Dec 2005 23:33:20 -0500 Original-Received: from nitzan.inter.net.il (nitzan.inter.net.il [192.114.186.20]) by gandalf.inter.net.il (MOS 3.7.1-GA) with ESMTP id HGB69372; Tue, 13 Dec 2005 06:30:48 +0200 (IST) Original-Received: from HOME-C4E4A596F7 (IGLD-84-228-161-127.inter.net.il [84.228.161.127]) by nitzan.inter.net.il (MOS 3.7.2-GA) with ESMTP id CFE06335 (AUTH halo1); Tue, 13 Dec 2005 06:30:47 +0200 (IST) Original-To: "Drew Adams" In-reply-to: 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:47607 Archived-At: > From: "Drew Adams" > Date: Mon, 12 Dec 2005 13:53:31 -0800 > > > This makes me wonder now if byte-compiling in defadvice (i.e. > > on the fly) > > should display a *Compile Log* buffer at all. I don't know. > > Why not? It's a byte compilation like any other one, and these > warnings do serve a purpose: your code, as posted, had a bug. > > Where is the bug? The byte-compiler warning presumably arose because it > compiled a defadvice that referred to variable my-mode. That variable is not > bound in the defadvice body and it might not be bound at the point in the > file when the defadvice is compiled. Is that a bug? Well, it might be. (I thought you actually said elsewhere in this thread that it was a bug, and that you deliberately kept it in the code to reproduce the crash.) The warning alerts you to look into this. > Should people systematically place defadvice last in a file or do > (provide 'x)(require 'x) just to make sure that all variables in a > defadvice body are defined before it is compiled? If you want the byte compiler help you find such typos, then yes, you should try to eliminate gratuitous warnings, to keep the noise level low enough for you to see the real warnings. > I also don't understand, as I mentioned, _why_ the defadvice in foo.el is > byte-compiled - it has no `compile' keyword. I thought this was how defadvice worked, but I might be wrong. In any case, the fact that the byte compiler is run is clear from the backtrace.