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 /src/keymap.c | |
| 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 'src/keymap.c')
| -rw-r--r-- | src/keymap.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/keymap.c b/src/keymap.c index c8b01eed6fd..2b77a7fc444 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -2596,7 +2596,10 @@ The optional 5th arg NO-REMAP alters how command remapping is handled: | |||
| 2596 | 2596 | ||
| 2597 | - If DEFINITION is remapped to OTHER-COMMAND, normally return the | 2597 | - If DEFINITION is remapped to OTHER-COMMAND, normally return the |
| 2598 | bindings for OTHER-COMMAND. But if NO-REMAP is non-nil, return the | 2598 | bindings for OTHER-COMMAND. But if NO-REMAP is non-nil, return the |
| 2599 | bindings for DEFINITION instead, ignoring its remapping. */) | 2599 | bindings for DEFINITION instead, ignoring its remapping. |
| 2600 | |||
| 2601 | Keys that are represented as events that have a `non-key-event' non-nil | ||
| 2602 | symbol property are ignored. */) | ||
| 2600 | (Lisp_Object definition, Lisp_Object keymap, Lisp_Object firstonly, Lisp_Object noindirect, Lisp_Object no_remap) | 2603 | (Lisp_Object definition, Lisp_Object keymap, Lisp_Object firstonly, Lisp_Object noindirect, Lisp_Object no_remap) |
| 2601 | { | 2604 | { |
| 2602 | /* The keymaps in which to search. */ | 2605 | /* The keymaps in which to search. */ |
| @@ -2720,7 +2723,12 @@ The optional 5th arg NO-REMAP alters how command remapping is handled: | |||
| 2720 | 2723 | ||
| 2721 | /* It is a true unshadowed match. Record it, unless it's already | 2724 | /* It is a true unshadowed match. Record it, unless it's already |
| 2722 | been seen (as could happen when inheriting keymaps). */ | 2725 | been seen (as could happen when inheriting keymaps). */ |
| 2723 | if (NILP (Fmember (sequence, found))) | 2726 | if (NILP (Fmember (sequence, found)) |
| 2727 | /* Filter out non key events. */ | ||
| 2728 | && !(VECTORP (sequence) | ||
| 2729 | && ASIZE (sequence) == 1 | ||
| 2730 | && SYMBOLP (AREF (sequence, 0)) | ||
| 2731 | && !NILP (Fget (AREF (sequence, 0), Qnon_key_event)))) | ||
| 2724 | found = Fcons (sequence, found); | 2732 | found = Fcons (sequence, found); |
| 2725 | 2733 | ||
| 2726 | /* If firstonly is Qnon_ascii, then we can return the first | 2734 | /* If firstonly is Qnon_ascii, then we can return the first |
| @@ -3461,4 +3469,6 @@ that describe key bindings. That is why the default is nil. */); | |||
| 3461 | 3469 | ||
| 3462 | DEFSYM (Qkey_parse, "key-parse"); | 3470 | DEFSYM (Qkey_parse, "key-parse"); |
| 3463 | DEFSYM (Qkey_valid_p, "key-valid-p"); | 3471 | DEFSYM (Qkey_valid_p, "key-valid-p"); |
| 3472 | |||
| 3473 | DEFSYM (Qnon_key_event, "non-key-event"); | ||
| 3464 | } | 3474 | } |