aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2014-06-18 18:02:15 -0400
committerStefan Monnier2014-06-18 18:02:15 -0400
commitbc2fb4fdad8cc54a7fe47bd76580959697219846 (patch)
treee588267229a4dd7c44ab9182c548ac842043da4d
parente776a63014abedb2893e89f0abcc87922fe5dcf8 (diff)
downloademacs-bc2fb4fdad8cc54a7fe47bd76580959697219846.tar.gz
emacs-bc2fb4fdad8cc54a7fe47bd76580959697219846.zip
* lisp/xt-mouse.el (xterm-mouse-translate-1): Fix last change.
(xterm-mouse--read-event-sequence-1000): Drop unknown events instead of burping. Fixes: debbugs:17776
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/xt-mouse.el39
2 files changed, 25 insertions, 20 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 03cf468a315..d7ca5f0dd88 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12014-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * xt-mouse.el (xterm-mouse-translate-1): Fix last change (bug#17776).
4 (xterm-mouse--read-event-sequence-1000): Drop unknown events instead of
5 burping.
6
12014-06-18 Eli Zaretskii <eliz@gnu.org> 72014-06-18 Eli Zaretskii <eliz@gnu.org>
2 8
3 * term/w32-win.el (dynamic-library-alist): Support giflib 5.1.0 9 * term/w32-win.el (dynamic-library-alist): Support giflib 5.1.0
diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el
index 5b34612c2e7..59ed68a60c7 100644
--- a/lisp/xt-mouse.el
+++ b/lisp/xt-mouse.el
@@ -76,7 +76,7 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)."
76 (is-down (string-match "down" (symbol-name (car down))))) 76 (is-down (string-match "down" (symbol-name (car down)))))
77 77
78 ;; Retrieve the expected preface for the up-event. 78 ;; Retrieve the expected preface for the up-event.
79 (unless is-down 79 (when is-down
80 (unless (cond ((null extension) 80 (unless (cond ((null extension)
81 (and (eq (read-event) ?\e) 81 (and (eq (read-event) ?\e)
82 (eq (read-event) ?\[) 82 (eq (read-event) ?\[)
@@ -158,28 +158,27 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)."
158(defun xterm-mouse--read-event-sequence-1000 () 158(defun xterm-mouse--read-event-sequence-1000 ()
159 (let* ((code (- (read-event) 32)) 159 (let* ((code (- (read-event) 32))
160 (type 160 (type
161 (intern 161 ;; For buttons > 3, the release-event looks differently
162 ;; For buttons > 3, the release-event looks differently 162 ;; (see xc/programs/xterm/button.c, function EditorButton),
163 ;; (see xc/programs/xterm/button.c, function EditorButton), 163 ;; and come in a release-event only, no down-event.
164 ;; and come in a release-event only, no down-event. 164 (cond ((>= code 64)
165 (cond ((>= code 64) 165 (format "mouse-%d" (- code 60)))
166 (format "mouse-%d" (- code 60))) 166 ((memq code '(8 9 10))
167 ((memq code '(8 9 10)) 167 (setq xterm-mouse-last (- code 8))
168 (setq xterm-mouse-last (- code 8)) 168 (format "M-down-mouse-%d" (- code 7)))
169 (format "M-down-mouse-%d" (- code 7))) 169 ((and (= code 11) xterm-mouse-last)
170 ((and (= code 11) xterm-mouse-last) 170 (format "M-mouse-%d" (1+ xterm-mouse-last)))
171 (format "M-mouse-%d" (1+ xterm-mouse-last))) 171 ((and (= code 3) xterm-mouse-last)
172 ((and (= code 3) xterm-mouse-last) 172 ;; For buttons > 5 xterm only reports a button-release event.
173 ;; For buttons > 5 xterm only reports a button-release event. 173 ;; Drop them since they're not usable and can be spurious.
174 ;; Drop them since they're not usable and can be spurious. 174 (format "mouse-%d" (1+ xterm-mouse-last)))
175 (format "mouse-%d" (1+ xterm-mouse-last))) 175 ((memq code '(0 1 2))
176 ((memq code '(0 1 2)) 176 (setq xterm-mouse-last code)
177 (setq xterm-mouse-last code) 177 (format "down-mouse-%d" (+ 1 code)))))
178 (format "down-mouse-%d" (+ 1 code))))))
179 (x (- (read-event) 33)) 178 (x (- (read-event) 33))
180 (y (- (read-event) 33))) 179 (y (- (read-event) 33)))
181 (and type (wholenump x) (wholenump y) 180 (and type (wholenump x) (wholenump y)
182 (list type x y)))) 181 (list (intern type) x y))))
183 182
184;; XTerm's 1006-mode terminal mouse click reporting has the form 183;; XTerm's 1006-mode terminal mouse click reporting has the form
185;; <BUTTON> ; <X> ; <Y> <M or m>, where the button and ordinates are 184;; <BUTTON> ; <X> ; <Y> <M or m>, where the button and ordinates are