summaryrefslogtreecommitdiff
path: root/lisp/xt-mouse.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2014-06-21 12:45:59 -0700
committerGlenn Morris <rgm@gnu.org>2014-06-21 12:45:59 -0700
commitc400516ab1d827d08225ffb3e1bc1969c73cc45e (patch)
treeb16343b9e11c916c96b12ab56b6024cad91d3aff /lisp/xt-mouse.el
parent539ad293eb36b4cf458cbdb5a6b37f5cd1bb68a1 (diff)
parent8047f439ec7d0bbe0085800a13bee8da883ae4dd (diff)
downloademacs-c400516ab1d827d08225ffb3e1bc1969c73cc45e.tar.gz
Merge from emacs-24; up to 2014-06-06T02:22:40Z!monnier@iro.umontreal.ca
Diffstat (limited to 'lisp/xt-mouse.el')
-rw-r--r--lisp/xt-mouse.el33
1 files changed, 16 insertions, 17 deletions
diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el
index 54fd1a44d5b..f9e89880dae 100644
--- a/lisp/xt-mouse.el
+++ b/lisp/xt-mouse.el
@@ -145,26 +145,25 @@ 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))
- (format "M-down-mouse-%d" (- code 7)))
- ((memq code '(3 11))
- (let ((down (car (terminal-parameter
- nil 'xterm-mouse-last-down))))
- (when (and down (string-match "[0-9]" (symbol-name down)))
- (format (if (eq code 3) "mouse-%s" "M-mouse-%s")
- (match-string 0 (symbol-name down))))))
- ((memq code '(0 1 2))
- (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))
+ (format "M-down-mouse-%d" (- code 7)))
+ ((memq code '(3 11))
+ (let ((down (car (terminal-parameter
+ nil 'xterm-mouse-last-down))))
+ (when (and down (string-match "[0-9]" (symbol-name down)))
+ (format (if (eq code 3) "mouse-%s" "M-mouse-%s")
+ (match-string 0 (symbol-name down))))))
+ ((memq code '(0 1 2))
+ (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