unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alex <agrambot@gmail.com>
To: 28658@debbugs.gnu.org
Subject: bug#28658: 27.0.50; [PATCH] double/triple clicking in xterm-mouse-mode doesn't respect mouse position
Date: Sat, 30 Sep 2017 21:56:58 -0600	[thread overview]
Message-ID: <87zi9bwmet.fsf@gmail.com> (raw)
In-Reply-To: <87r2unyh79.fsf@gmail.com> (Alex's message of "Sat, 30 Sep 2017 16:06:34 -0600")

[-- Attachment #1: Type: text/plain, Size: 348 bytes --]

I also found another issue, but it doesn't really warrant a new report.
If you double click right after entering xterm-mouse-mode, then you'll
see:

xterm-mouse-translate-1: Wrong type argument: number-or-marker-p, nil

This is because click-count isn't set to 1 when `xterm-mouse-last-click'
is first set in `xterm-mouse-event'.

Here's a patch:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: init click --]
[-- Type: text/x-diff, Size: 1147 bytes --]

From 6bc82587b2c7554e93b603d0c5835f287673a7c5 Mon Sep 17 00:00:00 2001
From: Alexander Gramiak <agrambot@gmail.com>
Date: Sat, 30 Sep 2017 21:38:10 -0600
Subject: [PATCH] Set xterm click count to 1 even with no last click

* lisp/xt-mouse.el (xterm-mouse-event): Move the check for the last
click so that click-count is initialized properly. (Bug#28658)
---
 lisp/xt-mouse.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el
index dc202e78f6..cbbeec82fa 100644
--- a/lisp/xt-mouse.el
+++ b/lisp/xt-mouse.el
@@ -290,8 +290,8 @@ xterm-mouse-event
                        (string-match "down-" last-name)
                        (equal name (replace-match "" t t last-name)))
               (xterm-mouse--set-click-count event click-count)))
-           ((not last-time) nil)
-           ((and (> double-click-time (* 1000 (- this-time last-time)))
+           ((and last-time
+                 (> double-click-time (* 1000 (- this-time last-time)))
                  (eq x last-x)
                  (eq y last-y)
                  (equal last-name (replace-match "" t t name)))
-- 
2.14.2


[-- Attachment #3: Type: text/plain, Size: 93 bytes --]


P.S. Why is the error prefixed by `xterm-mouse-translate-1' instead of
`xterm-mouse-event'?

  reply	other threads:[~2017-10-01  3:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-30 22:06 bug#28658: 27.0.50; [PATCH] double/triple clicking in xterm-mouse-mode doesn't respect mouse position Alex
2017-10-01  3:56 ` Alex [this message]
2017-10-01  8:23   ` martin rudalics
2017-10-01 18:30     ` Alex
2017-10-05 10:52       ` Eli Zaretskii
2017-10-05 10:52   ` Eli Zaretskii
2017-10-06  0:03     ` Alex
2017-10-06  7:44       ` Eli Zaretskii
2017-10-09  2:37         ` Alex
2017-10-09  7:11           ` Eli Zaretskii
2017-10-05 10:36 ` Eli Zaretskii
2017-10-06  0:14   ` Alex
2017-10-06  7:14     ` Eli Zaretskii
2017-10-07 21:57       ` Alex
2017-10-08  7:42         ` Eli Zaretskii
2017-10-08 23:44           ` Alex

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=87zi9bwmet.fsf@gmail.com \
    --to=agrambot@gmail.com \
    --cc=28658@debbugs.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).