From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jim Meyering Newsgroups: gmane.emacs.devel Subject: Friday regression: double-click no longer selects word Date: Sat, 29 Jan 2011 18:10:30 +0100 Message-ID: <87r5bv8wl5.fsf@meyering.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1296321045 31924 80.91.229.12 (29 Jan 2011 17:10:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 29 Jan 2011 17:10:45 +0000 (UTC) To: Emacs development discussions Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 29 18:10:41 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PjEJr-00025x-NV for ged-emacs-devel@m.gmane.org; Sat, 29 Jan 2011 18:10:39 +0100 Original-Received: from localhost ([127.0.0.1]:57081 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PjEJr-0004Q8-6p for ged-emacs-devel@m.gmane.org; Sat, 29 Jan 2011 12:10:39 -0500 Original-Received: from [140.186.70.92] (port=33486 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PjEJm-0004PA-QP for emacs-devel@gnu.org; Sat, 29 Jan 2011 12:10:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PjEJl-0007E2-FP for emacs-devel@gnu.org; Sat, 29 Jan 2011 12:10:34 -0500 Original-Received: from mx.meyering.net ([82.230.74.64]:58044) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PjEJl-0007Da-3x for emacs-devel@gnu.org; Sat, 29 Jan 2011 12:10:33 -0500 Original-Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id 6B8DF600A5; Sat, 29 Jan 2011 18:10:30 +0100 (CET) Original-Lines: 74 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 82.230.74.64 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:135219 Archived-At: I built with the latest from git and noticed that double clicking on a word no longer selects it. It was introduced by this commit: Fix text pos part of lispy positions for right fringe clicks (Bug#7839). * src/keyboard.c (make_lispy_position): For clicks on right fringe or margin, compute text position using the X coordinate relative to the left of the text area (Bug#7839). diff --git a/src/keyboard.c b/src/keyboard.c index 8ae6eb9..7a5185d 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -5153,8 +5153,12 @@ make_lispy_position (struct frame *f, Lisp_Object x,= Lisp_Object y, int width2, height2; /* The pixel X coordinate passed to buffer_posn_from_coords is the X coordinate relative to the text area for - text-area clicks, zero otherwise. */ - int x2 =3D (part =3D=3D ON_TEXT) ? xret : 0; + text-area and right-margin clicks, zero otherwise. */ + int x2 + =3D (part =3D=3D ON_TEXT) ? x2 + : (part =3D=3D ON_RIGHT_FRINGE || part =3D=3D ON_RIGHT_MARGIN) + ? (XINT (x) - window_box_left (w, TEXT_AREA)) + : 0; int y2 =3D wy; string2 =3D buffer_posn_from_coords (w, &x2, &y2, &p, ------------------------------------------------------------ Obviously, when defining "x2", we cannot use "x2", because it is undefined, so I presume the intent was to use "xret", as in the preceding revision. This patch solves my problem: >From 2526653b57ca7ea2137487c0d17bf649210238ff Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 29 Jan 2011 18:06:09 +0100 Subject: [PATCH] * keyboard.c (make_lispy_position): Correct typo in previo= us change. --- src/ChangeLog | 4 ++++ src/keyboard.c | 2 +- 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index b3df85d..8d244d3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2011-01-29 Jim Meyering + + * keyboard.c (make_lispy_position): Correct typo in previous change. + 2011-01-29 Jan Dj=E4rv * nsselect.m (ns_string_from_pasteboard): Get length of string diff --git a/src/keyboard.c b/src/keyboard.c index 7a5185d..3283fd4 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -5155,7 +5155,7 @@ make_lispy_position (struct frame *f, Lisp_Object x, = Lisp_Object y, is the X coordinate relative to the text area for text-area and right-margin clicks, zero otherwise. */ int x2 - =3D (part =3D=3D ON_TEXT) ? x2 + =3D (part =3D=3D ON_TEXT) ? xret : (part =3D=3D ON_RIGHT_FRINGE || part =3D=3D ON_RIGHT_MARGIN) ? (XINT (x) - window_box_left (w, TEXT_AREA)) : 0; -- 1.7.3.5.44.g960a