emacs-devel
[Top][All Lists]
Advanced

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

Re: undo in loaddefs.el buffer


From: Jan D.
Subject: Re: undo in loaddefs.el buffer
Date: Sun, 26 Dec 2004 17:15:52 +0100
User-agent: Mozilla Thunderbird 1.0 (X11/20041206)

Luc Teirlinck wrote:

Do `emacs -q', M-x ielm then:

(let (last-nonmenu-event) (yes-or-no-p "prompt"))

Now if you press any key, regular or modifier, say "a", Control,
Shift, nil is returned, like if you answered "No".  This appears to be
an obvious bug.  For the particular application we are worried about,
this is particularly bad, because "No" is the dangerous answer, the
one that might make Emacs crash.

The behaviour to pop down on key press is present in CVS and 21.3. But this should only happen if the focus is on the frame and not the dialog. It also only happens for Lucid and Lesstif/Motif dialogs. The reason for this being in CVS is because it is in 21.3 :-). Personally I think it is a strange behaviour.

However, I obviously did a typo when making the "pop down on ESC" (see below), so the Lucid pops down on any keypress when focus is on the dialog. This is now fixed.

If we repeat the experiment in 21.3, we see that the bug is not
present there.  However, there is another bug.  If we click the mouse
anywhere inside the Emacs frame, but outside the "Yes" button, nil is
returned.  This is also a bug, which does _not_ occur in current CVS.
This seems to be a case of introducing one bug by fixing another


This way of popping down the dialog has been replaced by popping down by pressing ESC, which is more in line with what other applications and toolkits use. But the non-toolkit build uses menus instead of dialogs, so the behaviour is different. For popup menus, clicking outside means "cancel" so in that case it is popped down. The ESC thing was not implemented for the non-toolkit build, I guess I thought it wasn't that many people that used it and thus not worth it.

So in CVS, dialogs does not pop down because of a click outside the dialog. The non-toolkit build is not a dialog but a menu, so it does pop down.

ESC shall pop down dialogs, except for the non-toolkit build (not implemented, but easy to add).

Any key pressed when the focus is on the Emacs frame and not the dialog pops down the Lucid and Lesstif/Motif dialog, to be compatible with 21.3. GTK and non-toolkit does not pop down on keypress outside the dialog/menu.

   Jan D.





reply via email to

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