From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Aman Bhargava Newsgroups: gmane.emacs.bugs Subject: Patch for xt-mouse beyond column 94 Date: Tue, 1 Apr 2003 13:55:35 -0800 (PST) Sender: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: main.gmane.org 1049234809 6739 80.91.224.249 (1 Apr 2003 22:06:49 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 1 Apr 2003 22:06:49 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Wed Apr 02 00:06:47 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 190TpV-0001Nc-00 for ; Wed, 02 Apr 2003 00:02:06 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 190Tnp-0005at-03 for gnu-bug-gnu-emacs@m.gmane.org; Tue, 01 Apr 2003 17:00:21 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 190Tmu-0004zP-00 for bug-gnu-emacs@gnu.org; Tue, 01 Apr 2003 16:59:24 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 190TlD-0002lU-00 for bug-gnu-emacs@gnu.org; Tue, 01 Apr 2003 16:58:10 -0500 Original-Received: from war.ocf.berkeley.edu ([128.32.191.89]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 190TjM-000211-00 for bug-gnu-emacs@gnu.org; Tue, 01 Apr 2003 16:55:44 -0500 Original-Received: from apocalypse.OCF.Berkeley.EDU (daemon@apocalypse.OCF.Berkeley.EDU [128.32.191.249]) by war.OCF.Berkeley.EDU (8.11.6/8.9.3) with ESMTP id h31Ltav17630 for ; Tue, 1 Apr 2003 13:55:36 -0800 (PST) Original-Received: from localhost (amanb@localhost)h31LtZD29861 for ; Tue, 1 Apr 2003 13:55:35 -0800 (PST) X-Authentication-Warning: apocalypse.OCF.Berkeley.EDU: amanb owned process doing -bs X-X-Sender: amanb@apocalypse.OCF.Berkeley.EDU Original-To: bug-gnu-emacs@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:4687 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:4687 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