aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2013-03-10 22:56:18 -0400
committerStefan Monnier2013-03-10 22:56:18 -0400
commit25c09217a0bb2ef721419304d5922d05ae8fc26b (patch)
tree419f5dc2091bd922f433771722a7dfc8e6a564ea
parentcbae07d5e07f53472fa972cd31418a4fe851ac31 (diff)
downloademacs-25c09217a0bb2ef721419304d5922d05ae8fc26b.tar.gz
emacs-25c09217a0bb2ef721419304d5922d05ae8fc26b.zip
* lisp/xt-mouse.el (xterm-mouse-event-read): Remove.
(xterm-mouse--read-event-sequence-1000) (xterm-mouse--read-event-sequence-1006): Use read-event instead.
-rw-r--r--etc/NEWS5
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/xt-mouse.el26
3 files changed, 17 insertions, 20 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 364dd8bf53a..27218ed8bf0 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -238,6 +238,11 @@ It is layered as:
238 238
239* Incompatible Lisp Changes in Emacs 24.4 239* Incompatible Lisp Changes in Emacs 24.4
240 240
241** `read-event' does not return decoded chars in ttys any more.
242Just as was the case in Emacs-22 and before, decoding of tty input according to
243keyboard-coding-system is not performed in read-event any more. But contrary
244to that past, it is still done before input-decode-map/function-key-map/...
245
241** Removed inhibit-local-menu-bar-menus. 246** Removed inhibit-local-menu-bar-menus.
242 247
243** frame-local variables that affect redisplay do not work any more. 248** frame-local variables that affect redisplay do not work any more.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b609b219fc9..6755f5a9910 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * xt-mouse.el (xterm-mouse-event-read): Remove.
4 (xterm-mouse--read-event-sequence-1000)
5 (xterm-mouse--read-event-sequence-1006): Use read-event instead.
6
12013-03-10 Stefan Monnier <monnier@iro.umontreal.ca> 72013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
2 8
3 * term/xterm.el (xterm-function-map): Support format used with 9 * term/xterm.el (xterm-function-map): Support format used with
diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el
index 9ee6c51c07c..745bca7a2be 100644
--- a/lisp/xt-mouse.el
+++ b/lisp/xt-mouse.el
@@ -135,20 +135,6 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)."
135 (terminal-parameter nil 'xterm-mouse-y)))) 135 (terminal-parameter nil 'xterm-mouse-y))))
136 pos) 136 pos)
137 137
138;; Read XTerm sequences above ASCII 127 (#x7f)
139(defun xterm-mouse-event-read ()
140 ;; We get the characters decoded by the keyboard coding system. Try
141 ;; to recover the raw character.
142 (let ((c (read-event)))
143 (cond ;; If meta-flag is t we get a meta character
144 ((>= c ?\M-\^@)
145 (- c (- ?\M-\^@ 128)))
146 ;; Reencode the character in the keyboard coding system, if
147 ;; this is a non-ASCII character.
148 ((>= c #x80)
149 (aref (encode-coding-string (string c) (keyboard-coding-system)) 0))
150 (t c))))
151
152(defun xterm-mouse-truncate-wrap (f) 138(defun xterm-mouse-truncate-wrap (f)
153 "Truncate with wrap-around." 139 "Truncate with wrap-around."
154 (condition-case nil 140 (condition-case nil
@@ -167,7 +153,7 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)."
167;; Normal terminal mouse click reporting: expect three bytes, of the 153;; Normal terminal mouse click reporting: expect three bytes, of the
168;; form <BUTTON+32> <X+32> <Y+32>. Return a list (EVENT-TYPE X Y). 154;; form <BUTTON+32> <X+32> <Y+32>. Return a list (EVENT-TYPE X Y).
169(defun xterm-mouse--read-event-sequence-1000 () 155(defun xterm-mouse--read-event-sequence-1000 ()
170 (list (let ((code (- (xterm-mouse-event-read) 32))) 156 (list (let ((code (- (read-event) 32)))
171 (intern 157 (intern
172 ;; For buttons > 3, the release-event looks differently 158 ;; For buttons > 3, the release-event looks differently
173 ;; (see xc/programs/xterm/button.c, function EditorButton), 159 ;; (see xc/programs/xterm/button.c, function EditorButton),
@@ -188,19 +174,19 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)."
188 (setq xterm-mouse-last code) 174 (setq xterm-mouse-last code)
189 (format "down-mouse-%d" (+ 1 code)))))) 175 (format "down-mouse-%d" (+ 1 code))))))
190 ;; x and y coordinates 176 ;; x and y coordinates
191 (- (xterm-mouse-event-read) 33) 177 (- (read-event) 33)
192 (- (xterm-mouse-event-read) 33))) 178 (- (read-event) 33)))
193 179
194;; XTerm's 1006-mode terminal mouse click reporting has the form 180;; XTerm's 1006-mode terminal mouse click reporting has the form
195;; <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
196;; in encoded (decimal) form. Return a list (EVENT-TYPE X Y). 182;; in encoded (decimal) form. Return a list (EVENT-TYPE X Y).
197(defun xterm-mouse--read-event-sequence-1006 () 183(defun xterm-mouse--read-event-sequence-1006 ()
198 (let (button-bytes x-bytes y-bytes c) 184 (let (button-bytes x-bytes y-bytes c)
199 (while (not (eq (setq c (xterm-mouse-event-read)) ?\;)) 185 (while (not (eq (setq c (read-event)) ?\;))
200 (push c button-bytes)) 186 (push c button-bytes))
201 (while (not (eq (setq c (xterm-mouse-event-read)) ?\;)) 187 (while (not (eq (setq c (read-event)) ?\;))
202 (push c x-bytes)) 188 (push c x-bytes))
203 (while (not (memq (setq c (xterm-mouse-event-read)) '(?m ?M))) 189 (while (not (memq (setq c (read-event)) '(?m ?M)))
204 (push c y-bytes)) 190 (push c y-bytes))
205 (list (let* ((code (string-to-number 191 (list (let* ((code (string-to-number
206 (apply 'string (nreverse button-bytes)))) 192 (apply 'string (nreverse button-bytes))))