diff options
| author | Stefan Kangas | 2023-01-23 01:34:39 +0100 |
|---|---|---|
| committer | Stefan Kangas | 2023-01-23 01:34:39 +0100 |
| commit | 0805972e4cab3493d172edf2e303486d7c3cb386 (patch) | |
| tree | e806d00b1518012c00cdd6b8a0e29fac4c16bd5a /test/src | |
| parent | 8febda46c458f11270350d0b68c69d8a58b59f8d (diff) | |
| parent | b3de81a6ee3b379fc1dfb9a071e469365081f438 (diff) | |
| download | emacs-0805972e4cab3493d172edf2e303486d7c3cb386.tar.gz emacs-0805972e4cab3493d172edf2e303486d7c3cb386.zip | |
Merge from origin/emacs-29
b3de81a6ee3 MH-E: handle removal of mhparam libdir from nmh 1.8
d63e1a89518 Use point-min to anchor top-level constructs (bug#60602)
34793337783 * lisp/org/ob-ruby.el: Fix outdated comments.
472f1425985 ; ruby-ts-mode: Add a Version tag
0cf053648a4 ; ruby-ts-mode: Update font-lock features list in Commentary
67ee627c38d (project-try-vc): Add string-start and string-end anchors...
06953fc8e1d Make `keymap-set-after' work for menus
dcd59457b48 Use `key-parse' in `keymap-lookup'
8904a26a9d2 Improve `keymap-set-after' documentation
c7e02eaa3d9 Handle after arg correctly in `keymap-set-after'
628b6241763 Don't load erc-goodies atop erc.el
40cf494b7ce ; * etc/NEWS: Fix typos.
6b2f85caa6c Make tree-sitter based modes optional
b56cf28b325 ; (ruby-ts--predefined-variables): Make it a little shorter
d94dc606a09 ruby-ts-mode: Claw back half of the performance drop from...
d0d34514097 (ruby-ts-mode): Rename 'builtin-functions' to 'builtin-fu...
d66ac5285f7 ruby-ts-mode: Highlight builtin methods
370b1ac99ec ; ruby-ts-mode.el: Add customize-group mention to commentary
7b7b2b95138 Fix c-ts-mode indent (bug#60873)
7ca71d66dc7 Fix various problems in treesit-explore-mode (bug#60800)
b7d6bb47ee5 ; * lisp/treesit.el (treesit-font-lock-fontify-region): M...
0c6bfeddb21 ; Update tree-sitter major mode manual
c289786886b ; Add commentary and dostring in c-ts-mode
# Conflicts:
# etc/NEWS
# lisp/progmodes/c-ts-mode.el
# lisp/progmodes/go-ts-mode.el
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/keymap-tests.el | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/src/keymap-tests.el b/test/src/keymap-tests.el index b7715a280a6..aa710519825 100644 --- a/test/src/keymap-tests.el +++ b/test/src/keymap-tests.el | |||
| @@ -226,6 +226,7 @@ commit 86c19714b097aa477d339ed99ffb5136c755a046." | |||
| 226 | 226 | ||
| 227 | (defun keymap-tests--command-1 () (interactive) nil) | 227 | (defun keymap-tests--command-1 () (interactive) nil) |
| 228 | (defun keymap-tests--command-2 () (interactive) nil) | 228 | (defun keymap-tests--command-2 () (interactive) nil) |
| 229 | (defun keymap-tests--command-3 () (interactive) nil) | ||
| 229 | (put 'keymap-tests--command-1 :advertised-binding [?y]) | 230 | (put 'keymap-tests--command-1 :advertised-binding [?y]) |
| 230 | 231 | ||
| 231 | (ert-deftest keymap-where-is-internal () | 232 | (ert-deftest keymap-where-is-internal () |
| @@ -430,6 +431,38 @@ g .. h foo | |||
| 430 | (make-non-key-event 'keymap-tests-event) | 431 | (make-non-key-event 'keymap-tests-event) |
| 431 | (should (equal (where-is-internal 'keymap-tests-command) '([3 103])))) | 432 | (should (equal (where-is-internal 'keymap-tests-command) '([3 103])))) |
| 432 | 433 | ||
| 434 | (ert-deftest keymap-set-consistency () | ||
| 435 | (let ((k (make-sparse-keymap))) | ||
| 436 | ;; `keymap-set' returns the binding, `keymap-set-after' doesn't, | ||
| 437 | ;; so we need to check for nil. <sigh> | ||
| 438 | (should (keymap-set k "a" "a")) | ||
| 439 | (should (equal (keymap-lookup k "a") (key-parse "a"))) | ||
| 440 | (should-not (keymap-set-after k "b" "b")) | ||
| 441 | (should (equal (keymap-lookup k "b") (key-parse "b"))) | ||
| 442 | (should-not (keymap-set-after k "d" "d" t)) | ||
| 443 | (should (equal (keymap-lookup k "d") (key-parse "d"))) | ||
| 444 | (should-not (keymap-set-after k "e" "e" nil)) | ||
| 445 | (should (equal (keymap-lookup k "e") (key-parse "e"))) | ||
| 446 | ;; This doesn't fail, but it does not add the 'f' binding after 'a' | ||
| 447 | (should-not (keymap-set-after k "f" "f" "a")) | ||
| 448 | (should (equal (keymap-lookup k "f") (key-parse "f"))))) | ||
| 449 | |||
| 450 | (ert-deftest keymap-set-after-menus () | ||
| 451 | (let ((map (make-sparse-keymap))) | ||
| 452 | (keymap-set map "<cmd1>" | ||
| 453 | '(menu-item "Run Command 1" keymap-tests--command-1 | ||
| 454 | :help "Command 1 Help")) | ||
| 455 | (keymap-set-after map "<cmd2>" | ||
| 456 | '(menu-item "Run Command 2" keymap-tests--command-2 | ||
| 457 | :help "Command 2 Help")) | ||
| 458 | (keymap-set-after map "<cmd3>" | ||
| 459 | '(menu-item "Run Command 3" keymap-tests--command-3 | ||
| 460 | :help "Command 3 Help") | ||
| 461 | 'cmd1) | ||
| 462 | (should (equal (caadr map) 'cmd1)) | ||
| 463 | (should (equal (caaddr map) 'cmd3)) | ||
| 464 | (should (equal (caar (last map)) 'cmd2)))) | ||
| 465 | |||
| 433 | (ert-deftest keymap-test-duplicate-definitions () | 466 | (ert-deftest keymap-test-duplicate-definitions () |
| 434 | "Check that defvar-keymap rejects duplicate key definitions." | 467 | "Check that defvar-keymap rejects duplicate key definitions." |
| 435 | (should-error | 468 | (should-error |