all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Aurélien Aptel" <aurelien.aptel+emacs@gmail.com>
To: Xah Lee <xahlee@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: emacs24/gtk3 - how to mark rectangle of to primary selection?
Date: Wed, 27 Jun 2012 19:15:20 +0200	[thread overview]
Message-ID: <CA+5B0FMQLdk+Hd4paGF--gPXuL9a6H3G5WYXUKG=xKz5eF-G2w@mail.gmail.com> (raw)
In-Reply-To: <e05e386e-36ee-4ab0-bdc2-1cf18aa9ab72@po9g2000pbb.googlegroups.com>

Well, it was longer than expected... Turns out if you don't deactive
the mark, emacs copies the regular active region. My guess is it
corresponds to mouse selection: once a region is selected it is copied
to the primary selection.

(defun my-copy-rect-to-primary ()
  (interactive)
  (when (region-active-p)
    (let ((text (mapconcat 'identity
                           (extract-rectangle
                            (region-beginning)
                            (region-end)) "\n")))
      (deactivate-mark) ;; lost 30mn because of this
      (x-set-selection 'PRIMARY text)
      (message "%s" text))))



  reply	other threads:[~2012-06-27 17:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-26 14:24 emacs24/gtk3 - how to mark rectangle of to primary selection? Paul K
2012-06-26 14:52 ` Peter Dyballa
2012-06-26 18:29 ` Jonathan Groll
2012-06-26 20:33   ` Paul K
2012-06-26 20:44     ` Peter Dyballa
2012-06-26 20:58       ` Paul K
2012-06-26 21:19         ` suvayu ali
2012-06-27  6:58           ` Yuri Khan
     [not found]   ` <mailman.3529.1340742812.855.help-gnu-emacs@gnu.org>
2012-06-27 11:47     ` Xah Lee
2012-06-27 17:15       ` Aurélien Aptel [this message]
2012-06-27 18:41         ` Andreas Röhler
     [not found]       ` <mailman.3573.1340817336.855.help-gnu-emacs@gnu.org>
2012-06-29 16:38         ` Xah Lee

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

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

  git send-email \
    --in-reply-to='CA+5B0FMQLdk+Hd4paGF--gPXuL9a6H3G5WYXUKG=xKz5eF-G2w@mail.gmail.com' \
    --to=aurelien.aptel+emacs@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=xahlee@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.