bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#6594: 23.2; xterm-mouse-mode bug


From: Asher Langton
Subject: bug#6594: 23.2; xterm-mouse-mode bug
Date: Tue, 26 Jul 2011 11:53:34 -0700

[Apologies if this is a duplicate; I tried both 6594@debbugs.gnu.org
and the bug-gnu-emacs list yesterday, but neither seems to have
worked.]

I put a print statement in xterm-mouse-event that displayed the values of
type, x, and y. For some arbitrary clicks, here was the output (all in
pairs; mouse-1 and down-mouse-1, I assume):

In xterm-mouse-event with 0,130023656,46
In xterm-mouse-event with 3,130023656,46
In xterm-mouse-event with 0,37,35
In xterm-mouse-event with 3,37,35
In xterm-mouse-event with 0,12,33
In xterm-mouse-event with 3,12,33
In xterm-mouse-event with 0,130023730,17
In xterm-mouse-event with 3,130023730,17

It appears that the value of x jumps to 0x8000000 around the 94th column.
I don't know much about the internals of emacs nor what the valid
character values are here, but this fix works for me on both Linux and OSX:

--- xt-mouse.el 2011-07-25 20:41:03.000000000 -0700
+++ xt-mouse_modified.el        2011-07-25 20:40:39.000000000 -0700
@@ -122,9 +122,11 @@
;; read xterm sequences above ascii 127 (#x7f)
(defun xterm-mouse-event-read ()
   (let ((c (read-char)))
-    (if (> c #x3FFF80)
-        (+ 128 (- c #x3FFF80))
-      c)))
+    (cond ((and (> c #x3FFF80) (< c #x3FFFFF))
+           (+ 128 (- c #x3FFF80)))
+          ((>= c #x8000000)
+           (+ 128 (- c #x8000000)))
+          (t c))))



-Asher





reply via email to

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