Mercurial > emacs
diff src/keyboard.c @ 13082:909b5a8414ee
(safe_run_hooks): No longer static.
(read_char_x_menu_prompt):
When unreading events generated by a menu,
turn symbols and integers into lists,
for the sake of last_nonmenu_event and thus y-or-n-p.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 25 Sep 1995 18:44:59 +0000 |
parents | 077bb437f649 |
children | 04466bd88580 |
line wrap: on
line diff
--- a/src/keyboard.c Mon Sep 25 18:42:00 1995 +0000 +++ b/src/keyboard.c Mon Sep 25 18:44:59 1995 +0000 @@ -1057,7 +1057,7 @@ Lisp_Object Fcommand_execute (); static int read_key_sequence (); -static void safe_run_hooks (); +void safe_run_hooks (); Lisp_Object command_loop_1 () @@ -1458,7 +1458,7 @@ to be nil. Also inhibit quits, so that C-g won't cause the hook to mysteriously evaporate. */ -static void +void safe_run_hooks (hook) Lisp_Object hook; { @@ -4791,6 +4791,23 @@ value = Fx_popup_menu (prev_event, Flist (nmaps1, realmaps)); if (CONSP (value)) { + Lisp_Object tem; + + /* If we got multiple events, unread all but + the first. + There is no way to prevent those unread events + from showing up later in last_nonmenu_event. + So turn symbol and integer events into lists, + to indicate that they came from a mouse menu, + so that when present in last_nonmenu_event + they won't confuse things. */ + for (tem = XCONS (value)->cdr; !NILP (tem); + tem = XCONS (tem)->cdr) + if (SYMBOLP (XCONS (tem)->car) + || INTEGERP (XCONS (tem)->car)) + XCONS (tem)->car + = Fcons (XCONS (tem)->car, Qnil); + /* If we got more than one event, put all but the first onto this list to be read later. Return just the first event now. */