Subject: bug#32747: 26; `C-M-w M-w' with non-nil `mouse-drag-copy-region', if selected with mouse

From: Drew Adams <[email-masked]>
Date: Sun, 16 Sep 2018 14:29:25 -0700 (PDT)

This is a regression that was apparently introduced in Emacs 24.  Things

work properly (as documented and as expected) in Emacs 23.4 and prior,

but not in Emacs 24.5 or later.

1. emacs -Q

2. (setq mouse-drag-copy-region t) ; Mouse selection copies to kill-ring.

3. In *scratch*, select some text, e.g. "This buffer".

4. Use `M-w' to copy the selected text to the kill ring.

5. With the mouse, select some other text, e.g. "visit that file".

6. Use `C-M-w M-w', to append the second selection to the first as the

   last kill.  The kill should thus be "This buffervisit that file".

7. `C-y' to yank the last kill.

The text yanked should be "This buffervisit that file".  Instead, it is

"visit that filevisit that file".  That is, the second selection is

added to the kill ring and appended to itself.

It makes no difference how the first selection (step #3) is made: with

the mouse or not.  It should also not make a difference how the second

selection (#5) is made.  And there certainly is no use case for doubling

the text from the second selection (#5) for the yank.

In GNU Emacs 26.1 (build 1, x86_64-w64-mingw32)

of 2018-05-30

Repository revision: 07f8f9bc5a51f5aa94eb099f3e15fbe0c20ea1ea

Windowing system distributor `Microsoft Corp.', version 10.0.16299

Configured using:

`configure --without-dbus --host=x86_64-w64-mingw32

--without-compress-install 'CFLAGS=-O2 -static -g3''