Subject: Re: bug#28658: 27.0.50; [PATCH] double/triple clicking in xterm-mouse-mode doesn't respect mouse position

From: Alex <[email-masked]>
Date: Sat, 30 Sep 2017 21:56:58 -0600

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:

>From 6bc82587b2c7554e93b603d0c5835f287673a7c5 Mon Sep 17 00:00:00 2001
From: Alexander Gramiak <[email-masked]>
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

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