Thursday, October 12, 2006

middle-click selected text into Emacs

Since my conversion 18 months ago, I've been delaying my quest to find the solution for middle-clicking and getting my text from terminal into Emacs. After some chat in Freenode (thanks to twb)and looking in Google Groups, here's the solution I slapped into my .emacs:

(global-set-key (kbd "") (lambda () (interactive) (insert (x-get-selection 'PRIMARY 'COMPOUND_TEXT))))

The problem was this line:

(setq x-select-enable-clipboard t)

changed it to:

(setq x-select-enable-clipboard nil)

and now I can paste in from mrxvt, xterm, etc.

No comments: