From: Aman Bhargava <emacs-bug@amanb.net>
Subject: Patch for xt-mouse beyond column 94
Date: Tue, 1 Apr 2003 13:55:35 -0800 (PST) [thread overview]
Message-ID: <Pine.SOL.4.53.0304011337560.29582@apocalypse.OCF.Berkeley.EDU> (raw)
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
next reply other threads:[~2003-04-01 21:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-01 21:55 Aman Bhargava [this message]
2003-04-01 23:45 ` Patch for xt-mouse beyond column 94 Aman Bhargava
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.SOL.4.53.0304011337560.29582@apocalypse.OCF.Berkeley.EDU \
--to=emacs-bug@amanb.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.