emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

yank-secondary


From: Drew Adams
Subject: yank-secondary
Date: Wed, 30 Jan 2008 13:41:29 -0800

Any interest in adding something like this? I've used it for years. Hard to
believe it isn't already in Emacs (or is it?). (What do those of you who are
sans souris use?)

(defun yank-secondary ()
  "Insert the secondary selection at point.
Moves point to the end of the inserted text.  Does not change mark."
  (interactive)
  (let ((secondary (x-get-selection 'SECONDARY)))
    (unless secondary (error "No secondary selection"))
    (insert secondary)))

I bind it to `C-M-y', so I can access two different selections from the
keyboard.

(FWIW, I also bind the meta mouse stuff to `C-M-', so mouse-yank-secondary
and yank-secondary use the same modifiers. I've done that since I had an SGI
workstation that wouldn't pass ALT-mouse stuff to Emacs. So, e.g., I have
`C-M-y' = yank-secondary, `C-M-mouse2' = mouse-yank-secondary, `C-M-mouse-1'
= mouse-start-secondary, `C-M-mouse-3' = mouse-secondary-save-then-kill,
`C-M-drag-mouse-1' = mouse-set-secondary, and `C-M-down-mouse-1' =
mouse-drag-secondary.)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]