comparison 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
comparison
equal deleted inserted replaced
13081:eb159c99326b 13082:909b5a8414ee
1055 /* This is the actual command reading loop, 1055 /* This is the actual command reading loop,
1056 sans error-handling encapsulation. */ 1056 sans error-handling encapsulation. */
1057 1057
1058 Lisp_Object Fcommand_execute (); 1058 Lisp_Object Fcommand_execute ();
1059 static int read_key_sequence (); 1059 static int read_key_sequence ();
1060 static void safe_run_hooks (); 1060 void safe_run_hooks ();
1061 1061
1062 Lisp_Object 1062 Lisp_Object
1063 command_loop_1 () 1063 command_loop_1 ()
1064 { 1064 {
1065 Lisp_Object cmd, tem; 1065 Lisp_Object cmd, tem;
1456 1456
1457 /* If we get an error while running the hook, cause the hook variable 1457 /* If we get an error while running the hook, cause the hook variable
1458 to be nil. Also inhibit quits, so that C-g won't cause the hook 1458 to be nil. Also inhibit quits, so that C-g won't cause the hook
1459 to mysteriously evaporate. */ 1459 to mysteriously evaporate. */
1460 1460
1461 static void 1461 void
1462 safe_run_hooks (hook) 1462 safe_run_hooks (hook)
1463 Lisp_Object hook; 1463 Lisp_Object hook;
1464 { 1464 {
1465 Lisp_Object value; 1465 Lisp_Object value;
1466 int count = specpdl_ptr - specpdl; 1466 int count = specpdl_ptr - specpdl;
4789 realmaps[nmaps1++] = maps[mapno]; 4789 realmaps[nmaps1++] = maps[mapno];
4790 4790
4791 value = Fx_popup_menu (prev_event, Flist (nmaps1, realmaps)); 4791 value = Fx_popup_menu (prev_event, Flist (nmaps1, realmaps));
4792 if (CONSP (value)) 4792 if (CONSP (value))
4793 { 4793 {
4794 Lisp_Object tem;
4795
4796 /* If we got multiple events, unread all but
4797 the first.
4798 There is no way to prevent those unread events
4799 from showing up later in last_nonmenu_event.
4800 So turn symbol and integer events into lists,
4801 to indicate that they came from a mouse menu,
4802 so that when present in last_nonmenu_event
4803 they won't confuse things. */
4804 for (tem = XCONS (value)->cdr; !NILP (tem);
4805 tem = XCONS (tem)->cdr)
4806 if (SYMBOLP (XCONS (tem)->car)
4807 || INTEGERP (XCONS (tem)->car))
4808 XCONS (tem)->car
4809 = Fcons (XCONS (tem)->car, Qnil);
4810
4794 /* If we got more than one event, put all but the first 4811 /* If we got more than one event, put all but the first
4795 onto this list to be read later. 4812 onto this list to be read later.
4796 Return just the first event now. */ 4813 Return just the first event now. */
4797 Vunread_command_events 4814 Vunread_command_events
4798 = nconc2 (XCONS (value)->cdr, Vunread_command_events); 4815 = nconc2 (XCONS (value)->cdr, Vunread_command_events);