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: weird defadvice bug withbyte-compilation] Date: Mon, 12 Dec 2005 07:52:42 +0200 Message-ID: References: Reply-To: Eli Zaretskii NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1134366852 3751 80.91.229.2 (12 Dec 2005 05:54:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 12 Dec 2005 05:54:12 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 12 06:54:04 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ElgcN-0006nU-9d for ged-emacs-devel@m.gmane.org; Mon, 12 Dec 2005 06:52:59 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Elgcq-0006nc-4p for ged-emacs-devel@m.gmane.org; Mon, 12 Dec 2005 00:53:28 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ElgcZ-0006ks-QD for emacs-devel@gnu.org; Mon, 12 Dec 2005 00:53:13 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ElgcX-0006il-KU for emacs-devel@gnu.org; Mon, 12 Dec 2005 00:53:11 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ElgcX-0006iW-H8 for emacs-devel@gnu.org; Mon, 12 Dec 2005 00:53:09 -0500 Original-Received: from [192.114.186.66] (helo=romy.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.34) id 1ElgeD-0002Df-1L for emacs-devel@gnu.org; Mon, 12 Dec 2005 00:54:53 -0500 Original-Received: from HOME-C4E4A596F7 (IGLD-83-130-201-161.inter.net.il [83.130.201.161]) by romy.inter.net.il (MOS 3.7.2-GA) with ESMTP id DDR93300 (AUTH halo1); Mon, 12 Dec 2005 07:52:36 +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:47521 Archived-At: > From: "Drew Adams" > Date: Sun, 11 Dec 2005 13:35:46 -0800 > > Does this make sense? > > It does, as far as I can tell. I don't understand all of it, however, I > admit. I still don't understand, for instance: > > 1. why byte-compiling the defadvice in bar.el would eval my-mode (my-mode > does not even appear in bar.el) I think it doesn't eval it, it just sees that my-mode is not bound. The warning says "reference to free variable `my-mode'", see the backtrace. This is a standard warning from the byte compiler, it is meant to help you detect typos in variable names. > 2. why evaling the defadvice in foo.el would eval my-mode (the BODY of > defadvice is not supposed to be quoted) Because defadvice byte-compiles the function it creates on the fly, I guess. > 5. why selecting (require 'foo) and doing eval-region does not manifest the > bug, but putting the cursor after (require 'foo) and doing `C-x C-e' does > manifest the bug. Because, by default, eval-expression-debug-on-error is t, and it affects C-x C-e. If I set eval-expression-debug-on-error to nil, Emacs behaves with C-x C-e like it does with eval-region: it doesn't pop up the *Backtrace* buffer in a separate frame, and the bug doesn't happen.