From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Aur=C3=A9lien_Aptel?= Newsgroups: gmane.emacs.help Subject: Re: emacs24/gtk3 - how to mark rectangle of to primary selection? Date: Wed, 27 Jun 2012 19:15:20 +0200 Message-ID: References: <87sjdi3p0y.wl%lists@groll.co.za> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1340817347 30611 80.91.229.3 (27 Jun 2012 17:15:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 27 Jun 2012 17:15:47 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Xah Lee Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 27 19:15:46 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 1Sjvq7-0000hW-VW for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Jun 2012 19:15:40 +0200 Original-Received: from localhost ([::1]:45483 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sjvq7-0004Mb-Q6 for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Jun 2012 13:15:39 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sjvpx-0004MP-Gx for help-gnu-emacs@gnu.org; Wed, 27 Jun 2012 13:15:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sjvpr-0002eh-34 for help-gnu-emacs@gnu.org; Wed, 27 Jun 2012 13:15:29 -0400 Original-Received: from mail-ob0-f169.google.com ([209.85.214.169]:52823) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sjvpq-0002bB-Re for help-gnu-emacs@gnu.org; Wed, 27 Jun 2012 13:15:23 -0400 Original-Received: by obhx4 with SMTP id x4so2174036obh.0 for ; Wed, 27 Jun 2012 10:15:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=TKhfcF/Bvcj8jaDDSEBPxO3EIn3DlCfAaRpEbI4T7IQ=; b=MtjeiMNMjRUomFN557fmqV0yxyQrAjsQvIyTUFkFVq0T21ZhN9HPW5PNBZCg8s0TfO 8u4Ahy57zmdyLk1mdr4ph89caK/XQyFmgeJHL4oyaXL3ftnaXdaTYtDqlef+pjonaizt Yg3kKqRSnlUHZcpZU0kQaUYANl9WSmvIVMlB8O/hqkiDKqkcNPVlXn8a59OW+49tNYXO 6EjPHC0hePUWsOpBA3xYwPTFeb1/oSwndBv7WMxELdfJy/sn8vUyRK0uPaFwtBVUMjd3 V9p+siggSa9xH4Civly5+UfkhmlCQbDqdq0ecBefNA+qw2waUPl9iXCqYMVT9ehA9WsF D+Xg== Original-Received: by 10.182.216.99 with SMTP id op3mr10755966obc.30.1340817320871; Wed, 27 Jun 2012 10:15:20 -0700 (PDT) Original-Received: by 10.182.241.7 with HTTP; Wed, 27 Jun 2012 10:15:20 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: 8jkRpJYduPU6OAE0tDt0a7bp020 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.214.169 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:85527 Archived-At: 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))))