diff options
| author | Lars Ingebrigtsen | 2022-06-18 14:06:00 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2022-06-18 14:06:30 +0200 |
| commit | 0dc75daf1189d2327c6efa4d747fa98fcba03ea3 (patch) | |
| tree | ff53b16faa9c8fef8530590abca8f8e99ba44ccb /test/src | |
| parent | d7265d58f8dbab8049be4be0fa3f474e7fef7be6 (diff) | |
| download | emacs-0dc75daf1189d2327c6efa4d747fa98fcba03ea3.tar.gz emacs-0dc75daf1189d2327c6efa4d747fa98fcba03ea3.zip | |
Filter out NS non-key events from `where-is-internal'
* doc/lispref/keymaps.texi (Scanning Keymaps): Document it.
* lisp/keymap.el (make-non-key-event): New function.
* lisp/term/common-win.el (x-setup-function-keys): Mark ns events
as not being keys (bug#55940).
* src/keymap.c (Fwhere_is_internal): Filter out key sequences that
are marked as being non-keys.
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/keymap-tests.el | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/src/keymap-tests.el b/test/src/keymap-tests.el index 69aa7238493..eeac1dbe6d1 100644 --- a/test/src/keymap-tests.el +++ b/test/src/keymap-tests.el | |||
| @@ -418,6 +418,16 @@ g .. h foo | |||
| 418 | (should-error (text-char-description ?\M-c)) | 418 | (should-error (text-char-description ?\M-c)) |
| 419 | (should-error (text-char-description ?\s-c))) | 419 | (should-error (text-char-description ?\s-c))) |
| 420 | 420 | ||
| 421 | (ert-deftest test-non-key-events () | ||
| 422 | (should (null (where-is-internal 'keymap-tests-command))) | ||
| 423 | (keymap-set global-map "C-c g" #'keymap-tests-command) | ||
| 424 | (should (equal (where-is-internal 'keymap-tests-command) '([3 103]))) | ||
| 425 | (keymap-set global-map "<keymap-tests-event>" #'keymap-tests-command) | ||
| 426 | (should (equal (where-is-internal 'keymap-tests-command) | ||
| 427 | '([keymap-tests-event] [3 103]))) | ||
| 428 | (make-non-key-event 'keymap-tests-event) | ||
| 429 | (should (equal (where-is-internal 'keymap-tests-command) '([3 103])))) | ||
| 430 | |||
| 421 | (provide 'keymap-tests) | 431 | (provide 'keymap-tests) |
| 422 | 432 | ||
| 423 | ;;; keymap-tests.el ends here | 433 | ;;; keymap-tests.el ends here |