Emacs 24 changed the way copy/paste behavior works to conform with modern X applications (See this article under "Selection changes"). They have explicitly separated primary selection and middle mouse button paste from clipboard copy/paste.
Unfortunately for me, using native (not cygwin!) Emacs 24.2.1 under MS Windows, this messes up the way I want to work.
Here is what I want:
To summarize, I think this means removing the distinction between primary selections and the clipboard in Emacs. I want everything to act on the clipboard!
Kill (Cut), Copy, and Yank (Paste) Commands in Emacs To cut, or kill, the text, you can use the keys Ctrl + k to kill a particular line, or the Ctrl + w command to kill the entire selected region. To paste, or yank, the text, press the keys Ctrl + y. This pastes the last killed item from the kill ring.
To cut the text, press C-w . To copy the text, press M-w . To paste the text, press C-y .
The following entries from NEWS seem pertinent:
mouse-drag-copy-region
now defaults to nil.
mouse-2 is now bound to mouse-yank-primary
.
This pastes from the primary selection, ignoring the kill-ring.
Previously, mouse-2 was bound to mouse-yank-at-click
.
To return to the previous behavior, do the following:
select-active-regions
to nil.mouse-drag-copy-region
to t.x-select-enable-primary
to t (on X only).x-select-enable-clipboard
to nil.mouse-yank-at-click
to mouse-2.I think to get the previous behaviour on Windows, you need to leave both x-select-enable-primary
and x-select-enable-clipboard
at their current values, and maybe select-active-regions
is not related to the change in behaviour you are complaining about here.
Here are the exact lines to put in your .emacs file:
(setq select-active-regions nil)
(setq mouse-drag-copy-region t)
(global-set-key [mouse-2] 'mouse-yank-at-click)
It seems dragging mouse does not do anything with the clipboard. The following adds that, but I don't know what it does to point and mark:
(defadvice mouse-drag-region (after copy-to-clipboard activate)
(clipboard-kill-ring-save (region-beginning) (region-end))
(goto-char st) (push-mark nd nil t)
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With