GNU bug report logs -
#17211
Empty items show up in kill-ring if mouse-drag-copy-region is used
Previous Next
Reported by: Richard Smith <rsmithnews <at> gmail.com>
Date: Sun, 6 Apr 2014 23:58:02 UTC
Severity: normal
Tags: moreinfo
Fixed in version 29.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Emacs version: 24.3.1
Platform: Windows 7, confirmed in Linux
Problem:
Windows users who set up Emacs to cut/paste from the kill-ring get empty
paste results.
Details:
Windows users who are having difficulty with cut/paste behavior are often
advised to do the following:
(setq select-active-regions nil)
(setq mouse-drag-copy-region t)
(global-set-key [mouse-2] 'mouse-yank-at-click)
But if, in the process of pasting text, you click, then drag the mouse even
a few pixels, this causes an empty string to go into the kill-ring, so a
subsequent paste inserts nothing, but an examination of the kill-ring
indicates the desired paste value has been pushed down by the empty string.
Steps to reproduce:
1. Enter lisp-interaction mode.
2. Set up the "normal behavior" by executing this form:
(progn
(setq select-active-regions t)
(setq mouse-drag-copy-region nil)
(global-set-key [mouse-2] 'mouse-yank-primary))
3. Select some text buy dragging mouse-1 over it.
4. Move to a different area in the buffer and set point with down-mouse-1,
but move the mouse a few pixels so you see the "Mark Set" message.
5. Paste the text with down-mouse-2.
6. Observe the correct behavior (text gets pasted).
7. Now, set up the "modified behavior" by executing this form:
(progn
(setq select-active-regions nil)
(setq mouse-drag-copy-region t)
(global-set-key [mouse-2] 'mouse-yank-at-click))
8. Repeat steps 3 thru 5.
9. Observe that nothing is pasted.
10. Execute the following form to "fix" the problem:
(progn
(setq kill-ring (remove "" kill-ring))
(setq kill-ring-yank-pointer kill-ring))
11. Do the mouse-2 paste again, observe that it worked this time.
[Message part 2 (text/html, inline)]
This bug report was last modified 3 years and 43 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.