From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?B?QW5kcmVhcyBSw7ZobGVy?= Newsgroups: gmane.emacs.help Subject: Re: emacs24/gtk3 - how to mark rectangle of to primary selection? Date: Wed, 27 Jun 2012 20:41:45 +0200 Message-ID: <4FEB53E9.5010501@easy-emacs.de> References: <87sjdi3p0y.wl%lists@groll.co.za> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1340822527 9569 80.91.229.3 (27 Jun 2012 18:42:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 27 Jun 2012 18:42:07 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 27 20:42:07 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SjxBn-0007sE-04 for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Jun 2012 20:42:07 +0200 Original-Received: from localhost ([::1]:56865 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SjxBm-0006M8-MF for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Jun 2012 14:42:06 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:45570) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SjxBd-0006Ln-Tn for help-gnu-emacs@gnu.org; Wed, 27 Jun 2012 14:42:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SjxBZ-000334-3z for help-gnu-emacs@gnu.org; Wed, 27 Jun 2012 14:41:57 -0400 Original-Received: from moutng.kundenserver.de ([212.227.17.10]:55715) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SjxBY-00031t-Qh for help-gnu-emacs@gnu.org; Wed, 27 Jun 2012 14:41:53 -0400 Original-Received: from [192.168.178.27] (brln-4db9a5b5.pool.mediaWays.net [77.185.165.181]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0MRSY4-1SHKTM3p72-00SiEL; Wed, 27 Jun 2012 20:41:50 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120601 Thunderbird/13.0 In-Reply-To: X-Provags-ID: V02:K0:4RSLPfZ45KvzCDKnHNzDGgTCa6J5mnyc/MbqfBCrZeQ zaFbJBLp19eMqTWKQ5K2WwLri7srJ1fYKg69w5TboYamd9FbqR pLrua0D5007pic/thtWxFmMN7fZjDrtHkpzOFcyB+7C6IsiqWG jJwdc8AzUVmgwshYlNkLIrS4xwhAHRHSqHfqSNLy2OBT+a/HvJ 2b/qNA0SNgQDKMW8fLOmFAbdIYqB4vuAaCdWxd1qixSf4HVEe/ GhZOHcfHiVtwfpogvxoep53P+BaMDF6Xdw2cqi2S/yZpvM6ZX1 nENVzaYydW4BuO2mmBH9EePVsJpWuG/gASyo67AXq0RoFpQyKF pFj9nTOmnVgDklbqiArLiAaqu5U3dlEtZhGf5utP2 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.227.17.10 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:85529 Archived-At: 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