unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Jim Meyering <jim@meyering.net>
To: Emacs development discussions <emacs-devel@gnu.org>
Subject: Friday regression: double-click no longer selects word
Date: Sat, 29 Jan 2011 18:10:30 +0100	[thread overview]
Message-ID: <87r5bv8wl5.fsf@meyering.net> (raw)

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 <meyering@redhat.com>
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  <meyering@redhat.com>
+
+	* keyboard.c (make_lispy_position): Correct typo in previous change.
+
 2011-01-29  Jan Djärv  <jan.h.d@swipnet.se>

 	* 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	other threads:[~2011-01-29 17:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-29 17:10 Jim Meyering [this message]
2011-01-29 18:21 ` Friday regression: double-click no longer selects word Eli Zaretskii
2011-01-30 16:06   ` Jim Meyering
2011-01-30 17:48     ` Eli Zaretskii
2011-01-30 18:11       ` Thierry Volpiatto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r5bv8wl5.fsf@meyering.net \
    --to=jim@meyering.net \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).