From: Richard M. Stallman Date: Mon, 25 Sep 1995 18:44:59 +0000 (+0000) Subject: (safe_run_hooks): No longer static. X-Git-Tag: emacs-19.34~2778 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=68f297c5d3fffb0f70c72971b43d00e3092565f3;p=emacs.git (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. --- diff --git a/src/keyboard.c b/src/keyboard.c index 018b8201959..b4401f4fd62 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1057,7 +1057,7 @@ DEFUN ("abort-recursive-edit", Fabort_recursive_edit, Sabort_recursive_edit, 0, 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 @@ safe_run_hooks_error (data) 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 @@ read_char_x_menu_prompt (nmaps, maps, prev_event, used_mouse_menu) 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. */