From 88416888aa98b7d77f0176a6156d5411b0ccd50b Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 20 Dec 2000 22:46:44 +0000 Subject: [PATCH] (where_is_internal): Check ascii_sequence_p rather than excluding menu-bar and tool-bar. (Fwhere_is_internal): Check ascii_sequence_p when looking up the cache. (menu_item_p): Remove. (where_is_internal_1): Don't ignore menu-items. --- src/ChangeLog | 8 ++++++++ src/keymap.c | 30 ++++++++---------------------- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index b9794a8566e..9fa435c8d9e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2000-12-20 Stefan Monnier + + * keymap.c (where_is_internal): Check ascii_sequence_p rather than + excluding menu-bar and tool-bar. + (Fwhere_is_internal): Check ascii_sequence_p when looking up the cache. + (menu_item_p): Remove. + (where_is_internal_1): Don't ignore menu-items. + 2000-12-20 Gerd Moellmann * xdisp.c (hscroll_window_tree): Take window's min_hscroll diff --git a/src/keymap.c b/src/keymap.c index 52b535e5d15..e015bf92f5d 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -2035,15 +2035,6 @@ ascii_sequence_p (seq) static Lisp_Object where_is_internal_1 (); static void where_is_internal_2 (); -static INLINE int -menu_item_p (item) - Lisp_Object item; -{ - return (CONSP (item) - && (EQ (XCAR (item),Qmenu_item) - || STRINGP (XCAR (item)))); -} - /* Like Flookup_key, but uses a list of keymaps SHADOW instead of a single map. Returns the first non-nil binding found in any of those maps. */ @@ -2105,14 +2096,12 @@ where_is_internal (definition, keymaps, firstonly, noindirect) last_is_meta = (XINT (last) >= 0 && EQ (Faref (this, last), meta_prefix_char)); - if (nomenus && XINT (last) >= 0) - { /* If no menu entries should be returned, skip over the - keymaps bound to `menu-bar' and `tool-bar'. */ - Lisp_Object tem = Faref (this, make_number (0)); - if (EQ (tem, Qmenu_bar) || EQ (tem, Qtool_bar)) - continue; - } - + if (nomenus && !ascii_sequence_p (this)) + /* If no menu entries should be returned, skip over the + keymaps bound to `menu-bar' and `tool-bar' and other + non-ascii prefixes. */ + continue; + QUIT; while (CONSP (map)) @@ -2296,7 +2285,8 @@ indirect definition itself.") for (sequences = Fnreverse (sequences); CONSP (sequences); sequences = XCDR (sequences)) - if (EQ (shadow_lookup (keymaps, XCAR (sequences), Qnil), definition)) + if (EQ (shadow_lookup (keymaps, XCAR (sequences), Qnil), definition) + && ascii_sequence_p (XCAR (sequences))) RETURN_UNGCPRO (XCAR (sequences)); RETURN_UNGCPRO (Qnil); } @@ -2358,10 +2348,6 @@ where_is_internal_1 (binding, key, definition, noindirect, this, last, { Lisp_Object sequence; - /* Skip left-over menu-items. - These can appear in a keymap bound to a mouse click, for example. */ - if (nomenus && menu_item_p (binding)) - return Qnil; /* Search through indirections unless that's not wanted. */ if (NILP (noindirect)) binding = get_keyelt (binding, 0); -- 2.39.2