diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2011-08-09 18:13:11 -0400 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2011-08-09 18:13:11 -0400 |
commit | 7be1c708c5abc7dea388d45454bd19bff07b7943 (patch) | |
tree | 4d86b007b24388f25e83515bd86c42d14de9b77a /lisp/xt-mouse.el | |
parent | ebb552ed380b9f04e0c6b29374b3d32435837951 (diff) | |
parent | 8d96c9a4e700ad17921f8d2c90f4244bfa4b98b1 (diff) | |
download | emacs-7be1c708c5abc7dea388d45454bd19bff07b7943.tar.gz |
Merge from emacs-23 branch
Diffstat (limited to 'lisp/xt-mouse.el')
-rw-r--r-- | lisp/xt-mouse.el | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el index 403aa5d158b..eca5f813ca2 100644 --- a/lisp/xt-mouse.el +++ b/lisp/xt-mouse.el @@ -120,10 +120,17 @@ ;; 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." |