]> git.eshelyaron.com Git - emacs.git/commitdiff
Fixes: debbugs:6594
authorAndreas Schwab <schwab@linux-m68k.org>
Thu, 28 Jul 2011 18:40:28 +0000 (20:40 +0200)
committerAndreas Schwab <schwab@linux-m68k.org>
Thu, 28 Jul 2011 18:40:28 +0000 (20:40 +0200)
* lisp/xt-mouse.el (xterm-mouse-event-read): Try to recover the raw
character.

lisp/ChangeLog
lisp/xt-mouse.el

index 1b401bf7582a08ff2a912d8dfda830c4d4369bd8..a42c0127ff5b5a98cb74461130c9801b96ef0139 100644 (file)
@@ -1,3 +1,8 @@
+2011-07-28  Andreas Schwab  <schwab@linux-m68k.org>
+
+       * xt-mouse.el (xterm-mouse-event-read): Try to recover the raw
+       character.  (Bug#6594)
+
 2011-07-12  Chong Yidong  <cyd@stupidchicken.com>
 
        * window.el (split-window-horizontally): Doc fix (Bug#9060).
index 5a70e6a6808f34eb0278c2c19143e42bf4e2d2d6..f917287d2d9f2af840d7506877baaa661c19c9e6 100644 (file)
 
 ;; 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-char)))
-    (if (> c #x3FFF80)
-        (+ 128 (- c #x3FFF80))
-      c)))
+    (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."