summaryrefslogtreecommitdiff
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-09-25 18:44:59 +0000
committerRichard M. Stallman <rms@gnu.org>1995-09-25 18:44:59 +0000
commit4d93338d18a33293095e5bed99825a7a5ba72a68 (patch)
tree9f9e9fde9a64602f90ae46389b85a41f42b39591 /src/keyboard.c
parentb3ce15db9b90efa3c8cfd956c6c2593acf9bf297 (diff)
downloademacs-4d93338d18a33293095e5bed99825a7a5ba72a68.tar.gz
(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.
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c21
1 files changed, 19 insertions, 2 deletions
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. */