>From 77590f427ba962f5efc3f07d2e4dcadb4ec1237d Mon Sep 17 00:00:00 2001 From: Alexander Gramiak Date: Sat, 30 Sep 2017 15:47:56 -0600 Subject: [PATCH] Increase xterm click count only with unchanged point * lisp/xt-mouse.el (xterm-mouse-event): Save the last click's position and check it against the current click's position. --- lisp/xt-mouse.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el index 772a72d5c5..dc202e78f6 100644 --- a/lisp/xt-mouse.el +++ b/lisp/xt-mouse.el @@ -278,6 +278,8 @@ xterm-mouse-event (last-name (symbol-name last-type)) (last-time (nth 1 last-click)) (click-count (nth 2 last-click)) + (last-x (nth 3 last-click)) + (last-y (nth 4 last-click)) (this-time (float-time)) (name (symbol-name type))) (cond @@ -290,12 +292,14 @@ xterm-mouse-event (xterm-mouse--set-click-count event click-count))) ((not last-time) nil) ((and (> double-click-time (* 1000 (- this-time last-time))) + (eq x last-x) + (eq y last-y) (equal last-name (replace-match "" t t name))) (setq click-count (1+ click-count)) (xterm-mouse--set-click-count event click-count)) (t (setq click-count 1))) (set-terminal-parameter nil 'xterm-mouse-last-click - (list type this-time click-count))) + (list type this-time click-count x y))) (set-terminal-parameter nil 'xterm-mouse-x x) (set-terminal-parameter nil 'xterm-mouse-y y) -- 2.14.1