aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorMattias EngdegÄrd2020-12-29 16:55:06 +0100
committerMattias EngdegÄrd2021-01-05 11:28:58 +0100
commit7f16f177270e8e69cb8b78fb502caae3653a32cf (patch)
tree457b69dbfefe25efde1217b8432ac882986b65c7 /test/src
parente6617f0dffbb1ca7a72287621c9c38c8a72145aa (diff)
downloademacs-7f16f177270e8e69cb8b78fb502caae3653a32cf.tar.gz
emacs-7f16f177270e8e69cb8b78fb502caae3653a32cf.zip
Pretty-print keys without <> around modifiers (bug#45536)
Be consistent when pretty-printing keys: put modifiers outside <>, thus the more logical C-M-<return> instead of <C-M-return>. * src/keymap.c (Fsingle_key_description): Skip modifier prefix before adding <>. * doc/lispref/help.texi (Describing Characters): Update example. * doc/lispref/debugging.texi (Backtraces): * doc/lispref/minibuf.texi (Text from Minibuffer): Use @kbd instead of @key. * etc/NEWS: Announce the change. * test/src/keymap-tests.el (keymap--key-description): * test/lisp/subr-tests.el (subr--kbd): New tests.
Diffstat (limited to 'test/src')
-rw-r--r--test/src/keymap-tests.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/src/keymap-tests.el b/test/src/keymap-tests.el
index 74fb3c892db..d4f5fc3f190 100644
--- a/test/src/keymap-tests.el
+++ b/test/src/keymap-tests.el
@@ -248,6 +248,18 @@ g .. h foo
2480 .. 3 foo 2480 .. 3 foo
249"))))) 249")))))
250 250
251(ert-deftest keymap--key-description ()
252 (should (equal (key-description [right] [?\C-x])
253 "C-x <right>"))
254 (should (equal (key-description [M-H-right] [?\C-x])
255 "C-x M-H-<right>"))
256 (should (equal (single-key-description 'home)
257 "<home>"))
258 (should (equal (single-key-description 'home t)
259 "home"))
260 (should (equal (single-key-description 'C-s-home)
261 "C-s-<home>")))
262
251(provide 'keymap-tests) 263(provide 'keymap-tests)
252 264
253;;; keymap-tests.el ends here 265;;; keymap-tests.el ends here