emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r112001: * lisp/xt-mouse.el (xterm-mo


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r112001: * lisp/xt-mouse.el (xterm-mouse-event-read): Remove.
Date: Sun, 10 Mar 2013 22:56:18 -0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 112001
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Sun 2013-03-10 22:56:18 -0400
message:
  * 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.
modified:
  etc/NEWS
  lisp/ChangeLog
  lisp/xt-mouse.el
=== modified file 'etc/NEWS'
--- a/etc/NEWS  2013-03-10 21:44:31 +0000
+++ b/etc/NEWS  2013-03-11 02:56:18 +0000
@@ -238,6 +238,11 @@
 
 * Incompatible Lisp Changes in Emacs 24.4
 
+** `read-event' does not return decoded chars in ttys any more.
+Just as was the case in Emacs-22 and before, decoding of tty input according to
+keyboard-coding-system is not performed in read-event any more.  But contrary
+to that past, it is still done before input-decode-map/function-key-map/...
+
 ** Removed inhibit-local-menu-bar-menus.
 
 ** frame-local variables that affect redisplay do not work any more.

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-03-10 21:44:31 +0000
+++ b/lisp/ChangeLog    2013-03-11 02:56:18 +0000
@@ -1,3 +1,9 @@
+2013-03-11  Stefan Monnier  <address@hidden>
+
+       * xt-mouse.el (xterm-mouse-event-read): Remove.
+       (xterm-mouse--read-event-sequence-1000)
+       (xterm-mouse--read-event-sequence-1006): Use read-event instead.
+
 2013-03-10  Stefan Monnier  <address@hidden>
 
        * term/xterm.el (xterm-function-map): Support format used with

=== modified file 'lisp/xt-mouse.el'
--- a/lisp/xt-mouse.el  2013-01-01 09:11:05 +0000
+++ b/lisp/xt-mouse.el  2013-03-11 02:56:18 +0000
@@ -135,20 +135,6 @@
                      (terminal-parameter nil 'xterm-mouse-y))))
   pos)
 
-;; Read XTerm sequences above ASCII 127 (#x7f)
-(defun xterm-mouse-event-read ()
-  ;; We get the characters decoded by the keyboard coding system.  Try
-  ;; to recover the raw character.
-  (let ((c (read-event)))
-    (cond ;; If meta-flag is t we get a meta character
-         ((>= c ?\M-\^@)
-          (- c (- ?\M-\^@ 128)))
-         ;; Reencode the character in the keyboard coding system, if
-         ;; this is a non-ASCII character.
-         ((>= c #x80)
-          (aref (encode-coding-string (string c) (keyboard-coding-system)) 0))
-         (t c))))
-
 (defun xterm-mouse-truncate-wrap (f)
   "Truncate with wrap-around."
   (condition-case nil
@@ -167,7 +153,7 @@
 ;; Normal terminal mouse click reporting: expect three bytes, of the
 ;; form <BUTTON+32> <X+32> <Y+32>.  Return a list (EVENT-TYPE X Y).
 (defun xterm-mouse--read-event-sequence-1000 ()
-  (list (let ((code (- (xterm-mouse-event-read) 32)))
+  (list (let ((code (- (read-event) 32)))
          (intern
           ;; For buttons > 3, the release-event looks differently
           ;; (see xc/programs/xterm/button.c, function EditorButton),
@@ -188,19 +174,19 @@
                  (setq xterm-mouse-last code)
                  (format "down-mouse-%d" (+ 1 code))))))
        ;; x and y coordinates
-       (- (xterm-mouse-event-read) 33)
-       (- (xterm-mouse-event-read) 33)))
+       (- (read-event) 33)
+       (- (read-event) 33)))
 
 ;; XTerm's 1006-mode terminal mouse click reporting has the form
 ;; <BUTTON> ; <X> ; <Y> <M or m>, where the button and ordinates are
 ;; in encoded (decimal) form.  Return a list (EVENT-TYPE X Y).
 (defun xterm-mouse--read-event-sequence-1006 ()
   (let (button-bytes x-bytes y-bytes c)
-    (while (not (eq (setq c (xterm-mouse-event-read)) ?\;))
+    (while (not (eq (setq c (read-event)) ?\;))
       (push c button-bytes))
-    (while (not (eq (setq c (xterm-mouse-event-read)) ?\;))
+    (while (not (eq (setq c (read-event)) ?\;))
       (push c x-bytes))
-    (while (not (memq (setq c (xterm-mouse-event-read)) '(?m ?M)))
+    (while (not (memq (setq c (read-event)) '(?m ?M)))
       (push c y-bytes))
     (list (let* ((code (string-to-number
                        (apply 'string (nreverse button-bytes))))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]