Mercurial > emacs
changeset 6974:ab22b527d380
(describe_map): Merge with describe_map_2.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Wed, 20 Apr 1994 03:04:46 +0000 |
parents | 7aa70fb3afa8 |
children | b7411e378b65 |
files | src/keymap.c |
diffstat | 1 files changed, 20 insertions(+), 33 deletions(-) [+] |
line wrap: on
line diff
--- a/src/keymap.c Wed Apr 20 01:11:35 1994 +0000 +++ b/src/keymap.c Wed Apr 20 03:04:46 1994 +0000 @@ -87,7 +87,6 @@ static Lisp_Object describe_buffer_bindings (); static void describe_command (); static void describe_map (); -static void describe_map_2 (); /* Keymap object support - constructors and predicates. */ @@ -1968,7 +1967,7 @@ sub_shadows = Fcons (shmap, sub_shadows); } - describe_map (Fcdr (elt), Fcar (elt), partial, sub_shadows); + describe_map (Fcdr (elt), Fcar (elt), describe_command, partial, sub_shadows); skip: ; } @@ -2005,31 +2004,6 @@ } } -/* Describe the contents of map MAP, assuming that this map itself is - reached by the sequence of prefix keys KEYS (a string or vector). - PARTIAL, SHADOW is as in `describe_map_tree' above. */ - -static void -describe_map (map, keys, partial, shadow) - Lisp_Object map, keys; - int partial; - Lisp_Object shadow; -{ - register Lisp_Object keysdesc; - - if (!NILP (keys) && XFASTINT (Flength (keys)) > 0) - { - Lisp_Object tem; - /* Call Fkey_description first, to avoid GC bug for the other string. */ - tem = Fkey_description (keys); - keysdesc = concat2 (tem, build_string (" ")); - } - else - keysdesc = Qnil; - - describe_map_2 (map, keysdesc, describe_command, partial, shadow); -} - /* 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. */ @@ -2048,16 +2022,19 @@ return Qnil; } -/* Insert a description of KEYMAP into the current buffer. */ +/* Describe the contents of map MAP, assuming that this map itself is + reached by the sequence of prefix keys KEYS (a string or vector). + PARTIAL, SHADOW is as in `describe_map_tree' above. */ static void -describe_map_2 (keymap, elt_prefix, elt_describer, partial, shadow) - register Lisp_Object keymap; - Lisp_Object elt_prefix; +describe_map (map, keys, elt_describer, partial, shadow) + register Lisp_Object map; + Lisp_Object keys; int (*elt_describer) (); int partial; Lisp_Object shadow; { + Lisp_Object elt_prefix; Lisp_Object tail, definition, event; Lisp_Object tem; Lisp_Object suppress; @@ -2065,6 +2042,16 @@ int first = 1; struct gcpro gcpro1, gcpro2, gcpro3; + if (!NILP (keys) && XFASTINT (Flength (keys)) > 0) + { + Lisp_Object tem; + /* Call Fkey_description first, to avoid GC bug for the other string. */ + tem = Fkey_description (keys); + elt_prefix = concat2 (tem, build_string (" ")); + } + else + elt_prefix = Qnil; + if (partial) suppress = intern ("suppress-keymap"); @@ -2076,7 +2063,7 @@ GCPRO3 (elt_prefix, definition, kludge); - for (tail = XCONS (keymap)->cdr; CONSP (tail); tail = Fcdr (tail)) + for (tail = XCONS (map)->cdr; CONSP (tail); tail = Fcdr (tail)) { QUIT; @@ -2107,7 +2094,7 @@ if (!NILP (tem)) continue; } - tem = Flookup_key (keymap, kludge, Qt); + tem = Flookup_key (map, kludge, Qt); if (! EQ (tem, definition)) continue; if (first)