Subject: Re: bug#6774: Cut and paste with C-w/mouse-2 not working?

From: David De La Harpe Golden <[email-masked]>
Date: Tue, 03 Aug 2010 16:15:02 +0100

On 03/08/10 15:34, Miles Bader wrote:
> So while y'all are screwing around with this, is there a simple way I
> can get back the original behavior?
>

Yes, four boolean customizations and a rebinding (or just five boolean 
customizations on my experimental branch)

** group killing:

;; stop emacs using the clipboard for C-w/M-w/C-y

x-select-enable-clipboard => nil

;; make emacs use primary for C-w/M-w/C-y

x-select-enable-primary => t

;; stop emacs sending both keyboard and mouse selections to primary
;; (and right now sometimes failing at it)

select-active-regions => nil

** group mouse:

;; make emacs treat the end of a mouse drag selection as an M-w.

mouse-drag-copy-region => t

** rebind:

;; make emacs treat mouse middle button as a C-y operation.
;; rather than a primary-insertion-only operation.

(global-set-key [mouse-2] 'mouse-yank-at-click)

N.B. On the "selx" experimental branch, don't rebind mouse-2, do instead:

mouse-yank-selection-only => nil

[IMO such a boolean customisation is neater than requiring a rebind to 
revert for reasons outlined on emacs-devel last week]