From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Asher Langton Newsgroups: gmane.emacs.bugs Subject: bug#6594: 23.2; xterm-mouse-mode bug Date: Tue, 26 Jul 2011 11:53:34 -0700 Message-ID: References: <4C3757C8.7040009@oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1311818203 22762 80.91.229.12 (28 Jul 2011 01:56:43 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 28 Jul 2011 01:56:43 +0000 (UTC) To: 6594@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 28 03:56:38 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QmFq2-00024r-3F for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Jul 2011 03:56:38 +0200 Original-Received: from localhost ([::1]:49141 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QmFq1-0001No-Ou for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 Jul 2011 21:56:37 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:33956) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qm9bV-0004hS-Dk for bug-gnu-emacs@gnu.org; Wed, 27 Jul 2011 15:17:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qm9bO-00037a-0n for bug-gnu-emacs@gnu.org; Wed, 27 Jul 2011 15:17:13 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35927) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qm9bN-00037S-S8 for bug-gnu-emacs@gnu.org; Wed, 27 Jul 2011 15:17:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Qm9bN-0007FK-Na; Wed, 27 Jul 2011 15:17:05 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <4C3757C8.7040009@oracle.com> Resent-From: Asher Langton Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 27 Jul 2011 19:17:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6594 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6594-submit@debbugs.gnu.org id=B6594.131179420427782 (code B ref 6594); Wed, 27 Jul 2011 19:17:05 +0000 Original-Received: (at 6594) by debbugs.gnu.org; 27 Jul 2011 19:16:44 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qm9b1-0007E3-L3 for submit@debbugs.gnu.org; Wed, 27 Jul 2011 15:16:44 -0400 Original-Received: from mail-vw0-f44.google.com ([209.85.212.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QlmlO-0004qV-IL for 6594@debbugs.gnu.org; Tue, 26 Jul 2011 14:53:54 -0400 Original-Received: by vws12 with SMTP id 12so538656vws.3 for <6594@debbugs.gnu.org>; Tue, 26 Jul 2011 11:53:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; bh=Z6TW4a8H2ltSnSABMvTKNgcLFdTaIL0f+C6zc8akl4g=; b=RNdTZ3qcZZLd5WzV0dclsWOGXuY8nj2BL44LqfTzg6iWB7tgpWVN4TEFfr6vay6a/y mfmfbYaKagqWvtQkbIsNqxGOPUbzYnB/N611FKXPTiZkJAEFN15EMip3gGkGY37ZGxqQ R8C/kaAVatpzGAvhphRXQzcCnwvGdEc/dnjPE= Original-Received: by 10.52.93.72 with SMTP id cs8mr6012217vdb.518.1311706429071; Tue, 26 Jul 2011 11:53:49 -0700 (PDT) Original-Received: by 10.52.188.228 with HTTP; Tue, 26 Jul 2011 11:53:34 -0700 (PDT) X-Mailman-Approved-At: Wed, 27 Jul 2011 15:16:43 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 27 Jul 2011 15:17:05 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 140.186.70.43 X-Mailman-Approved-At: Wed, 27 Jul 2011 21:56:35 -0400 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:49643 Archived-At: [Apologies if this is a duplicate; I tried both 6594@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