unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* Patch for xt-mouse beyond column 94
@ 2003-04-01 21:55 Aman Bhargava
  2003-04-01 23:45 ` Aman Bhargava
  0 siblings, 1 reply; 2+ messages in thread
From: Aman Bhargava @ 2003-04-01 21:55 UTC (permalink / 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Patch for xt-mouse beyond column 94
  2003-04-01 21:55 Patch for xt-mouse beyond column 94 Aman Bhargava
@ 2003-04-01 23:45 ` Aman Bhargava
  0 siblings, 0 replies; 2+ messages in thread
From: Aman Bhargava @ 2003-04-01 23:45 UTC (permalink / raw)


Sorry, the previously posted patch contained a typo. The corrected patch
follows:

*** xt-mouse.el.original        Tue Apr  1 13:35:58 2003
--- xt-mouse.el Tue Apr  1 15:43:00 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,131 ----

  (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)))
!
!   (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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-04-01 23:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-01 21:55 Patch for xt-mouse beyond column 94 Aman Bhargava
2003-04-01 23:45 ` Aman Bhargava

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).