aboutsummaryrefslogtreecommitdiffstats
path: root/src/keymap.c
diff options
context:
space:
mode:
authorStefan Monnier2001-10-12 18:46:30 +0000
committerStefan Monnier2001-10-12 18:46:30 +0000
commit2b6748c0ac9944fc6cbef6b31e6cc73ba0ee3a66 (patch)
treeaf273e9a667384a05a08271a59eca96427ff4944 /src/keymap.c
parent6c38915121df10ca1a785f2c05d0088076a7f362 (diff)
downloademacs-2b6748c0ac9944fc6cbef6b31e6cc73ba0ee3a66.tar.gz
emacs-2b6748c0ac9944fc6cbef6b31e6cc73ba0ee3a66.zip
(Fkey_description): Use empty_string.
(Fdescribe_bindings_internal, describe_buffer_bindings): Remove. (syms_of_keymap): Setup inheritance between maps. Don't export Sdescribe_bindings_internal any more.
Diffstat (limited to 'src/keymap.c')
-rw-r--r--src/keymap.c43
1 files changed, 8 insertions, 35 deletions
diff --git a/src/keymap.c b/src/keymap.c
index e41af212eb0..50f27273c72 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -107,7 +107,6 @@ static Lisp_Object store_in_keymap P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
107static void fix_submap_inheritance P_ ((Lisp_Object, Lisp_Object, Lisp_Object)); 107static void fix_submap_inheritance P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
108 108
109static Lisp_Object define_as_prefix P_ ((Lisp_Object, Lisp_Object)); 109static Lisp_Object define_as_prefix P_ ((Lisp_Object, Lisp_Object));
110static Lisp_Object describe_buffer_bindings P_ ((Lisp_Object));
111static void describe_command P_ ((Lisp_Object)); 110static void describe_command P_ ((Lisp_Object));
112static void describe_translation P_ ((Lisp_Object)); 111static void describe_translation P_ ((Lisp_Object));
113static void describe_map P_ ((Lisp_Object, Lisp_Object, 112static void describe_map P_ ((Lisp_Object, Lisp_Object,
@@ -805,6 +804,8 @@ store_in_keymap (keymap, idx, def)
805 return def; 804 return def;
806} 805}
807 806
807EXFUN (Fcopy_keymap, 1);
808
808void 809void
809copy_keymap_1 (chartable, idx, elt) 810copy_keymap_1 (chartable, idx, elt)
810 Lisp_Object chartable, idx, elt; 811 Lisp_Object chartable, idx, elt;
@@ -928,7 +929,7 @@ is not copied.")
928 929
929 } 930 }
930 } 931 }
931 932
932 return copy; 933 return copy;
933} 934}
934 935
@@ -1803,7 +1804,7 @@ spaces are put between sequence elements, etc.")
1803 keys = wrong_type_argument (Qarrayp, keys); 1804 keys = wrong_type_argument (Qarrayp, keys);
1804 1805
1805 if (len == 0) 1806 if (len == 0)
1806 return build_string (""); 1807 return empty_string;
1807 return Fconcat (len * 2 - 1, args); 1808 return Fconcat (len * 2 - 1, args);
1808} 1809}
1809 1810
@@ -2456,25 +2457,6 @@ where_is_internal_1 (binding, key, definition, noindirect, this, last,
2456 2457
2457/* describe-bindings - summarizing all the bindings in a set of keymaps. */ 2458/* describe-bindings - summarizing all the bindings in a set of keymaps. */
2458 2459
2459DEFUN ("describe-bindings-internal", Fdescribe_bindings_internal, Sdescribe_bindings_internal, 0, 2, "",
2460 "Show a list of all defined keys, and their definitions.\n\
2461We put that list in a buffer, and display the buffer.\n\
2462\n\
2463The optional argument MENUS, if non-nil, says to mention menu bindings.\n\
2464\(Ordinarily these are omitted from the output.)\n\
2465The optional argument PREFIX, if non-nil, should be a key sequence;\n\
2466then we display only bindings that start with that prefix.")
2467 (menus, prefix)
2468 Lisp_Object menus, prefix;
2469{
2470 register Lisp_Object thisbuf;
2471 XSETBUFFER (thisbuf, current_buffer);
2472 internal_with_output_to_temp_buffer ("*Help*",
2473 describe_buffer_bindings,
2474 list3 (thisbuf, prefix, menus));
2475 return Qnil;
2476}
2477
2478DEFUN ("describe-buffer-bindings", Fdescribe_buffer_bindings, Sdescribe_buffer_bindings, 1, 3, 0, 2460DEFUN ("describe-buffer-bindings", Fdescribe_buffer_bindings, Sdescribe_buffer_bindings, 1, 3, 0,
2479 "Insert the list of all defined keys and their definitions.\n\ 2461 "Insert the list of all defined keys and their definitions.\n\
2480The list is inserted in the current buffer, while the bindings are\n\ 2462The list is inserted in the current buffer, while the bindings are\n\
@@ -2608,18 +2590,6 @@ You type Translation\n\
2608 return Qnil; 2590 return Qnil;
2609} 2591}
2610 2592
2611/* ARG is (BUFFER PREFIX MENU-FLAG). */
2612
2613static Lisp_Object
2614describe_buffer_bindings (arg)
2615 Lisp_Object arg;
2616{
2617 Fset_buffer (Vstandard_output);
2618 return Fdescribe_buffer_bindings (XCAR (arg), XCAR (XCDR (arg)),
2619 XCAR (XCDR (XCDR (arg))));
2620}
2621
2622
2623/* Insert a description of the key bindings in STARTMAP, 2593/* Insert a description of the key bindings in STARTMAP,
2624 followed by those of all maps reachable through STARTMAP. 2594 followed by those of all maps reachable through STARTMAP.
2625 If PARTIAL is nonzero, omit certain "uninteresting" commands 2595 If PARTIAL is nonzero, omit certain "uninteresting" commands
@@ -3379,14 +3349,18 @@ don't alter it yourself.");
3379 DEFVAR_LISP ("minibuffer-local-ns-map", &Vminibuffer_local_ns_map, 3349 DEFVAR_LISP ("minibuffer-local-ns-map", &Vminibuffer_local_ns_map,
3380 "Local keymap for the minibuffer when spaces are not allowed."); 3350 "Local keymap for the minibuffer when spaces are not allowed.");
3381 Vminibuffer_local_ns_map = Fmake_sparse_keymap (Qnil); 3351 Vminibuffer_local_ns_map = Fmake_sparse_keymap (Qnil);
3352 Fset_keymap_parent (Vminibuffer_local_ns_map, Vminibuffer_local_map);
3382 3353
3383 DEFVAR_LISP ("minibuffer-local-completion-map", &Vminibuffer_local_completion_map, 3354 DEFVAR_LISP ("minibuffer-local-completion-map", &Vminibuffer_local_completion_map,
3384 "Local keymap for minibuffer input with completion."); 3355 "Local keymap for minibuffer input with completion.");
3385 Vminibuffer_local_completion_map = Fmake_sparse_keymap (Qnil); 3356 Vminibuffer_local_completion_map = Fmake_sparse_keymap (Qnil);
3357 Fset_keymap_parent (Vminibuffer_local_completion_map, Vminibuffer_local_map);
3386 3358
3387 DEFVAR_LISP ("minibuffer-local-must-match-map", &Vminibuffer_local_must_match_map, 3359 DEFVAR_LISP ("minibuffer-local-must-match-map", &Vminibuffer_local_must_match_map,
3388 "Local keymap for minibuffer input with completion, for exact match."); 3360 "Local keymap for minibuffer input with completion, for exact match.");
3389 Vminibuffer_local_must_match_map = Fmake_sparse_keymap (Qnil); 3361 Vminibuffer_local_must_match_map = Fmake_sparse_keymap (Qnil);
3362 Fset_keymap_parent (Vminibuffer_local_must_match_map,
3363 Vminibuffer_local_completion_map);
3390 3364
3391 DEFVAR_LISP ("minor-mode-map-alist", &Vminor_mode_map_alist, 3365 DEFVAR_LISP ("minor-mode-map-alist", &Vminor_mode_map_alist,
3392 "Alist of keymaps to use for minor modes.\n\ 3366 "Alist of keymaps to use for minor modes.\n\
@@ -3476,7 +3450,6 @@ and applies even for keys that have ordinary bindings.");
3476 defsubr (&Ssingle_key_description); 3450 defsubr (&Ssingle_key_description);
3477 defsubr (&Stext_char_description); 3451 defsubr (&Stext_char_description);
3478 defsubr (&Swhere_is_internal); 3452 defsubr (&Swhere_is_internal);
3479 defsubr (&Sdescribe_bindings_internal);
3480 defsubr (&Sdescribe_buffer_bindings); 3453 defsubr (&Sdescribe_buffer_bindings);
3481 defsubr (&Sapropos_internal); 3454 defsubr (&Sapropos_internal);
3482} 3455}