From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: [drew.adams@oracle.com: RE: weird defadvice bugwithbyte-compilation] Date: Sun, 11 Dec 2005 22:11:45 -0800 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1134367984 5918 80.91.229.2 (12 Dec 2005 06:13:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 12 Dec 2005 06:13:04 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 12 07:13:03 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ElgvJ-0003v0-VD for ged-emacs-devel@m.gmane.org; Mon, 12 Dec 2005 07:12:34 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Elgvn-00061U-B4 for ged-emacs-devel@m.gmane.org; Mon, 12 Dec 2005 01:13:03 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ElgvF-0005nY-20 for emacs-devel@gnu.org; Mon, 12 Dec 2005 01:12:29 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ElgvD-0005kQ-EF for emacs-devel@gnu.org; Mon, 12 Dec 2005 01:12:28 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ElgvC-0005jR-SF for emacs-devel@gnu.org; Mon, 12 Dec 2005 01:12:27 -0500 Original-Received: from [148.87.122.30] (helo=rgminet01.oracle.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1Elgws-0005oy-BX for emacs-devel@gnu.org; Mon, 12 Dec 2005 01:14:10 -0500 Original-Received: from rgmsgw301.us.oracle.com (rgmsgw301.us.oracle.com [138.1.186.50]) by rgminet01.oracle.com (Switch-3.1.6/Switch-3.1.6) with ESMTP id jBC6BrvS003422 for ; Sun, 11 Dec 2005 23:11:53 -0700 Original-Received: from rgmsgw301.us.oracle.com (localhost [127.0.0.1]) by rgmsgw301.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id jBC6BrUW002981 for ; Sun, 11 Dec 2005 23:11:53 -0700 Original-Received: from dradamslap (dhcp-amer-csvpn-gw2-141-144-73-217.vpn.oracle.com [141.144.73.217]) by rgmsgw301.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with SMTP id jBC6Bpjx002969 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Sun, 11 Dec 2005 23:11:53 -0700 Original-To: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) Importance: Normal In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE 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:47526 Archived-At: > 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. OK. I was confused because it was the byte-compilation that led ultimately to x-create-frame raising an unbound var error. > 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. But it is only the defadvice in bar.el, not the defadvice in foo.el, that has the keyword `compile'. And even if it does byte-compile foo.el on the fly (for whatever reason), why would it eval my-mode - the body of a defadvice is not supposed to need to be quoted (it is not evaled by defadvice). That is, I don't understand why a byte-compiler warning of a potentially unbound variable would lead to a *Backtrace* being created - a warning is not an error, and even byte-compiler errors (as opposed to warnings) do not result in a *Backtrace*. > 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. Ah - thanks. That makes sense, given your explanation of the bug being manifested in x-create-frame. I don't understand, however, your statement that when the byte compiler tries to display special-buffer *Compile Log* in a separate frame "it hits the problem with the void variable again". What is the "problem with the void variable"? For the byte-compiler it was only a question of displaying a warning, there was no error to be raised. Why would display of *Compile Log* in a separate frame raise an unbound-variable error?