GNU bug report logs - #6594
23.2; xterm-mouse-mode bug

Previous Next

Package: emacs;

Reported by: Ilya Tatar <ilya.tatar <at> oracle.com>

Date: Fri, 9 Jul 2010 17:54:01 UTC

Severity: normal

Merged with 8106

Found in versions 23.2, 23.3

Done: Andreas Schwab <schwab <at> linux-m68k.org>

Bug is archived. No further changes may be made.

Full log


Message #40 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Langton, Asher" <langton2 <at> llnl.gov>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: bug#6594: 23.2; xterm-mouse-mode bug
Date: Mon, 25 Jul 2011 20:46:49 -0700
[Apologies if this is a duplicate; my previous two replies to this bug
report never showed up.]

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






This bug report was last modified 13 years and 304 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.