X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/f315b69922db769f3358e15616aa76c965be8a89..f95211e9a40b1c7d1beff0e15aa67450f80bd8bb:/src/keymap.c diff --git a/src/keymap.c b/src/keymap.c index c7c7d196c2..b69b409fc2 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -1,5 +1,5 @@ /* Manipulation of keymaps - Copyright (C) 1985-1988, 1993-1995, 1998-2014 Free Software + Copyright (C) 1985-1988, 1993-1995, 1998-2015 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -76,12 +76,6 @@ Lisp_Object control_x_map; /* The keymap used for globally bound bindings when spaces are not encouraged in the minibuf. */ -/* Keymap used for minibuffers when doing completion. */ -/* Keymap used for minibuffers when doing completion and require a match. */ -static Lisp_Object Qkeymapp, Qnon_ascii; -Lisp_Object Qkeymap, Qmenu_item, Qremap; -static Lisp_Object QCadvertised_binding; - /* Alist of elements like (DEL . "\d"). */ static Lisp_Object exclude_keys; @@ -504,7 +498,7 @@ access_keymap_1 (Lisp_Object map, Lisp_Object idx, if (INTEGERP (idx) && (XFASTINT (idx) & CHAR_MODIFIER_MASK) == 0) { val = Faref (binding, idx); - /* `nil' has a special meaning for char-tables, so + /* nil has a special meaning for char-tables, so we use something else to record an explicitly unbound entry. */ if (NILP (val)) @@ -654,8 +648,6 @@ map_keymap (Lisp_Object map, map_keymap_function_t fun, Lisp_Object args, UNGCPRO; } -static Lisp_Object Qkeymap_canonicalize; - /* Same as map_keymap, but does it right, properly eliminating duplicate bindings due to inheritance. */ void @@ -857,7 +849,7 @@ store_in_keymap (Lisp_Object keymap, register Lisp_Object idx, Lisp_Object def) if (NATNUMP (idx) && !(XFASTINT (idx) & CHAR_MODIFIER_MASK)) { Faset (elt, idx, - /* `nil' has a special meaning for char-tables, so + /* nil has a special meaning for char-tables, so we use something else to record an explicitly unbound entry. */ NILP (def) ? Qt : def); @@ -1300,7 +1292,7 @@ static Lisp_Object append_key (Lisp_Object key_sequence, Lisp_Object key) { AUTO_LIST1 (key_list, key); - return Fvconcat (2, ((Lisp_Object []) { key_sequence, key_list })); + return CALLN (Fvconcat, key_sequence, key_list); } /* Given a event type C which is a symbol, @@ -1660,10 +1652,14 @@ specified buffer position instead of point are used. if (NILP (position) && VECTORP (key)) { - Lisp_Object event - /* mouse events may have a symbolic prefix indicating the - scrollbar or mode line */ - = AREF (key, SYMBOLP (AREF (key, 0)) && ASIZE (key) > 1 ? 1 : 0); + Lisp_Object event; + + if (ASIZE (key) == 0) + return Qnil; + + /* mouse events may have a symbolic prefix indicating the + scrollbar or mode line */ + event = AREF (key, SYMBOLP (AREF (key, 0)) && ASIZE (key) > 1 ? 1 : 0); /* We are not interested in locations without event data */ @@ -1998,7 +1994,6 @@ then the value includes only maps for prefixes that start with PREFIX. */) } return maps; } -static Lisp_Object Qsingle_key_description, Qkey_description; /* This function cannot GC. */ @@ -2444,8 +2439,7 @@ where_is_internal (Lisp_Object definition, Lisp_Object keymaps, if (NILP (where_is_cache)) { /* We need to create the cache. */ - Lisp_Object args[2]; - where_is_cache = Fmake_hash_table (0, args); + where_is_cache = Fmake_hash_table (0, NULL); where_is_cache_keymaps = Qt; } else @@ -3734,20 +3728,23 @@ be preferred. */); Vwhere_is_preferred_modifier = Qnil; where_is_preferred_modifier = 0; + DEFSYM (Qmenu_bar, "menu-bar"); + DEFSYM (Qmode_line, "mode-line"); + staticpro (&Vmouse_events); Vmouse_events = listn (CONSTYPE_PURE, 9, - intern_c_string ("menu-bar"), - intern_c_string ("tool-bar"), - intern_c_string ("header-line"), - intern_c_string ("mode-line"), + Qmenu_bar, + Qtool_bar, + Qheader_line, + Qmode_line, intern_c_string ("mouse-1"), intern_c_string ("mouse-2"), intern_c_string ("mouse-3"), intern_c_string ("mouse-4"), intern_c_string ("mouse-5")); - DEFSYM (Qsingle_key_description, "single-key-description"); - DEFSYM (Qkey_description, "key-description"); + /* Keymap used for minibuffers when doing completion. */ + /* Keymap used for minibuffers when doing completion and require a match. */ DEFSYM (Qkeymapp, "keymapp"); DEFSYM (Qnon_ascii, "non-ascii"); DEFSYM (Qmenu_item, "menu-item");