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 defadvicebugwithbyte-compilation] Date: Mon, 12 Dec 2005 23:22:15 +0200 Message-ID: References: Reply-To: Eli Zaretskii NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1134427465 6358 80.91.229.2 (12 Dec 2005 22:44:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 12 Dec 2005 22:44:25 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 12 23:44:23 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ElwOU-0003rg-DO for ged-emacs-devel@m.gmane.org; Mon, 12 Dec 2005 23:43:42 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ElwMe-0003TS-G9 for ged-emacs-devel@m.gmane.org; Mon, 12 Dec 2005 17:41:48 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Elv8q-0000ho-0i for emacs-devel@gnu.org; Mon, 12 Dec 2005 16:23:28 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Elv8p-0000hR-4j for emacs-devel@gnu.org; Mon, 12 Dec 2005 16:23:27 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Elv8p-0000hM-1Z for emacs-devel@gnu.org; Mon, 12 Dec 2005 16:23:27 -0500 Original-Received: from [192.114.186.17] (helo=gandalf.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.34) id 1ElvAb-0003gw-1W for emacs-devel@gnu.org; Mon, 12 Dec 2005 16:25:17 -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 HGA37333; Mon, 12 Dec 2005 23:22:09 +0200 (IST) Original-Received: from HOME-C4E4A596F7 (IGLD-80-230-21-248.inter.net.il [80.230.21.248]) by nitzan.inter.net.il (MOS 3.7.2-GA) with ESMTP id CFD04316 (AUTH halo1); Mon, 12 Dec 2005 23:22:08 +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:47568 Archived-At: > From: "Drew Adams" > Date: Sun, 11 Dec 2005 22:44:15 -0800 > > Nevermind; I understand now what happened (wrt the unbound var, not the > crash bug). I was confused about who was raising the unbound var error, but > I see now that x-create-frame was doing so because the menu-enable property > evaled it for a menu-bar menu when x-create-frame tried to create the > *Compile Log* frame (which has a menu-bar). Exactly. > 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. > In any case, that's clearly the cause of the problem here (but not > the explanation of the crash bug). The explanation of the crash is that, because the *Backtrace* buffer is displayed in its own separate frame, and that separate frame is created in the middle of the process of creating the *Compile-Log*'s frame's menu, Emacs somehow fails to record the *Backtrace* frame in the list of live frames. And then, when Emacs is killed, the function check_glyph_memory, which walks the frame list and releases all the glyph matrices it finds in each frame, misses that one frame which is not recorded in the list of frames. Can someone please try reproducing this in a non-toolkit X build? I think that build might have the same problem as the MS-Windows build. > I still have a question, however, about how best to use define-minor-mode to > define the mode variable so that it can be used in a put 'menu-enable. Is it > necessary to do the define-minor-mode before doing the put? I guess so; but > in that case, I prefer the old method of defining a minor-mode function and > its variable (defcustom) separately. The problem is the same, but I always > place variable definitions at the top, and such a defcustom would be defined > before the variable was used in the put 'menu-enable. In the new system, I > was calling the minor-mode function first thing (in .emacs), to set the > variable, but that function couldn't be called until its defining library > was loaded, and that meant that the variable wasn't defined when the > *Compile Log* was displayed when byte-compiling a defadvice in the file. Sorry, I'm not an expert on minor modes. Anyone?