From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: help-gnu-emacs@gnu.org
Subject: Re: emacs24/gtk3 - how to mark rectangle of to primary selection?
Date: Wed, 27 Jun 2012 20:41:45 +0200 [thread overview]
Message-ID: <4FEB53E9.5010501@easy-emacs.de> (raw)
In-Reply-To: <CA+5B0FMQLdk+Hd4paGF--gPXuL9a6H3G5WYXUKG=xKz5eF-G2w@mail.gmail.com>
Am 27.06.2012 19:15, schrieb Aurélien Aptel:
> 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))))
>
>
Thanks!
It might pay to name it "-rectangle-" instead of "-rect-", as the latter is also part of "directory" for example,
which might inflate the output of M-x apropos NAME
Cheers,
Andreas
next prev parent reply other threads:[~2012-06-27 18:41 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
2012-06-27 18:41 ` Andreas Röhler [this message]
[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=4FEB53E9.5010501@easy-emacs.de \
--to=andreas.roehler@easy-emacs.de \
--cc=help-gnu-emacs@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 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.