diff options
| author | Karl Heuer | 1994-04-20 03:04:46 +0000 |
|---|---|---|
| committer | Karl Heuer | 1994-04-20 03:04:46 +0000 |
| commit | c3c0ee937dab6fcde866b13bf8a56d0c5244d169 (patch) | |
| tree | 656a92d1008d72d7f07d07092ce5c1762d1d2584 | |
| parent | 24ff54989b2f9a739ad3381afbd9a085b9adca98 (diff) | |
| download | emacs-c3c0ee937dab6fcde866b13bf8a56d0c5244d169.tar.gz emacs-c3c0ee937dab6fcde866b13bf8a56d0c5244d169.zip | |
(describe_map): Merge with describe_map_2.
| -rw-r--r-- | src/keymap.c | 53 |
1 files changed, 20 insertions, 33 deletions
diff --git a/src/keymap.c b/src/keymap.c index 6351d9d1896..8f9b9d8a011 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -87,7 +87,6 @@ static Lisp_Object define_as_prefix (); | |||
| 87 | static Lisp_Object describe_buffer_bindings (); | 87 | static Lisp_Object describe_buffer_bindings (); |
| 88 | static void describe_command (); | 88 | static void describe_command (); |
| 89 | static void describe_map (); | 89 | static void describe_map (); |
| 90 | static void describe_map_2 (); | ||
| 91 | 90 | ||
| 92 | /* Keymap object support - constructors and predicates. */ | 91 | /* Keymap object support - constructors and predicates. */ |
| 93 | 92 | ||
| @@ -1968,7 +1967,7 @@ key binding\n\ | |||
| 1968 | sub_shadows = Fcons (shmap, sub_shadows); | 1967 | sub_shadows = Fcons (shmap, sub_shadows); |
| 1969 | } | 1968 | } |
| 1970 | 1969 | ||
| 1971 | describe_map (Fcdr (elt), Fcar (elt), partial, sub_shadows); | 1970 | describe_map (Fcdr (elt), Fcar (elt), describe_command, partial, sub_shadows); |
| 1972 | 1971 | ||
| 1973 | skip: ; | 1972 | skip: ; |
| 1974 | } | 1973 | } |
| @@ -2005,31 +2004,6 @@ describe_command (definition) | |||
| 2005 | } | 2004 | } |
| 2006 | } | 2005 | } |
| 2007 | 2006 | ||
| 2008 | /* Describe the contents of map MAP, assuming that this map itself is | ||
| 2009 | reached by the sequence of prefix keys KEYS (a string or vector). | ||
| 2010 | PARTIAL, SHADOW is as in `describe_map_tree' above. */ | ||
| 2011 | |||
| 2012 | static void | ||
| 2013 | describe_map (map, keys, partial, shadow) | ||
| 2014 | Lisp_Object map, keys; | ||
| 2015 | int partial; | ||
| 2016 | Lisp_Object shadow; | ||
| 2017 | { | ||
| 2018 | register Lisp_Object keysdesc; | ||
| 2019 | |||
| 2020 | if (!NILP (keys) && XFASTINT (Flength (keys)) > 0) | ||
| 2021 | { | ||
| 2022 | Lisp_Object tem; | ||
| 2023 | /* Call Fkey_description first, to avoid GC bug for the other string. */ | ||
| 2024 | tem = Fkey_description (keys); | ||
| 2025 | keysdesc = concat2 (tem, build_string (" ")); | ||
| 2026 | } | ||
| 2027 | else | ||
| 2028 | keysdesc = Qnil; | ||
| 2029 | |||
| 2030 | describe_map_2 (map, keysdesc, describe_command, partial, shadow); | ||
| 2031 | } | ||
| 2032 | |||
| 2033 | /* Like Flookup_key, but uses a list of keymaps SHADOW instead of a single map. | 2007 | /* Like Flookup_key, but uses a list of keymaps SHADOW instead of a single map. |
| 2034 | Returns the first non-nil binding found in any of those maps. */ | 2008 | Returns the first non-nil binding found in any of those maps. */ |
| 2035 | 2009 | ||
| @@ -2048,16 +2022,19 @@ shadow_lookup (shadow, key, flag) | |||
| 2048 | return Qnil; | 2022 | return Qnil; |
| 2049 | } | 2023 | } |
| 2050 | 2024 | ||
| 2051 | /* Insert a description of KEYMAP into the current buffer. */ | 2025 | /* Describe the contents of map MAP, assuming that this map itself is |
| 2026 | reached by the sequence of prefix keys KEYS (a string or vector). | ||
| 2027 | PARTIAL, SHADOW is as in `describe_map_tree' above. */ | ||
| 2052 | 2028 | ||
| 2053 | static void | 2029 | static void |
| 2054 | describe_map_2 (keymap, elt_prefix, elt_describer, partial, shadow) | 2030 | describe_map (map, keys, elt_describer, partial, shadow) |
| 2055 | register Lisp_Object keymap; | 2031 | register Lisp_Object map; |
| 2056 | Lisp_Object elt_prefix; | 2032 | Lisp_Object keys; |
| 2057 | int (*elt_describer) (); | 2033 | int (*elt_describer) (); |
| 2058 | int partial; | 2034 | int partial; |
| 2059 | Lisp_Object shadow; | 2035 | Lisp_Object shadow; |
| 2060 | { | 2036 | { |
| 2037 | Lisp_Object elt_prefix; | ||
| 2061 | Lisp_Object tail, definition, event; | 2038 | Lisp_Object tail, definition, event; |
| 2062 | Lisp_Object tem; | 2039 | Lisp_Object tem; |
| 2063 | Lisp_Object suppress; | 2040 | Lisp_Object suppress; |
| @@ -2065,6 +2042,16 @@ describe_map_2 (keymap, elt_prefix, elt_describer, partial, shadow) | |||
| 2065 | int first = 1; | 2042 | int first = 1; |
| 2066 | struct gcpro gcpro1, gcpro2, gcpro3; | 2043 | struct gcpro gcpro1, gcpro2, gcpro3; |
| 2067 | 2044 | ||
| 2045 | if (!NILP (keys) && XFASTINT (Flength (keys)) > 0) | ||
| 2046 | { | ||
| 2047 | Lisp_Object tem; | ||
| 2048 | /* Call Fkey_description first, to avoid GC bug for the other string. */ | ||
| 2049 | tem = Fkey_description (keys); | ||
| 2050 | elt_prefix = concat2 (tem, build_string (" ")); | ||
| 2051 | } | ||
| 2052 | else | ||
| 2053 | elt_prefix = Qnil; | ||
| 2054 | |||
| 2068 | if (partial) | 2055 | if (partial) |
| 2069 | suppress = intern ("suppress-keymap"); | 2056 | suppress = intern ("suppress-keymap"); |
| 2070 | 2057 | ||
| @@ -2076,7 +2063,7 @@ describe_map_2 (keymap, elt_prefix, elt_describer, partial, shadow) | |||
| 2076 | 2063 | ||
| 2077 | GCPRO3 (elt_prefix, definition, kludge); | 2064 | GCPRO3 (elt_prefix, definition, kludge); |
| 2078 | 2065 | ||
| 2079 | for (tail = XCONS (keymap)->cdr; CONSP (tail); tail = Fcdr (tail)) | 2066 | for (tail = XCONS (map)->cdr; CONSP (tail); tail = Fcdr (tail)) |
| 2080 | { | 2067 | { |
| 2081 | QUIT; | 2068 | QUIT; |
| 2082 | 2069 | ||
| @@ -2107,7 +2094,7 @@ describe_map_2 (keymap, elt_prefix, elt_describer, partial, shadow) | |||
| 2107 | if (!NILP (tem)) continue; | 2094 | if (!NILP (tem)) continue; |
| 2108 | } | 2095 | } |
| 2109 | 2096 | ||
| 2110 | tem = Flookup_key (keymap, kludge, Qt); | 2097 | tem = Flookup_key (map, kludge, Qt); |
| 2111 | if (! EQ (tem, definition)) continue; | 2098 | if (! EQ (tem, definition)) continue; |
| 2112 | 2099 | ||
| 2113 | if (first) | 2100 | if (first) |