diff options
| author | Stefan Monnier | 2014-05-05 19:50:20 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2014-05-05 19:50:20 -0400 |
| commit | c22f24f6ef76b6bc62bbaafb0b1423bff3d867d4 (patch) | |
| tree | fca84d984069ce672a2be5fc910a0c7e46ef5cb8 | |
| parent | 4dd3c4d53af81b017363cb778ac6fd5abea2d132 (diff) | |
| download | emacs-c22f24f6ef76b6bc62bbaafb0b1423bff3d867d4.tar.gz emacs-c22f24f6ef76b6bc62bbaafb0b1423bff3d867d4.zip | |
* lisp/xt-mouse.el (xterm-mouse--read-event-sequence-1000):
Always store button numbers in the same way in xterm-mouse-last;
Don't burp is xterm-mouse-last is not set as expected.
Never return negative indices.
Fixes: debbugs:17378
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/xt-mouse.el | 8 |
2 files changed, 11 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7c838a61fe5..043a0c240b1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2014-05-05 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * xt-mouse.el (xterm-mouse--read-event-sequence-1000): (bug#17378) | ||
| 4 | Always store button numbers in the same way in xterm-mouse-last; | ||
| 5 | Don't burp is xterm-mouse-last is not set as expected. | ||
| 6 | Never return negative indices. | ||
| 7 | |||
| 1 | 2014-05-05 Dmitry Gutov <dgutov@yandex.ru> | 8 | 2014-05-05 Dmitry Gutov <dgutov@yandex.ru> |
| 2 | 9 | ||
| 3 | * progmodes/ruby-mode.el (ruby-syntax-propertize-function): | 10 | * progmodes/ruby-mode.el (ruby-syntax-propertize-function): |
diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el index 26a07b46840..87e65f7e117 100644 --- a/lisp/xt-mouse.el +++ b/lisp/xt-mouse.el | |||
| @@ -161,10 +161,10 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)." | |||
| 161 | (cond ((>= code 64) | 161 | (cond ((>= code 64) |
| 162 | (format "mouse-%d" (- code 60))) | 162 | (format "mouse-%d" (- code 60))) |
| 163 | ((memq code '(8 9 10)) | 163 | ((memq code '(8 9 10)) |
| 164 | (setq xterm-mouse-last code) | 164 | (setq xterm-mouse-last (- code 8)) |
| 165 | (format "M-down-mouse-%d" (- code 7))) | 165 | (format "M-down-mouse-%d" (- code 7))) |
| 166 | ((= code 11) | 166 | ((= code 11) |
| 167 | (format "M-mouse-%d" (- xterm-mouse-last 7))) | 167 | (format "M-mouse-%d" (+ 1 (or xterm-mouse-last 0)))) |
| 168 | ((= code 3) | 168 | ((= code 3) |
| 169 | ;; For buttons > 5 xterm only reports a | 169 | ;; For buttons > 5 xterm only reports a |
| 170 | ;; button-release event. Avoid error by mapping | 170 | ;; button-release event. Avoid error by mapping |
| @@ -174,8 +174,8 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)." | |||
| 174 | (setq xterm-mouse-last code) | 174 | (setq xterm-mouse-last code) |
| 175 | (format "down-mouse-%d" (+ 1 code)))))) | 175 | (format "down-mouse-%d" (+ 1 code)))))) |
| 176 | ;; x and y coordinates | 176 | ;; x and y coordinates |
| 177 | (- (read-event) 33) | 177 | (max 0 (- (read-event) 33)) |
| 178 | (- (read-event) 33))) | 178 | (max 0 (- (read-event) 33)))) |
| 179 | 179 | ||
| 180 | ;; XTerm's 1006-mode terminal mouse click reporting has the form | 180 | ;; XTerm's 1006-mode terminal mouse click reporting has the form |
| 181 | ;; <BUTTON> ; <X> ; <Y> <M or m>, where the button and ordinates are | 181 | ;; <BUTTON> ; <X> ; <Y> <M or m>, where the button and ordinates are |