aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1995-05-02 04:41:26 +0000
committerKarl Heuer1995-05-02 04:41:26 +0000
commit83d6804403451c75c6757521c4291ebfa0048ba1 (patch)
tree0981165edf3fdc9ddce5fbe5c1a2e883fd5a1194 /src
parent5257b534c595586b43c8aa2ae09574b1527fbecf (diff)
downloademacs-83d6804403451c75c6757521c4291ebfa0048ba1.tar.gz
emacs-83d6804403451c75c6757521c4291ebfa0048ba1.zip
(kbd_buffer_get_event): New arg USED_MOUSE_MENU.
[USE_X_TOOLKIT]: Set *USED_MOUSE_MENU if returning menu-bar symbols. (read_char): Pass used_mouse_menu to kbd_buffer_get_event. This variable is now meaningful for toolkit menus as well as non-toolkit menus.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index d960e1b6ee8..75d334ee2b1 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1612,9 +1612,9 @@ static jmp_buf wrong_kboard_jmpbuf;
1612 PREV_EVENT is the previous input event, or nil if we are reading 1612 PREV_EVENT is the previous input event, or nil if we are reading
1613 the first event of a key sequence. 1613 the first event of a key sequence.
1614 1614
1615 If USED_MOUSE_MENU is non-zero, then we set *USED_MOUSE_MENU to 1 1615 If USED_MOUSE_MENU is non-null, then we set *USED_MOUSE_MENU to 1
1616 if we used a mouse menu to read the input, or zero otherwise. If 1616 if we used a mouse menu to read the input, or zero otherwise. If
1617 USED_MOUSE_MENU is zero, *USED_MOUSE_MENU is left alone. 1617 USED_MOUSE_MENU is null, we don't dereference it.
1618 1618
1619 Value is t if we showed a menu and the user rejected it. */ 1619 Value is t if we showed a menu and the user rejected it. */
1620 1620
@@ -1935,7 +1935,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
1935 /* Actually read a character, waiting if necessary. */ 1935 /* Actually read a character, waiting if necessary. */
1936 save_getcjmp (save_jump); 1936 save_getcjmp (save_jump);
1937 restore_getcjmp (local_getcjmp); 1937 restore_getcjmp (local_getcjmp);
1938 c = kbd_buffer_get_event (&kb); 1938 c = kbd_buffer_get_event (&kb, used_mouse_menu);
1939 restore_getcjmp (save_jump); 1939 restore_getcjmp (save_jump);
1940 1940
1941#ifdef MULTI_KBOARD 1941#ifdef MULTI_KBOARD
@@ -2397,8 +2397,9 @@ kbd_buffer_store_event (event)
2397 We always read and discard one event. */ 2397 We always read and discard one event. */
2398 2398
2399static Lisp_Object 2399static Lisp_Object
2400kbd_buffer_get_event (kbp) 2400kbd_buffer_get_event (kbp, used_mouse_menu)
2401 KBOARD **kbp; 2401 KBOARD **kbp;
2402 int *used_mouse_menu;
2402{ 2403{
2403 register int c; 2404 register int c;
2404 Lisp_Object obj; 2405 Lisp_Object obj;
@@ -2578,6 +2579,17 @@ kbd_buffer_get_event (kbp)
2578 if (NILP (obj)) 2579 if (NILP (obj))
2579 { 2580 {
2580 obj = make_lispy_event (event); 2581 obj = make_lispy_event (event);
2582#ifdef USE_X_TOOLKIT
2583 /* If this was a menu selection, then set the flag to inhibit
2584 writing to last_nonmenu_event. Don't do this if the event
2585 we're returning is (menu-bar), though; that indicates the
2586 beginning of the menu sequence, and we might as well leave
2587 that as the `event with parameters' for this selection. */
2588 if (event->kind == menu_bar_event
2589 && !(CONSP (obj) && EQ (XCONS (obj)->car, Qmenu_bar))
2590 && used_mouse_menu)
2591 *used_mouse_menu = 1;
2592#endif
2581 2593
2582 /* Wipe out this event, to catch bugs. */ 2594 /* Wipe out this event, to catch bugs. */
2583 event->kind = no_event; 2595 event->kind = no_event;
@@ -4570,9 +4582,9 @@ menu_bar_item (key, item_string, def)
4570 PREV_EVENT is the previous input event, or nil if we are reading 4582 PREV_EVENT is the previous input event, or nil if we are reading
4571 the first event of a key sequence. 4583 the first event of a key sequence.
4572 4584
4573 If USED_MOUSE_MENU is non-zero, then we set *USED_MOUSE_MENU to 1 4585 If USED_MOUSE_MENU is non-null, then we set *USED_MOUSE_MENU to 1
4574 if we used a mouse menu to read the input, or zero otherwise. If 4586 if we used a mouse menu to read the input, or zero otherwise. If
4575 USED_MOUSE_MENU is zero, *USED_MOUSE_MENU is left alone. 4587 USED_MOUSE_MENU is null, we don't dereference it.
4576 4588
4577 The prompting is done based on the prompt-string of the map 4589 The prompting is done based on the prompt-string of the map
4578 and the strings associated with various map elements. 4590 and the strings associated with various map elements.