Subject: Re: bug#64927: 30.0.50; kill-ring with no X

From: Eli Zaretskii <[email-masked]>
Date: Fri, 04 Aug 2023 09:38:32 +0300

> From: Colin Baxter <[email-masked]>
> Cc: Eli Zaretskii <[email-masked]>,  Stefan Monnier
>  <[email-masked]>,  [email-masked],  [email-masked]
> Date: Fri, 04 Aug 2023 07:14:07 +0100
> 
> >>>>> Bug reports for GNU Emacs, the Swiss army knife of text editors <Stefan> writes:
> 
>     > I suggest we do:
> 
>     >     diff --git a/src/keymap.c b/src/keymap.c index
>     > da2af98c2d6..eec3e884935 100644 --- a/src/keymap.c +++
>     > b/src/keymap.c @@ -1066,7 +1066,7 @@
>     > possibly_translate_key_sequence (Lisp_Object key, ptrdiff_t
>     > *length) build_string ("`key-valid-p' is not defined, so this
>     > syntax can't be used: %s"), key); 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)
> 
>     > With this change,
> 
>     >     (let ((map (make-sparse-keymap))) (define-key map ["he"]
>     > 'hello) map)
> 
>     > returns (keymap ("he" . hello)) as before, and emits a message:
> 
>     >     Key sequence contains invalid event he
> 
>     > whereas
> 
>     >     (let ((map (make-sparse-keymap))) (define-key map ["h e"]
>     > 'hello) map)
> 
>     > returns (keymap (104 keymap (101 . hello))).
> 
> I have applied this patch and it seems to work.
> 
> 1. In a test file select a region with mouse and save to kill-ring.
> 2. Select another region via C-<space> and save to kill-ring.
> 3. Paste both regions in another part of test file using mouse via
>    <F10> --> Edit --> Paste from kill-ring Menu
> 4. Success.

Thanks, I've now installed this on the emacs-29 branch, and I'm
closing this bug.