[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: address@hidden: RE: weird defadvicebugwithbyte-compilation]

From: Eli Zaretskii
Subject: Re: address@hidden: RE: weird defadvicebugwithbyte-compilation]
Date: Mon, 12 Dec 2005 23:22:15 +0200

> From: "Drew Adams" <address@hidden>
> 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).


> 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?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]