From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ernest =?iso-8859-1?Q?Adrogu=E9?= Newsgroups: gmane.emacs.help Subject: Re: select text without moving the point in graphical interface Date: Tue, 10 Dec 2013 19:58:55 +0100 Message-ID: <20131210185855.GA32729@doriath.local> References: <20131208190052.GA12293@doriath.local> <87zjobdoh9.fsf@web.de> <20131208225829.GA13146@doriath.local> <877gbdesh1.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1386701974 8888 80.91.229.3 (10 Dec 2013 18:59:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 10 Dec 2013 18:59:34 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Dec 10 19:59:39 2013 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 1VqSWw-0001K2-MK for geh-help-gnu-emacs@m.gmane.org; Tue, 10 Dec 2013 19:59:38 +0100 Original-Received: from localhost ([::1]:50921 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqSWw-0007Qz-DZ for geh-help-gnu-emacs@m.gmane.org; Tue, 10 Dec 2013 13:59:38 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56512) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqSWd-0007E4-Lo for help-gnu-emacs@gnu.org; Tue, 10 Dec 2013 13:59:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VqSWV-0003NS-9G for help-gnu-emacs@gnu.org; Tue, 10 Dec 2013 13:59:19 -0500 Original-Received: from mail-wg0-x22f.google.com ([2a00:1450:400c:c00::22f]:37495) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqSWV-0003NL-2Y for help-gnu-emacs@gnu.org; Tue, 10 Dec 2013 13:59:11 -0500 Original-Received: by mail-wg0-f47.google.com with SMTP id n12so5419159wgh.14 for ; Tue, 10 Dec 2013 10:59:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=nk+YPeCpz1XrjnZ3O5R0vklxIVmaO/fsmJHsA6ZeGWY=; b=scP5lk3JhlevD82PkJdHcTTtRnC4hyyeT/+H8cntJSQpYaFyaNCrdVRdGQEQ+KqWYQ n9v8cpqaBlvc5vdxRngFm6jvCEeNSwNhRj7GqeGaM2f/iBmy9B4Ja8CME/u89mm4NJjH +AJIrmVgpq5oIizwvM1t3WM7PIueRDON8hWyjtzGjWgas8buqnYlfzQ/RoUTtVyy8+76 pz3eHGMchoxDT75/y7V++Ll+sMQ1CJp13rJYMnovcxqI/IUe8m7LvYvIsLTQehUXMzDx h5TzUAWvuZY4hthaevYoL6SA2h5h0wQWqKrcbyGDSbVlw524ur4e6jVuFRtIEEElz//t Mc5w== X-Received: by 10.180.39.140 with SMTP id p12mr21135826wik.12.1386701949417; Tue, 10 Dec 2013 10:59:09 -0800 (PST) Original-Received: from doriath (3.Red-83-40-95.dynamicIP.rima-tde.net. [83.40.95.3]) by mx.google.com with ESMTPSA id f11sm7621085wic.4.2013.12.10.10.59.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Dec 2013 10:59:07 -0800 (PST) Mail-Followup-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <877gbdesh1.fsf@web.de> X-Operating-System: GNU/Linux (Debian jessie/sid) User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::22f 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:94929 Archived-At: Hi, 9-12-2013, 20:26 (+0100); Michael Heerdegen escriu: > Ernest Adrogu=E9 writes: >=20 > > > (info "(emacs) Secondary Selection") > > > > Yeah, this is exactly it. Now I guess the question is can I have the > > secondary selection text selection style but using the primary selection > > instead? >=20 > It's not intended to do so, I'm afraid; using the secondary selection is > hardcoded for that stuff. >=20 > Mmh, maybe we should try to modify the default mouse-1 behavior > instead. Can you try the following: >=20 > --8<---------------cut here---------------start------------->8--- > (defun mouse-drag-region-restore-point-advice (f e) > (let ((opoint (with-selected-window > (posn-window (event-start e)) > (point)))) > (prog1 (funcall f e) > (run-with-idle-timer > 0 nil > (lambda (win pos) > (with-selected-window win > (deactivate-mark) > (goto-char pos))) > (selected-window) opoint)))) >=20 > (advice-add 'mouse-drag-region > :around #'mouse-drag-region-restore-point-advice) > --8<---------------cut here---------------end--------------->8--- >=20 > Does that behave as you want it to? I can't get this to work, because I don't have this `advice-add` function in my Emacs (I currently use version 24.3.1). As I'm not familiar with advices, I redefined `mouse-drag-region` with your function instead, but this doesn't work either. When I left-click I get: "Wrong type of argument: commandp, mouse-drag-region"