summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2023-08-04 09:34:55 +0300
committerEli Zaretskii <eliz@gnu.org>2023-08-04 09:36:45 +0300
commitacfcf7f3690630344b090b4af6afa4d02d0147a3 (patch)
treeaa09d996a0bc2add39c5a78f8ab3eeed070a6263 /src
parent04996b21241468979ac7f8b4a80563186bee9fad (diff)
downloademacs-acfcf7f3690630344b090b4af6afa4d02d0147a3.tar.gz
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.c6
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)
xsignal2 (Qerror,
build_string ("`key-valid-p' is not defined, so this syntax can't be used: %s"),
key);
+ /* If key-valid-p is unhappy about KEY, we return it as-is.
+ This happens when menu items define as bindings strings that
+ should be inserted into the buffer, not commands. See
+ bug#64927, for example. */
if (NILP (call1 (Qkey_valid_p, AREF (key, 0))))
- xsignal2 (Qerror, build_string ("Invalid `key-parse' syntax: %S"), key);
+ return key;
key = call1 (Qkey_parse, AREF (key, 0));
*length = CHECK_VECTOR_OR_STRING (key);
if (*length == 0)