diff options
| author | Richard M. Stallman | 1998-02-05 03:31:41 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-02-05 03:31:41 +0000 |
| commit | 6cec169a54d790b4a898d1c33803e749db657248 (patch) | |
| tree | 57f69295b3abb948bf2444cbcd845b27f0f65155 /src | |
| parent | c0f51373af15ff201a9d95efcb43a9ff4b2954d4 (diff) | |
| download | emacs-6cec169a54d790b4a898d1c33803e749db657248.tar.gz emacs-6cec169a54d790b4a898d1c33803e749db657248.zip | |
(Fdescribe_bindings_internal):
Renamed from Fdescribe_bindings. New arg NOMENU.
(syms_of_keymap): Corresponding changes.
(describe_buffer_bindings): Get NOMENU out of the arg list.
Pass it along to describe_map_tree.
Improve text of `alternate_heading'.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keymap.c | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/src/keymap.c b/src/keymap.c index 291624bdb74..4e8259fde2f 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -2206,40 +2206,48 @@ where_is_internal_1 (binding, key, definition, noindirect, keymap, this, last, | |||
| 2206 | 2206 | ||
| 2207 | /* describe-bindings - summarizing all the bindings in a set of keymaps. */ | 2207 | /* describe-bindings - summarizing all the bindings in a set of keymaps. */ |
| 2208 | 2208 | ||
| 2209 | DEFUN ("describe-bindings", Fdescribe_bindings, Sdescribe_bindings, 0, 1, "", | 2209 | DEFUN ("describe-bindings-internal", Fdescribe_bindings_internal, Sdescribe_bindings_internal, 0, 2, "", |
| 2210 | "Show a list of all defined keys, and their definitions.\n\ | 2210 | "Show a list of all defined keys, and their definitions.\n\ |
| 2211 | The list is put in a buffer, which is displayed.\n\ | 2211 | We put that list in a buffer, and display the buffer.\n\ |
| 2212 | An optional argument PREFIX, if non-nil, should be a key sequence;\n\ | 2212 | \n\ |
| 2213 | The optional argument MENUS, if non-nil, says to mention menu bindings.\n\ | ||
| 2214 | \(Ordinarily these are omitted from the output.)\n\ | ||
| 2215 | The optional argument PREFIX, if non-nil, should be a key sequence;\n\ | ||
| 2213 | then we display only bindings that start with that prefix.") | 2216 | then we display only bindings that start with that prefix.") |
| 2214 | (prefix) | 2217 | (menus, prefix) |
| 2215 | Lisp_Object prefix; | 2218 | Lisp_Object menus, prefix; |
| 2216 | { | 2219 | { |
| 2217 | register Lisp_Object thisbuf; | 2220 | register Lisp_Object thisbuf; |
| 2218 | XSETBUFFER (thisbuf, current_buffer); | 2221 | XSETBUFFER (thisbuf, current_buffer); |
| 2219 | internal_with_output_to_temp_buffer ("*Help*", | 2222 | internal_with_output_to_temp_buffer ("*Help*", |
| 2220 | describe_buffer_bindings, | 2223 | describe_buffer_bindings, |
| 2221 | Fcons (thisbuf, prefix)); | 2224 | list3 (thisbuf, prefix, menus)); |
| 2222 | return Qnil; | 2225 | return Qnil; |
| 2223 | } | 2226 | } |
| 2224 | 2227 | ||
| 2225 | /* ARG is (BUFFER . PREFIX). */ | 2228 | /* ARG is (BUFFER PREFIX MENU-FLAG). */ |
| 2226 | 2229 | ||
| 2227 | static Lisp_Object | 2230 | static Lisp_Object |
| 2228 | describe_buffer_bindings (arg) | 2231 | describe_buffer_bindings (arg) |
| 2229 | Lisp_Object arg; | 2232 | Lisp_Object arg; |
| 2230 | { | 2233 | { |
| 2231 | Lisp_Object descbuf, prefix, shadow; | 2234 | Lisp_Object descbuf, prefix, shadow; |
| 2235 | int nomenu; | ||
| 2232 | register Lisp_Object start1; | 2236 | register Lisp_Object start1; |
| 2233 | struct gcpro gcpro1; | 2237 | struct gcpro gcpro1; |
| 2234 | 2238 | ||
| 2235 | char *alternate_heading | 2239 | char *alternate_heading |
| 2236 | = "\ | 2240 | = "\ |
| 2237 | Alternate Characters (use anywhere the nominal character is listed):\n\ | 2241 | Keyboard translations:\n\n\ |
| 2238 | nominal alternate\n\ | 2242 | You type Translation\n\ |
| 2239 | ------- ---------\n"; | 2243 | -------- -----------\n"; |
| 2240 | 2244 | ||
| 2241 | descbuf = XCONS (arg)->car; | 2245 | descbuf = XCONS (arg)->car; |
| 2242 | prefix = XCONS (arg)->cdr; | 2246 | arg = XCONS (arg)->cdr; |
| 2247 | prefix = XCONS (arg)->car; | ||
| 2248 | arg = XCONS (arg)->cdr; | ||
| 2249 | nomenu = NILP (XCONS (arg)->car); | ||
| 2250 | |||
| 2243 | shadow = Qnil; | 2251 | shadow = Qnil; |
| 2244 | GCPRO1 (shadow); | 2252 | GCPRO1 (shadow); |
| 2245 | 2253 | ||
| @@ -2278,7 +2286,7 @@ nominal alternate\n\ | |||
| 2278 | 2286 | ||
| 2279 | if (!NILP (Vkey_translation_map)) | 2287 | if (!NILP (Vkey_translation_map)) |
| 2280 | describe_map_tree (Vkey_translation_map, 0, Qnil, prefix, | 2288 | describe_map_tree (Vkey_translation_map, 0, Qnil, prefix, |
| 2281 | "Key translations", 0, 1, 0); | 2289 | "Key translations", nomenu, 1, 0); |
| 2282 | 2290 | ||
| 2283 | { | 2291 | { |
| 2284 | int i, nmaps; | 2292 | int i, nmaps; |
| @@ -2317,7 +2325,7 @@ nominal alternate\n\ | |||
| 2317 | p += sizeof (" Minor Mode Bindings") - 1; | 2325 | p += sizeof (" Minor Mode Bindings") - 1; |
| 2318 | *p = 0; | 2326 | *p = 0; |
| 2319 | 2327 | ||
| 2320 | describe_map_tree (maps[i], 1, shadow, prefix, title, 0, 0, 0); | 2328 | describe_map_tree (maps[i], 1, shadow, prefix, title, nomenu, 0, 0); |
| 2321 | shadow = Fcons (maps[i], shadow); | 2329 | shadow = Fcons (maps[i], shadow); |
| 2322 | } | 2330 | } |
| 2323 | } | 2331 | } |
| @@ -2333,17 +2341,17 @@ nominal alternate\n\ | |||
| 2333 | if (!NILP (start1)) | 2341 | if (!NILP (start1)) |
| 2334 | { | 2342 | { |
| 2335 | describe_map_tree (start1, 1, shadow, prefix, | 2343 | describe_map_tree (start1, 1, shadow, prefix, |
| 2336 | "Major Mode Bindings", 0, 0, 0); | 2344 | "Major Mode Bindings", nomenu, 0, 0); |
| 2337 | shadow = Fcons (start1, shadow); | 2345 | shadow = Fcons (start1, shadow); |
| 2338 | } | 2346 | } |
| 2339 | 2347 | ||
| 2340 | describe_map_tree (current_global_map, 1, shadow, prefix, | 2348 | describe_map_tree (current_global_map, 1, shadow, prefix, |
| 2341 | "Global Bindings", 0, 0, 1); | 2349 | "Global Bindings", nomenu, 0, 1); |
| 2342 | 2350 | ||
| 2343 | /* Print the function-key-map translations under this prefix. */ | 2351 | /* Print the function-key-map translations under this prefix. */ |
| 2344 | if (!NILP (Vfunction_key_map)) | 2352 | if (!NILP (Vfunction_key_map)) |
| 2345 | describe_map_tree (Vfunction_key_map, 0, Qnil, prefix, | 2353 | describe_map_tree (Vfunction_key_map, 0, Qnil, prefix, |
| 2346 | "Function key map translations", 0, 1, 0); | 2354 | "Function key map translations", nomenu, 1, 0); |
| 2347 | 2355 | ||
| 2348 | call0 (intern ("help-mode")); | 2356 | call0 (intern ("help-mode")); |
| 2349 | Fset_buffer (descbuf); | 2357 | Fset_buffer (descbuf); |
| @@ -3213,7 +3221,7 @@ and applies even for keys that have ordinary bindings."); | |||
| 3213 | defsubr (&Ssingle_key_description); | 3221 | defsubr (&Ssingle_key_description); |
| 3214 | defsubr (&Stext_char_description); | 3222 | defsubr (&Stext_char_description); |
| 3215 | defsubr (&Swhere_is_internal); | 3223 | defsubr (&Swhere_is_internal); |
| 3216 | defsubr (&Sdescribe_bindings); | 3224 | defsubr (&Sdescribe_bindings_internal); |
| 3217 | defsubr (&Sapropos_internal); | 3225 | defsubr (&Sapropos_internal); |
| 3218 | } | 3226 | } |
| 3219 | 3227 | ||