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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 6594 in the body.
You can then email your comments to 6594 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6594; Package emacs. (Fri, 09 Jul 2010 17:54:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ilya Tatar <ilya.tatar <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 09 Jul 2010 17:54:01 GMT) Full text and rfc822 format available.

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

From: Ilya Tatar <ilya.tatar <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 23.2; xterm-mouse-mode bug
Date: Fri, 09 Jul 2010 13:09:28 -0400
--text follows this line--
This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the bug-gnu-emacs <at> gnu.org mailing list,
and to the gnu.emacs.bug news group.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug.  If you can, give
a recipe starting from `emacs -Q':



Hello,


I started emacs with "emacs -Q -nw" in xterm

% xterm -version
XTerm(257)

- if I click on a character on column 0-94, everything works as 
expected: the point moves to that location.

- if I click on a character on column 95, I get an error:
xterm-mouse-event: Wrong type argument: wholenump, -29

- if I click on a character on column >95, I get the Help menu (same as 
if I clicked on "Help" menu, or pressed "M-` h")


Thanks,
-Ilya




If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file
/pkg/gnu/share/emacs/23.2/etc/DEBUG.


In GNU Emacs 23.2.1 (sparc-sun-solaris2.8, GTK+ Version 2.10.13)
 of 2010-05-08 on pkg-build
configured using `configure  '--prefix=/pkg/gnu' 
'--x-includes=/pkg/gnome/include:/usr/X11/include:/usr/openwin/include:/usr/dt/include:/pkg/X11/include' 
'--x-libraries=/pkg/gnome/lib:/usr/X11/lib:/usr/openwin/lib:/usr/dt/lib:/pkg/X11/lib' 
'--with-x' '--with-x-toolkit=gtk' 
'--with-pkg-config-prog=/usr/bin/pkg-config' '--with-xpm' '--with-jpeg' 
'--with-tiff' '--with-gif' '--with-png' 'CC=gcc' 'CFLAGS= -O3 
-mcpu=ultrasparc' 'LDFLAGS=-L/pkg/local/lib -R/pkg/local/lib 
-L/pkg/gnu/lib -R/pkg/gnu/lib' 'CPPFLAGS=-I/pkg/local/include 
-I/pkg/local/include/libpng -I/pkg/gnu/include''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: C
  value of $XMODIFIERS: nil
  locale-coding-system: nil
  default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  xterm-mouse-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
ESC [ > 0 ; 2 5 7 ; 0 c ESC ] 1 1 ; r g b : f f f f
/ f f f f / f f f f ESC \ M-x x t - m o u TAB RET C-u
9 5 - ESC [ M SPC ~ & ESC [ M # ~ & ESC [ M SPC C-d
& ESC [ M # C-d & ESC [ M SPC C-M-@ & ESC [ M # C-M-@
& C-g M-x r e p o TAB r t TAB RET

Recent messages:
("emacs")
For information about GNU Emacs and the GNU system, type C-h C-a.
Xterm-Mouse mode enabled
xterm-mouse-event: Wrong type argument: wholenump, -29 [2 times]
Quit
Making completion list...

Load-path shadows:
None found.

Features:
(shadow sort mail-extr message sendmail regexp-opt ecomplete rfc822 mml
mml-sec password-cache mm-decode mm-bodies mm-encode mailcap mail-parse
rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util
netrc time-date mm-util mail-prsvr gmm-utils wid-edit mailheader canlock
sha1 hex-util hashcash mail-utils emacsbug help-mode easymenu view tmm
electric cus-start cus-load xt-mouse tooltip ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd font-setting tool-bar dnd fontset
image fringe lisp-mode register page menu-bar rfn-eshadow timer select
scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core
frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help
simple abbrev loaddefs button minibuffer faces cus-face files
text-properties overlay md5 base64 format env code-pages mule custom
widget hashtable-print-readable backquote make-network-process
font-render-setting gtk x-toolkit x multi-tty emacs)




Reply sent to Jan Djärv <jan.h.d <at> swipnet.se>:
You have taken responsibility. (Wed, 14 Jul 2010 17:58:02 GMT) Full text and rfc822 format available.

Notification sent to Ilya Tatar <ilya.tatar <at> oracle.com>:
bug acknowledged by developer. (Wed, 14 Jul 2010 17:58:02 GMT) Full text and rfc822 format available.

Message #10 received at 6594-done <at> debbugs.gnu.org (full text, mbox):

From: Jan Djärv <jan.h.d <at> swipnet.se>
To: Ilya Tatar <ilya.tatar <at> oracle.com>
Cc: 6594-done <at> debbugs.gnu.org
Subject: Re: bug#6594: 23.2; xterm-mouse-mode bug
Date: Wed, 14 Jul 2010 19:57:05 +0200
Ah, the character representation changed with introduction of Unicode.
I checked in a fix in the emacs-23 branch.

	Jan D.


Ilya Tatar skrev 2010-07-09 19.09:
> --text follows this line--
> This bug report will be sent to the Free Software Foundation,
> not to your local site managers!
> Please write in English if possible, because the Emacs maintainers
> usually do not have translators to read other languages for them.
>
> Your bug report will be posted to the bug-gnu-emacs <at> gnu.org mailing list,
> and to the gnu.emacs.bug news group.
>
> Please describe exactly what actions triggered the bug
> and the precise symptoms of the bug. If you can, give
> a recipe starting from `emacs -Q':
>
>
>
> Hello,
>
>
> I started emacs with "emacs -Q -nw" in xterm
>
> % xterm -version
> XTerm(257)
>
> - if I click on a character on column 0-94, everything works as expected: the
> point moves to that location.
>
> - if I click on a character on column 95, I get an error:
> xterm-mouse-event: Wrong type argument: wholenump, -29
>
> - if I click on a character on column >95, I get the Help menu (same as if I
> clicked on "Help" menu, or pressed "M-` h")
>
>
> Thanks,
> -Ilya
>
>
>
>
> If Emacs crashed, and you have the Emacs process in the gdb debugger,
> please include the output from the following gdb commands:
> `bt full' and `xbacktrace'.
> For information about debugging Emacs, please read the file
> /pkg/gnu/share/emacs/23.2/etc/DEBUG.
>
>
> In GNU Emacs 23.2.1 (sparc-sun-solaris2.8, GTK+ Version 2.10.13)
> of 2010-05-08 on pkg-build
> configured using `configure '--prefix=/pkg/gnu'
> '--x-includes=/pkg/gnome/include:/usr/X11/include:/usr/openwin/include:/usr/dt/include:/pkg/X11/include'
> '--x-libraries=/pkg/gnome/lib:/usr/X11/lib:/usr/openwin/lib:/usr/dt/lib:/pkg/X11/lib'
> '--with-x' '--with-x-toolkit=gtk' '--with-pkg-config-prog=/usr/bin/pkg-config'
> '--with-xpm' '--with-jpeg' '--with-tiff' '--with-gif' '--with-png' 'CC=gcc'
> 'CFLAGS= -O3 -mcpu=ultrasparc' 'LDFLAGS=-L/pkg/local/lib -R/pkg/local/lib
> -L/pkg/gnu/lib -R/pkg/gnu/lib' 'CPPFLAGS=-I/pkg/local/include
> -I/pkg/local/include/libpng -I/pkg/gnu/include''
>
> Important settings:
> value of $LC_ALL: nil
> value of $LC_COLLATE: nil
> value of $LC_CTYPE: nil
> value of $LC_MESSAGES: nil
> value of $LC_MONETARY: nil
> value of $LC_NUMERIC: nil
> value of $LC_TIME: nil
> value of $LANG: C
> value of $XMODIFIERS: nil
> locale-coding-system: nil
> default enable-multibyte-characters: t
>
> Major mode: Lisp Interaction
>
> Minor modes in effect:
> xterm-mouse-mode: t
> tooltip-mode: t
> mouse-wheel-mode: t
> tool-bar-mode: t
> menu-bar-mode: t
> file-name-shadow-mode: t
> global-font-lock-mode: t
> font-lock-mode: t
> auto-encryption-mode: t
> auto-compression-mode: t
> line-number-mode: t
> transient-mark-mode: t
>
> Recent input:
> ESC [ > 0 ; 2 5 7 ; 0 c ESC ] 1 1 ; r g b : f f f f
> / f f f f / f f f f ESC \ M-x x t - m o u TAB RET C-u
> 9 5 - ESC [ M SPC ~ & ESC [ M # ~ & ESC [ M SPC C-d
> & ESC [ M # C-d & ESC [ M SPC C-M-@ & ESC [ M # C-M-@
> & C-g M-x r e p o TAB r t TAB RET
>
> Recent messages:
> ("emacs")
> For information about GNU Emacs and the GNU system, type C-h C-a.
> Xterm-Mouse mode enabled
> xterm-mouse-event: Wrong type argument: wholenump, -29 [2 times]
> Quit
> Making completion list...
>
> Load-path shadows:
> None found.
>
> Features:
> (shadow sort mail-extr message sendmail regexp-opt ecomplete rfc822 mml
> mml-sec password-cache mm-decode mm-bodies mm-encode mailcap mail-parse
> rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util
> netrc time-date mm-util mail-prsvr gmm-utils wid-edit mailheader canlock
> sha1 hex-util hashcash mail-utils emacsbug help-mode easymenu view tmm
> electric cus-start cus-load xt-mouse tooltip ediff-hook vc-hooks
> lisp-float-type mwheel x-win x-dnd font-setting tool-bar dnd fontset
> image fringe lisp-mode register page menu-bar rfn-eshadow timer select
> scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core
> frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai
> tai-viet lao korean japanese hebrew greek romanian slovak czech european
> ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help
> simple abbrev loaddefs button minibuffer faces cus-face files
> text-properties overlay md5 base64 format env code-pages mule custom
> widget hashtable-print-readable backquote make-network-process
> font-render-setting gtk x-toolkit x multi-tty emacs)
>
>




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 12 Aug 2010 11:24:05 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 24 Feb 2011 18:24:01 GMT) Full text and rfc822 format available.

Forcibly Merged 6594 8106. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 24 Feb 2011 18:24:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 25 Mar 2011 11:24:04 GMT) Full text and rfc822 format available.

bug Marked as found in versions 23.3 and reopened. Request was from Ilya Tatar <ilya.tatar <at> oracle.com> to control <at> debbugs.gnu.org. (Fri, 22 Apr 2011 22:50:03 GMT) Full text and rfc822 format available.

Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 22 Apr 2011 23:40:02 GMT) Full text and rfc822 format available.

bug unarchived. Request was from ilya.tatar <at> oracle.com to control <at> debbugs.gnu.org. (Sat, 23 Apr 2011 22:03:02 GMT) Full text and rfc822 format available.

Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 23 Apr 2011 22:03:02 GMT) Full text and rfc822 format available.

bug Marked as found in versions 23.3. Request was from ilya.tatar <at> oracle.com to control <at> debbugs.gnu.org. (Sat, 23 Apr 2011 22:03:02 GMT) Full text and rfc822 format available.

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6594; Package emacs. (Sun, 24 Apr 2011 01:59:02 GMT) Full text and rfc822 format available.

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

From: Ilya Tatar <ilya.tatar <at> oracle.com>
To: 6594 <at> debbugs.gnu.org
Date: Sat, 23 Apr 2011 21:59:00 -0400
Thank you Jan.
I just tried it with
GNU Emacs 23.3.1 (i386-pc-solaris2.10, GTK+ Version 2.10.13) of 2011-04-21
and still see the problem. Should it have been fixed in version 23.3?

I am still using
% xterm -version
XTerm(257)


Started emacs with:
emacs -Q -nw

And ran
M-x xterm-mouse-mode

The behavior is the same as I described previously.

Thank you,
-Ilya




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6594; Package emacs. (Mon, 25 Apr 2011 12:07:02 GMT) Full text and rfc822 format available.

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

From: Jan Djärv <jan.h.d <at> swipnet.se>
To: Ilya Tatar <ilya.tatar <at> oracle.com>
Cc: 6594 <at> debbugs.gnu.org
Subject: Re: bug#6594: (no subject)
Date: Mon, 25 Apr 2011 14:06:44 +0200
Hello.

The bug is fixed for me with a stock 23.3 from ftp.gnu.org, tried with xterm 
251 and 261.  I suspect you are loading the wrong xt-mouse.el(c).  Try this
from inside Emacs:

C-h f xterm-mouse-event-read <return>
Click on the xt-mouse.el link.
You should see:

;; read xterm sequences above ascii 127 (#x7f)
(defun xterm-mouse-event-read ()
  (let ((c (read-char)))
    (if (> c #x3FFF80)
        (+ 128 (- c #x3FFF80))
      c)))

If you do and still see the error, ypu have to debug it as I can't reproduce 
it.  Read the Elisp manual (C-h i m elisp <return> m debugging <return>) about 
edebug on how to to that.  Note the values of c that fails for you.

	Jan D.


Ilya Tatar skrev 2011-04-24 03.59:
> Thank you Jan.
> I just tried it with
> GNU Emacs 23.3.1 (i386-pc-solaris2.10, GTK+ Version 2.10.13) of 2011-04-21
> and still see the problem. Should it have been fixed in version 23.3?
>
> I am still using
> % xterm -version
> XTerm(257)
>
>
> Started emacs with:
> emacs -Q -nw
>
> And ran
> M-x xterm-mouse-mode
>
> The behavior is the same as I described previously.
>
> Thank you,
> -Ilya
>
>




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6594; Package emacs. (Mon, 25 Jul 2011 20:06:02 GMT) Full text and rfc822 format available.

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

From: "Langton, Asher" <langton2 <at> llnl.gov>
To: "6594 <at> debbugs.gnu.org" <6594 <at> debbugs.gnu.org>
Subject: xterm-mouse-mode bug still appears in 23.3.1
Date: Mon, 25 Jul 2011 13:00:12 -0700
I'm still seeing this bug in Emacs 23.3.1 running in iTerm2 (OS X), xterm,
and gnome-terminal. The versions I'm using are:

GNU Emacs 23.3.1 (x86_64-apple-darwin, NS apple-appkit-1038.35)
GNU Emacs 23.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.10.4)

I ran edebug in each of the terminal emulators mentioned above and tried
to capture the value of c after these mouse events. When I clicked in the
right-portion of a large frame, the value was usually:
27 (#o33, #x1b, ?\C-\[)
or
32 (#o40, #x20, ? )


Once, the result was:
101 (#o145, #x65, ?e)

(I did this many times to try to be sure that I was actually looking at
the correct mouse event.)

Is there anything else I can do to help isolate this bug?


Thanks,
Asher





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6594; Package emacs. (Wed, 27 Jul 2011 19:17:02 GMT) Full text and rfc822 format available.

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






Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6594; Package emacs. (Wed, 27 Jul 2011 19:17:04 GMT) Full text and rfc822 format available.

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

From: "Langton, Asher" <langton2 <at> llnl.gov>
To: "6594 <at> debbugs.gnu.org" <6594 <at> debbugs.gnu.org>
Subject: <no subject>
Date: Mon, 25 Jul 2011 14:44:04 -0700
Running through this in the debugger didn't seem very informative, so I
just 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
In xterm-mouse-event with 0,15,29
In xterm-mouse-event with 3,15,29
In xterm-mouse-event with 0,130023699,29
In xterm-mouse-event with 3,130023699,29
In xterm-mouse-event with 0,26,29
In xterm-mouse-event with 3,26,29
In xterm-mouse-event with 0,52,28
In xterm-mouse-event with 3,52,28
In xterm-mouse-event with 0,82,28
In xterm-mouse-event with 3,82,28
In xterm-mouse-event with 0,94,28
In xterm-mouse-event with 3,94,28
In xterm-mouse-event with 0,130023651,28
In xterm-mouse-event with 3,130023651,28
In xterm-mouse-event with 0,1,29
In xterm-mouse-event with 3,1,29


As you might imagine, the very large x-values correspond to clicks beyond
column 94.

-Asher






Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6594; Package emacs. (Wed, 27 Jul 2011 19:17:05 GMT) Full text and rfc822 format available.

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

From: "Langton, Asher" <langton2 <at> llnl.gov>
To: "6594 <at> debbugs.gnu.org" <6594 <at> debbugs.gnu.org>
Subject: <no subject>
Date: Mon, 25 Jul 2011 15:23:52 -0700
I looked at this a little more, and on my systems the value of c 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 works for me
on both Linux and OSX:

;; read xterm sequences above ascii 127 (#x7f)
(defun xterm-mouse-event-read ()
  (let ((c (read-char)))
    (cond ((and (> c #x3FFF80) (< c #x3FFFFF))
           (+ 128 (- c #x3FFF80)))
          ((>= c #x8000000)
           (+ 128 (- c #x8000000)))
          (t c))))





-Asher





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6594; Package emacs. (Wed, 27 Jul 2011 19:17:05 GMT) Full text and rfc822 format available.

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

From: Asher Langton <langton <at> gmail.com>
To: 6594 <at> debbugs.gnu.org
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 <at> 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




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6594; Package emacs. (Wed, 27 Jul 2011 21:08:01 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: "Langton\, Asher" <langton2 <at> llnl.gov>
Cc: "6594 <at> debbugs.gnu.org" <6594 <at> debbugs.gnu.org>
Subject: Re: bug#6594: <no subject>
Date: Wed, 27 Jul 2011 22:30:57 +0200
"Langton, Asher" <langton2 <at> llnl.gov> writes:

> Running through this in the debugger didn't seem very informative, so I
> just 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

What does your xterm emit?  What is your keyboard-coding-system?

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6594; Package emacs. (Thu, 28 Jul 2011 00:17:02 GMT) Full text and rfc822 format available.

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

From: "Langton, Asher" <langton2 <at> llnl.gov>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: "6594 <at> debbugs.gnu.org" <6594 <at> debbugs.gnu.org>
Subject: Re: bug#6594: <no subject>
Date: Wed, 27 Jul 2011 15:18:29 -0700
On 7/27/11 1:30 PM, Andreas Schwab wrote:
>"Langton, Asher" <langton2 <at> llnl.gov> writes:
>
>> Running through this in the debugger didn't seem very informative, so I
>> just 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
>
>What does your xterm emit?

I'm not sure what that means. Are you referring to the character encoding?

> What is your keyboard-coding-system?

nil





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6594; Package emacs. (Thu, 28 Jul 2011 06:59:02 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: "Langton\, Asher" <langton2 <at> llnl.gov>
Cc: "6594 <at> debbugs.gnu.org" <6594 <at> debbugs.gnu.org>
Subject: Re: bug#6594: <no subject>
Date: Thu, 28 Jul 2011 08:58:18 +0200
"Langton, Asher" <langton2 <at> llnl.gov> writes:

> On 7/27/11 1:30 PM, Andreas Schwab wrote:
>>"Langton, Asher" <langton2 <at> llnl.gov> writes:
>>
>>> Running through this in the debugger didn't seem very informative, so I
>>> just 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
>>
>>What does your xterm emit?
>
> I'm not sure what that means.

Whatever characters it emits.  See C-h l.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Reply sent to Andreas Schwab <schwab <at> linux-m68k.org>:
You have taken responsibility. (Thu, 28 Jul 2011 19:01:02 GMT) Full text and rfc822 format available.

Notification sent to Ilya Tatar <ilya.tatar <at> oracle.com>:
bug acknowledged by developer. (Thu, 28 Jul 2011 19:01:05 GMT) Full text and rfc822 format available.

Message #63 received at 6594-done <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Ilya Tatar <ilya.tatar <at> oracle.com>
Cc: 6594-done <at> debbugs.gnu.org
Subject: Re: bug#6594: 23.2; xterm-mouse-mode bug
Date: Thu, 28 Jul 2011 21:00:35 +0200
This is now fixed.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Reply sent to Andreas Schwab <schwab <at> linux-m68k.org>:
You have taken responsibility. (Thu, 28 Jul 2011 19:01:05 GMT) Full text and rfc822 format available.

Notification sent to Joe Riel <joer <at> san.rr.com>:
bug acknowledged by developer. (Thu, 28 Jul 2011 19:01:06 GMT) Full text and rfc822 format available.

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6594; Package emacs. (Thu, 28 Jul 2011 19:02:01 GMT) Full text and rfc822 format available.

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

From: ilya.tatar <at> oracle.com
To: 6594 <at> debbugs.gnu.org
Subject: Auto Reply: bug#6594: closed (Re: bug#6594: 23.2; xterm-mouse-mode
	bug)
Date: Thu, 28 Jul 2011 12:01:15 -0700 (PDT)
This is an auto-replied message. I am on vacation until 08/01




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6594; Package emacs. (Thu, 28 Jul 2011 19:12:05 GMT) Full text and rfc822 format available.

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

From: "Langton, Asher" <langton2 <at> llnl.gov>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: "6594 <at> debbugs.gnu.org" <6594 <at> debbugs.gnu.org>
Subject: Re: bug#6594: <no subject>
Date: Thu, 28 Jul 2011 09:51:29 -0700
On 7/27/11 11:58 PM, Andreas Schwab wrote:
>Whatever characters it emits.  See C-h l.

I launched emacs -nw (in a gnome-terminal), clicked on the far right, and
then typed C-h l. This was the output:

ESC [ > 1 ; 1 4 0 0 ; 0 c ESC [ M SPC M-[ % ESC [ M
# M-[ % C-h l

In an xterm, clicking and holding mouse-1 in the right portion of the
window caused sequences like this to be displayed in the mini-buffer:


ESC [ M SPC M-l +-
ESC [ M SPC M-u >-


In an iTerm on MacOSX, I got similar results (output prefixed by 'ESC [ M
SPC M-'). Is that what you're looking for?






bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 26 Aug 2011 11:24:03 GMT) Full text and rfc822 format available.

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.