From 5ac7b480757d8731fe2bda0452e48f0cd0356aa4 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 8 Jan 2021 15:16:02 +0100 Subject: 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. --- test/lisp/subr-tests.el | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/lisp/subr-tests.el') diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index 54f6eb4b2a1..83031c44fcd 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el @@ -70,6 +70,17 @@ (should (equal (kbd "RET") "\C-m")) (should (equal (kbd "C-x a") "\C-xa"))) +(ert-deftest subr-test-define-prefix-command () + (define-prefix-command 'foo-prefix-map) + (should (keymapp foo-prefix-map)) + (should (fboundp #'foo-prefix-map)) + ;; With optional argument. + (define-prefix-command 'bar-prefix 'bar-prefix-map) + (should (keymapp bar-prefix-map)) + (should (fboundp #'bar-prefix)) + ;; Returns the symbol. + (should (eq (define-prefix-command 'foo-bar) 'foo-bar))) + ;;;; Mode hooks. -- cgit v1.2.3