emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Friday regression: double-click no longer selects word


From: Jim Meyering
Subject: Friday regression: double-click no longer selects word
Date: Sat, 29 Jan 2011 18:10:30 +0100

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 = (part == ON_TEXT) ? xret : 0;
+            text-area and right-margin clicks, zero otherwise.  */
+         int x2
+           = (part == ON_TEXT) ? x2
+           : (part == ON_RIGHT_FRINGE || part == ON_RIGHT_MARGIN)
+           ? (XINT (x) - window_box_left (w, TEXT_AREA))
+           : 0;
          int y2 = wy;

          string2 = 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 <address@hidden>
Date: Sat, 29 Jan 2011 18:06:09 +0100
Subject: [PATCH] * keyboard.c (make_lispy_position): Correct typo in previous 
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  <address@hidden>
+
+       * keyboard.c (make_lispy_position): Correct typo in previous change.
+
 2011-01-29  Jan Djärv  <address@hidden>

        * 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
-           = (part == ON_TEXT) ? x2
+           = (part == ON_TEXT) ? xret
            : (part == ON_RIGHT_FRINGE || part == ON_RIGHT_MARGIN)
            ? (XINT (x) - window_box_left (w, TEXT_AREA))
            : 0;
--
1.7.3.5.44.g960a



reply via email to

[Prev in Thread] Current Thread [Next in Thread]