From d378869e0452cfd525b9a6dd4568002236492ca2 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 16 Mar 2003 00:06:59 +0000 Subject: [PATCH] (Vmenu_events): New var. (syms_of_keymap): Initialize it. (where_is_internal): Check more carefully what is a menu event. --- src/keymap.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/keymap.c b/src/keymap.c index 7362bc81457..4215ec5bd77 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -2240,6 +2240,8 @@ shadow_lookup (shadow, key, flag) return Qnil; } +static Lisp_Object Vmenu_events; + /* This function can GC if Flookup_key autoloads any keymaps. */ static Lisp_Object @@ -2278,7 +2280,7 @@ where_is_internal (definition, keymaps, firstonly, noindirect, no_remap) for (; !NILP (maps); maps = Fcdr (maps)) { /* Key sequence to reach map, and the map that it reaches */ - register Lisp_Object this, map; + register Lisp_Object this, map, tem; /* In order to fold [META-PREFIX-CHAR CHAR] sequences into [M-CHAR] sequences, check if last character of the sequence @@ -2294,7 +2296,8 @@ where_is_internal (definition, keymaps, firstonly, noindirect, no_remap) /* if (nomenus && !ascii_sequence_p (this)) */ if (nomenus && XINT (last) >= 0 - && !INTEGERP (Faref (this, make_number (0)))) + && SYMBOLP (tem = Faref (this, make_number (0))) + && !NILP (Fmemq (XCAR (parse_modifiers (tem)), Vmenu_events))) /* If no menu entries should be returned, skip over the keymaps bound to `menu-bar' and `tool-bar' and other non-ascii prefixes like `C-down-mouse-2'. */ @@ -3496,7 +3499,6 @@ Return list of symbols found. */) Lisp_Object regexp, predicate; { Lisp_Object tem; - struct gcpro gcpro1, gcpro2; CHECK_STRING (regexp); apropos_predicate = predicate; apropos_accumulate = Qnil; @@ -3627,6 +3629,15 @@ This keymap works like `function-key-map', but comes after that, and applies even for keys that have ordinary bindings. */); Vkey_translation_map = Qnil; + staticpro (&Vmenu_events); + Vmenu_events = Fcons (intern ("menu-bar"), + Fcons (intern ("tool-bar"), + Fcons (intern ("mouse-1"), + Fcons (intern ("mouse-2"), + Fcons (intern ("mouse-3"), + Qnil))))); + + Qsingle_key_description = intern ("single-key-description"); staticpro (&Qsingle_key_description); -- 2.11.4.GIT