]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/xt-mouse.el (xterm-mouse-translate-1): Fix last change.
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 18 Jun 2014 22:02:15 +0000 (18:02 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 18 Jun 2014 22:02:15 +0000 (18:02 -0400)
(xterm-mouse--read-event-sequence-1000): Drop unknown events instead of
burping.

Fixes: debbugs:17776
lisp/ChangeLog
lisp/xt-mouse.el

index 03cf468a315e4ec48af328576ee9ad25d4070c7a..d7ca5f0dd881a19d66b4154c352852699f9f5c8f 100644 (file)
@@ -1,3 +1,9 @@
+2014-06-18  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * xt-mouse.el (xterm-mouse-translate-1): Fix last change (bug#17776).
+       (xterm-mouse--read-event-sequence-1000): Drop unknown events instead of
+       burping.
+
 2014-06-18  Eli Zaretskii  <eliz@gnu.org>
 
        * term/w32-win.el (dynamic-library-alist): Support giflib 5.1.0
index 5b34612c2e730b274aff14e28dc4ad6648eefefc..59ed68a60c738ff36f3b8b48f46297263844c61b 100644 (file)
@@ -76,7 +76,7 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)."
             (is-down (string-match "down" (symbol-name (car down)))))
 
        ;; Retrieve the expected preface for the up-event.
-       (unless is-down
+       (when is-down
          (unless (cond ((null extension)
                         (and (eq (read-event) ?\e)
                              (eq (read-event) ?\[)
@@ -158,28 +158,27 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)."
 (defun xterm-mouse--read-event-sequence-1000 ()
   (let* ((code (- (read-event) 32))
          (type
-         (intern
-          ;; For buttons > 3, the release-event looks differently
-          ;; (see xc/programs/xterm/button.c, function EditorButton),
-          ;; and come in a release-event only, no down-event.
-          (cond ((>= code 64)
-                 (format "mouse-%d" (- code 60)))
-                ((memq code '(8 9 10))
-                 (setq xterm-mouse-last (- code 8))
-                 (format "M-down-mouse-%d" (- code 7)))
-                ((and (= code 11) xterm-mouse-last)
-                 (format "M-mouse-%d" (1+ xterm-mouse-last)))
-                ((and (= code 3) xterm-mouse-last)
-                 ;; For buttons > 5 xterm only reports a button-release event.
-                 ;; Drop them since they're not usable and can be spurious.
-                 (format "mouse-%d" (1+ xterm-mouse-last)))
-                ((memq code '(0 1 2))
-                 (setq xterm-mouse-last code)
-                 (format "down-mouse-%d" (+ 1 code))))))
+          ;; For buttons > 3, the release-event looks differently
+          ;; (see xc/programs/xterm/button.c, function EditorButton),
+          ;; and come in a release-event only, no down-event.
+          (cond ((>= code 64)
+                 (format "mouse-%d" (- code 60)))
+                ((memq code '(8 9 10))
+                 (setq xterm-mouse-last (- code 8))
+                 (format "M-down-mouse-%d" (- code 7)))
+                ((and (= code 11) xterm-mouse-last)
+                 (format "M-mouse-%d" (1+ xterm-mouse-last)))
+                ((and (= code 3) xterm-mouse-last)
+                 ;; For buttons > 5 xterm only reports a button-release event.
+                 ;; Drop them since they're not usable and can be spurious.
+                 (format "mouse-%d" (1+ xterm-mouse-last)))
+                ((memq code '(0 1 2))
+                 (setq xterm-mouse-last code)
+                 (format "down-mouse-%d" (+ 1 code)))))
          (x (- (read-event) 33))
          (y (- (read-event) 33)))
     (and type (wholenump x) (wholenump y)
-         (list type x y))))
+         (list (intern type) x y))))
 
 ;; XTerm's 1006-mode terminal mouse click reporting has the form
 ;; <BUTTON> ; <X> ; <Y> <M or m>, where the button and ordinates are