unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "Emacs-Devel" <emacs-devel@gnu.org>
Subject: yank-secondary
Date: Wed, 30 Jan 2008 13:41:29 -0800	[thread overview]
Message-ID: <003c01c86388$df89c7f0$9eb22382@us.oracle.com> (raw)

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	other threads:[~2008-01-30 21:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-30 21:41 Drew Adams [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-03-11 18:59 FW: yank-secondary Drew Adams
2008-05-04 23:15 ` yank-secondary Drew Adams
2008-05-06 15:54   ` yank-secondary Drew Adams
2008-05-07  1:55     ` yank-secondary Stefan Monnier
2008-05-07  2:40       ` yank-secondary Drew Adams
2008-05-07  3:15         ` yank-secondary Stefan Monnier
2008-05-07  6:27           ` yank-secondary Drew Adams
2008-05-07 15:01             ` yank-secondary Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='003c01c86388$df89c7f0$9eb22382@us.oracle.com' \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).