[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Patch for xt-mouse beyond column 94
From: |
Aman Bhargava |
Subject: |
Patch for xt-mouse beyond column 94 |
Date: |
Tue, 1 Apr 2003 13:55:35 -0800 (PST) |
A rather old bug with mouse support in emacs-nw still lives in 21.2. The
symptom is described in
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=utf-8&selm=199802151113.NAA17982%40beach.weizmann.ac.il
(full text pasted later in this email)
The bug is reproducible at least on the GNU/Linux operating system.
The root cause of this is that the read-char function doesn't return the
expected result for ASCII values above 127. I have provided a rather
inelegant patch that contains a wrapper, read-8bit-char, over read-char
which addresses this instance of the problem. If a similar function or
better solution already exists, please make me aware of it so I can revise
the patch.
-Aman
Patch:
*** xt-mouse.el.original Tue Apr 1 13:35:58 2003
--- xt-mouse.el Tue Apr 1 13:49:21 2003
***************
*** 115,123 ****
(defun xterm-mouse-event ()
"Convert XTerm mouse event to Emacs mouse event."
! (let* ((type (- (read-char) #o40))
! (x (- (read-char) #o40 1))
! (y (- (read-char) #o40 1))
(point (cons x y))
(window (window-at x y))
(where (if window
--- 115,132 ----
(defun xterm-mouse-event ()
"Convert XTerm mouse event to Emacs mouse event."
!
! ;; read-char messes up xterm sequences above ascii 127 (ox7f)
! (defun read-8bit-char ()
! (let ((c (read-char)))
! (if (< c 0)
! (+ c #x8000000 128)
! (+ c #x8000000 128)
! c)))
!
! (let* ((type (- (read-8bit-char) #o40))
! (x (- (read-8bit-char) #o40 1))
! (y (- (read-8bit-char) #o40 1))
(point (cons x y))
(window (window-at x y))
(where (if window
Full bug report:
From: Eli Tziperman (eli@beach.weizmann.ac.il)
Subject: problem using xterm-mouse beyond column 94 in an xterm window
Newsgroups: gnu.emacs.bug
Date: 1998/02/15
In GNU Emacs 20.1.1 (mips-sgi-irix6.2, X toolkit)
of Thu Sep 18 1997 on beach
configured using `configure --with-gcc'
Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:
1) I start a wide xterm window:
xterm -geometry 100x25&
2) I start xterm-mouse-mode
3) I create a line that is 100 characters long
(e.g. using C-u 1 0 0 =)
4) I click with the left mouse button on this line in order to
position the cursor there.
--> when the position on which I click is beyond column 94, this does
--> not result in a repositioning of the cursor, but instead tmm is
--> activated as if I pressed on the menu bar.
Eli Tziperman
Department of Environmental Sciences
Weizmann Institute of Science
Rehovot, 76100. ISRAEL.
EMAIL: eli@beach.weizmann.ac.il
Recent input:
ESC x x t e r m SPC m o u s e RET C-u 1 0 0 = ESC [
M SPC M-C-c & ESC [ M # M-C-c & C-g ESC [ M SPC G !
ESC [ M # G ! RET s
Recent messages:
For information about the GNU Project and its goals, type C-h C-p.
Loading xt-mouse (compiled)...
Loading advice (compiled)...
Loading advice (compiled)...done
Loading xt-mouse (compiled)...done
Loading tmm (compiled)...
Loading tmm (compiled)...done
Quit
Loading emacsbug (compiled)...
Loading emacsbug (compiled)...done
- Patch for xt-mouse beyond column 94,
Aman Bhargava <=