diff options
author | Stefan Kangas <stefan@marxist.se> | 2021-01-08 15:16:02 +0100 |
---|---|---|
committer | Stefan Kangas <stefan@marxist.se> | 2021-01-08 15:16:02 +0100 |
commit | 5ac7b480757d8731fe2bda0452e48f0cd0356aa4 (patch) | |
tree | 5c4ad470ed58fc1fcfc51182de6617bf18eff341 /src/keymap.c | |
parent | f5cfe5a0a9c64f001f1cec3f78b811a3b6e69b09 (diff) | |
download | emacs-5ac7b480757d8731fe2bda0452e48f0cd0356aa4.tar.gz emacs-5ac7b480757d8731fe2bda0452e48f0cd0356aa4.tar.bz2 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/keymap.c')
-rw-r--r-- | src/keymap.c | 23 |
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. */) return Flist (j, maps); } -DEFUN ("define-prefix-command", Fdefine_prefix_command, Sdefine_prefix_command, 1, 3, 0, - doc: /* Define COMMAND as a prefix command. COMMAND should be a symbol. -A new sparse keymap is stored as COMMAND's function definition and its -value. -This prepares COMMAND for use as a prefix key's binding. -If a second optional argument MAPVAR is given, it should be a symbol. -The map is then stored as MAPVAR's value instead of as COMMAND's -value; but COMMAND is still defined as a function. -The third optional argument NAME, if given, supplies a menu name -string for the map. This is required to use the keymap as a menu. -This function returns COMMAND. */) - (Lisp_Object command, Lisp_Object mapvar, Lisp_Object name) -{ - Lisp_Object map = Fmake_sparse_keymap (name); - Ffset (command, map); - if (!NILP (mapvar)) - Fset (mapvar, map); - else - Fset (command, map); - return command; -} - DEFUN ("use-global-map", Fuse_global_map, Suse_global_map, 1, 1, 0, doc: /* Select KEYMAP as the global keymap. */) (Lisp_Object keymap) @@ -3280,7 +3258,6 @@ be preferred. */); defsubr (&Sminor_mode_key_binding); defsubr (&Sdefine_key); defsubr (&Slookup_key); - defsubr (&Sdefine_prefix_command); defsubr (&Suse_global_map); defsubr (&Suse_local_map); defsubr (&Scurrent_local_map); |