aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorStefan Kangas2021-01-13 18:54:09 +0100
committerStefan Kangas2021-01-13 18:54:09 +0100
commita9658cd5b07e88a5d413cbb4dfd8f9d9d0c8bbf5 (patch)
tree6c4703b44fd8f46052abce1dddb3ab26741dc5e3 /test
parentbe9b7e83bc4191aff01c692be0f7a156ec4056da (diff)
downloademacs-a9658cd5b07e88a5d413cbb4dfd8f9d9d0c8bbf5.tar.gz
emacs-a9658cd5b07e88a5d413cbb4dfd8f9d9d0c8bbf5.zip
Lift {global,local}-key-binding to Lisp
* lisp/subr.el (local-key-binding, global-key-binding): New defuns. * src/keymap.c (Flocal_key_binding, Fglobal_key_binding): Remove DEFUNs. (syms_of_keymap): Remove defsubrs for above DEFUNs. * test/lisp/subr-tests.el (subr-test-local-key-binding) (subr-test-global-key-binding): New tests.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/subr-tests.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el
index e0826208b60..fc5a1eba6d8 100644
--- a/test/lisp/subr-tests.el
+++ b/test/lisp/subr-tests.el
@@ -87,6 +87,17 @@
87 ;; Returns the symbol. 87 ;; Returns the symbol.
88 (should (eq (define-prefix-command 'foo-bar) 'foo-bar))) 88 (should (eq (define-prefix-command 'foo-bar) 'foo-bar)))
89 89
90(ert-deftest subr-test-local-key-binding ()
91 (with-temp-buffer
92 (emacs-lisp-mode)
93 (should (keymapp (local-key-binding [menu-bar])))
94 (should-not (local-key-binding [f12]))))
95
96(ert-deftest subr-test-global-key-binding ()
97 (should (eq (global-key-binding [f1]) 'help-command))
98 (should (eq (global-key-binding "x") 'self-insert-command))
99 (should-not (global-key-binding [f12])))
100
90 101
91;;;; Mode hooks. 102;;;; Mode hooks.
92 103