diff options
| author | Eli Zaretskii | 2023-08-04 09:34:55 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2023-08-04 09:36:45 +0300 |
| commit | acfcf7f3690630344b090b4af6afa4d02d0147a3 (patch) | |
| tree | aa09d996a0bc2add39c5a78f8ab3eeed070a6263 /src | |
| parent | 04996b21241468979ac7f8b4a80563186bee9fad (diff) | |
| download | emacs-acfcf7f3690630344b090b4af6afa4d02d0147a3.tar.gz emacs-acfcf7f3690630344b090b4af6afa4d02d0147a3.zip | |
Fix "Paste from Kill Menu" in non X toolkit builds
* src/keymap.c (possibly_translate_key_sequence): Don't signal an
error if 'key-valid-p' returns nil. Suggested by Stefan Monnier
<monnier@iro.umontreal.ca>. (Bug#64927)
Diffstat (limited to 'src')
| -rw-r--r-- | src/keymap.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/keymap.c b/src/keymap.c index 7f5777c9251..41ca43d6a95 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -1065,8 +1065,12 @@ possibly_translate_key_sequence (Lisp_Object key, ptrdiff_t *length) | |||
| 1065 | xsignal2 (Qerror, | 1065 | xsignal2 (Qerror, |
| 1066 | build_string ("`key-valid-p' is not defined, so this syntax can't be used: %s"), | 1066 | build_string ("`key-valid-p' is not defined, so this syntax can't be used: %s"), |
| 1067 | key); | 1067 | key); |
| 1068 | /* If key-valid-p is unhappy about KEY, we return it as-is. | ||
| 1069 | This happens when menu items define as bindings strings that | ||
| 1070 | should be inserted into the buffer, not commands. See | ||
| 1071 | bug#64927, for example. */ | ||
| 1068 | if (NILP (call1 (Qkey_valid_p, AREF (key, 0)))) | 1072 | if (NILP (call1 (Qkey_valid_p, AREF (key, 0)))) |
| 1069 | xsignal2 (Qerror, build_string ("Invalid `key-parse' syntax: %S"), key); | 1073 | return key; |
| 1070 | key = call1 (Qkey_parse, AREF (key, 0)); | 1074 | key = call1 (Qkey_parse, AREF (key, 0)); |
| 1071 | *length = CHECK_VECTOR_OR_STRING (key); | 1075 | *length = CHECK_VECTOR_OR_STRING (key); |
| 1072 | if (*length == 0) | 1076 | if (*length == 0) |