# HG changeset patch # User Stefan Monnier # Date 1047773219 0 # Node ID 3770fda038d0bcd15d251387792be4986391d3cd # Parent f94aa8667875576dfc2329d6aaf96391810c7e1a (Vmenu_events): New var. (syms_of_keymap): Initialize it. (where_is_internal): Check more carefully what is a menu event. diff -r f94aa8667875 -r 3770fda038d0 src/keymap.c --- a/src/keymap.c Fri Mar 14 23:11:20 2003 +0000 +++ b/src/keymap.c Sun Mar 16 00:06:59 2003 +0000 @@ -2240,6 +2240,8 @@ return Qnil; } +static Lisp_Object Vmenu_events; + /* This function can GC if Flookup_key autoloads any keymaps. */ static Lisp_Object @@ -2278,7 +2280,7 @@ 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 @@ /* 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 @@ Lisp_Object regexp, predicate; { Lisp_Object tem; - struct gcpro gcpro1, gcpro2; CHECK_STRING (regexp); apropos_predicate = predicate; apropos_accumulate = Qnil; @@ -3627,6 +3629,15 @@ 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);