From: Martin Rudalics Date: Mon, 12 Jan 2009 09:21:15 +0000 (+0000) Subject: (read_char): Fix case where last_nonmenu_event X-Git-Tag: emacs-pretest-23.0.90~496 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a41240a3ab0bd501fe97761fc019b5f689cbc348;p=emacs.git (read_char): Fix case where last_nonmenu_event returned a bad value with submenus. (Bug#447) --- diff --git a/src/ChangeLog b/src/ChangeLog index 1de7e5984c8..6bb7107a206 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-01-12 Martin Rudalics + + * keyboard.c (read_char): Fix case where last_nonmenu_event + returned a bad value with submenus. (Bug#447) + 2009-01-12 Chong Yidong * xfaces.c (Finternal_set_lisp_face_attribute): If setting the diff --git a/src/keyboard.c b/src/keyboard.c index 00c8a2af67a..a6be5b152db 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2547,6 +2547,8 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) if (CONSP (Vunread_command_events)) { + int was_disabled = 0; + c = XCAR (Vunread_command_events); Vunread_command_events = XCDR (Vunread_command_events); @@ -2567,12 +2569,17 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) if (CONSP (c) && EQ (XCDR (c), Qdisabled) && (SYMBOLP (XCAR (c)) || INTEGERP (XCAR (c)))) - c = XCAR (c); + { + was_disabled = 1; + c = XCAR (c); + } /* If the queued event is something that used the mouse, set used_mouse_menu accordingly. */ if (used_mouse_menu - && (EQ (c, Qtool_bar) || EQ (c, Qmenu_bar))) + /* Also check was_disabled so last-nonmenu-event won't return + a bad value when submenus are involved. (Bug#447) */ + && (EQ (c, Qtool_bar) || EQ (c, Qmenu_bar) || was_disabled)) *used_mouse_menu = 1; goto reread_for_input_method;