aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Kangas2021-01-08 15:16:02 +0100
committerStefan Kangas2021-01-08 15:16:02 +0100
commit5ac7b480757d8731fe2bda0452e48f0cd0356aa4 (patch)
tree5c4ad470ed58fc1fcfc51182de6617bf18eff341 /src
parentf5cfe5a0a9c64f001f1cec3f78b811a3b6e69b09 (diff)
downloademacs-5ac7b480757d8731fe2bda0452e48f0cd0356aa4.tar.gz
emacs-5ac7b480757d8731fe2bda0452e48f0cd0356aa4.zip
Lift define-prefix-command to Lisp
* lisp/subr.el (define-prefix-command): New defun. * src/keymap.c (Fdefine_prefix_command): Remove DEFUN. (syms_of_keymap): Remove defsubr for Fdefine_prefix_command. * test/lisp/subr-tests.el (subr-test-define-prefix-command): New test.
Diffstat (limited to 'src')
-rw-r--r--src/keymap.c23
1 files changed, 0 insertions, 23 deletions
diff --git a/src/keymap.c b/src/keymap.c
index 3d1993869bc..1197f6fd4a5 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1712,28 +1712,6 @@ bindings; see the description of `lookup-key' for more details about this. */)
1712 return Flist (j, maps); 1712 return Flist (j, maps);
1713} 1713}
1714 1714
1715DEFUN ("define-prefix-command", Fdefine_prefix_command, Sdefine_prefix_command, 1, 3, 0,
1716 doc: /* Define COMMAND as a prefix command. COMMAND should be a symbol.
1717A new sparse keymap is stored as COMMAND's function definition and its
1718value.
1719This prepares COMMAND for use as a prefix key's binding.
1720If a second optional argument MAPVAR is given, it should be a symbol.
1721The map is then stored as MAPVAR's value instead of as COMMAND's
1722value; but COMMAND is still defined as a function.
1723The third optional argument NAME, if given, supplies a menu name
1724string for the map. This is required to use the keymap as a menu.
1725This function returns COMMAND. */)
1726 (Lisp_Object command, Lisp_Object mapvar, Lisp_Object name)
1727{
1728 Lisp_Object map = Fmake_sparse_keymap (name);
1729 Ffset (command, map);
1730 if (!NILP (mapvar))
1731 Fset (mapvar, map);
1732 else
1733 Fset (command, map);
1734 return command;
1735}
1736
1737DEFUN ("use-global-map", Fuse_global_map, Suse_global_map, 1, 1, 0, 1715DEFUN ("use-global-map", Fuse_global_map, Suse_global_map, 1, 1, 0,
1738 doc: /* Select KEYMAP as the global keymap. */) 1716 doc: /* Select KEYMAP as the global keymap. */)
1739 (Lisp_Object keymap) 1717 (Lisp_Object keymap)
@@ -3280,7 +3258,6 @@ be preferred. */);
3280 defsubr (&Sminor_mode_key_binding); 3258 defsubr (&Sminor_mode_key_binding);
3281 defsubr (&Sdefine_key); 3259 defsubr (&Sdefine_key);
3282 defsubr (&Slookup_key); 3260 defsubr (&Slookup_key);
3283 defsubr (&Sdefine_prefix_command);
3284 defsubr (&Suse_global_map); 3261 defsubr (&Suse_global_map);
3285 defsubr (&Suse_local_map); 3262 defsubr (&Suse_local_map);
3286 defsubr (&Scurrent_local_map); 3263 defsubr (&Scurrent_local_map);