GNU bug report logs - #29150
26.0.90; Input decoding is sometimes skipped in TTY (xterm-mouse-mode)

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Alex <agrambot@HIDDEN>; dated Sun, 5 Nov 2017 07:43:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 29150 <at> debbugs.gnu.org:


Received: (at 29150) by debbugs.gnu.org; 8 Nov 2017 20:57:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 08 15:57:55 2017
Received: from localhost ([127.0.0.1]:58984 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eCXQ3-0005TV-Mz
	for submit <at> debbugs.gnu.org; Wed, 08 Nov 2017 15:57:55 -0500
Received: from mail-io0-f171.google.com ([209.85.223.171]:47764)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <agrambot@HIDDEN>) id 1eCXQ2-0005TH-8N
 for 29150 <at> debbugs.gnu.org; Wed, 08 Nov 2017 15:57:54 -0500
Received: by mail-io0-f171.google.com with SMTP id h70so7437726ioi.4
 for <29150 <at> debbugs.gnu.org>; Wed, 08 Nov 2017 12:57:54 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=ju0jSBOQRq/eT+sVqqvPfJsZ65vV9xScDba8azSaG3I=;
 b=qLSkb0AU/LLEvUlavKRzErn3YMCwYp0DizS+jwyt02J160haEq8Z9CbvzNLW7t0+SY
 TsqNj6/8Dqqo4Vo8nmWRtmFP42K3m8wP77U65ZHSVcbEr+SOVrFasuPYmaV2L13cNmS3
 uk2w6K2mLOPQDWIgjrmVcZTfOMv7VZuWlJYlQ68Km7GEcSadZwmvfyJLo4AxbM6B9rpn
 uVyjoYeSwHtIzE7/IfyGEfOfs2TzmZXBzv9gBfrHTemFKEtV5dtOLO6osHQZwJhIgiOM
 NPHtvPweX/LTDWhQ4qbXUMxMcC25SZ3JV7/xgwpXbZR+YKBwW+D0ZOSqDfzw0nQDJROh
 KkEw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=ju0jSBOQRq/eT+sVqqvPfJsZ65vV9xScDba8azSaG3I=;
 b=PIZuzeKuVo6xd6w7v6nMlygmyNhuCXeE7z16Wdn7ZoiUSqmedPkewlHvOryQ/5IBp1
 1BdWSJbUieKiuotqoGNIZWzBJLJMbTbV4/AwvpuPQxj1JqcCbAvedxxDvan7o95SyMXm
 AICtyo2oZ6o8o3FMA/eSVWNjho2wEBRdWNupifNDitmhiAjeWjlKolNjZJtkCd2FcCEv
 gERJZ8ipwWhfM/q+LMGosGpFYYXXZnvyOOnHRYnQmBPkEFg97XqaRydoV8wGBZXBDwIa
 9F/AuQkVKHtRkL07GG//IQt1wglThoUZSmCK93i65HJW85gorJAYwAoOasb6Wi6hkBfc
 ucWg==
X-Gm-Message-State: AJaThX5zbbUUyxqUuiSZkPQgF3G/H3rRmnaQOXJg4CPn7KfF4RGQlLOq
 9cdVGMo7eLi0NGwJUDLFlYU=
X-Google-Smtp-Source: AGs4zMY7v1X7cACtIAH1BUjn56gX9Moe2JXdSRBu5sgYEWDMhGFmNR+6KIVJsdXNneseUXrCgeSAYg==
X-Received: by 10.107.107.6 with SMTP id g6mr2380315ioc.149.1510174668425;
 Wed, 08 Nov 2017 12:57:48 -0800 (PST)
Received: from lylat (S010664777d9cebe3.ss.shawcable.net. [70.64.85.59])
 by smtp.gmail.com with ESMTPSA id p190sm2621979itp.36.2017.11.08.12.57.46
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Wed, 08 Nov 2017 12:57:47 -0800 (PST)
From: Alex <agrambot@HIDDEN>
To: Olaf Rogalsky <olaf.rogalsky@HIDDEN>
Subject: Re: bug#29150: Fwd: 26.0.90;
 Input decoding is sometimes skipped in TTY (xterm-mouse-mode)
References: <87y3nka4ez.fsf@HIDDEN> <87wp34a2i1.fsf@HIDDEN>
Date: Wed, 08 Nov 2017 14:57:45 -0600
In-Reply-To: <87wp34a2i1.fsf@HIDDEN> (Olaf Rogalsky's message of "Sun, 05
 Nov 2017 21:34:30 +0100")
Message-ID: <87a7zwjxo6.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 29150
Cc: Eli Zaretskii <eliz@HIDDEN>, 29150 <at> debbugs.gnu.org,
 Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Olaf Rogalsky <olaf.rogalsky@HIDDEN> writes:

> Hi,

Hi,

Thanks for looking into this. It looks like the only issue remaining is
#2 (M-mouse-1).

> PSS: I don't think, that #29143 is related. Both, `Evil-mode' *and*
>      `xterm-mouse-mode' fool around with the ?\e prefix in the
>      `input-decode-map', but they obviously do it in an incompatible
>      way.

It's not that. I checked out evil-mode's code and found out that it uses
a modified ~6 year old version of `mouse-drag-track', which evidently
doesn't play too well with recent Emacs versions.

For example, try using the definitions of `mouse-drag-region' and
`mouse-drag-track' of Emacs 24 in Emacs 25/26. Then in
`xterm-mouse-mode', releasing `mouse-1' inserts the control sequence
into the current buffer (which is what Bug#29143 is, except in
evil-mode, the characters in the sequence are not all bound to
`self-insert-command').

This old code uses `read-event', which, as you mentioned in your other
reply, doesn't use `input-decode-map'. Replacing it with:

  (aref (read-key-sequence-vector nil) 0)

fixes Bug#29143.

Eli, Stefan, does it make sense that `read-event' doesn't take into
account `input-decode-map'? If so, then is there a better alternative to
the above workaround? Perhaps there could be a new optional argument to
`read-event'?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#29150; Package emacs. Full text available.

Message received at 29150 <at> debbugs.gnu.org:


Received: (at 29150) by debbugs.gnu.org; 6 Nov 2017 21:43:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 06 16:43:43 2017
Received: from localhost ([127.0.0.1]:54712 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eBpBH-0008Mg-Bm
	for submit <at> debbugs.gnu.org; Mon, 06 Nov 2017 16:43:43 -0500
Received: from mailout06.t-online.de ([194.25.134.19]:55220)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <olaf.rogalsky@HIDDEN>) id 1eBpBF-0008MX-D7
 for 29150 <at> debbugs.gnu.org; Mon, 06 Nov 2017 16:43:41 -0500
Received: from fwd12.aul.t-online.de (fwd12.aul.t-online.de [172.20.26.241])
 by mailout06.t-online.de (Postfix) with SMTP id F2DA641CFECF;
 Mon,  6 Nov 2017 22:43:39 +0100 (CET)
Received: from blaubaer
 (rIJ--sZJ8hQHPzB7ecKu1QXzNeU5gATDctokM6xUCD9xxaSwwEkB8gpgNdcEZ5MgDU@[84.57.184.143])
 by fwd12.t-online.de with (TLSv1.2:DHE-RSA-AES256-SHA256 encrypted)
 esmtp id 1eBpBC-1mDJLc0; Mon, 6 Nov 2017 22:43:38 +0100
References: <87y3nka4ez.fsf@HIDDEN> <87wp34a2i1.fsf@HIDDEN>
 <83y3njs8i1.fsf@HIDDEN>
From: Olaf Rogalsky <olaf.rogalsky@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#29150: Fwd: 26.0.90;
 Input decoding is sometimes skipped in TTY (xterm-mouse-mode)
In-reply-to: <83y3njs8i1.fsf@HIDDEN>
Date: Mon, 06 Nov 2017 22:43:11 +0100
Message-ID: <878tfjnkwg.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-ID: rIJ--sZJ8hQHPzB7ecKu1QXzNeU5gATDctokM6xUCD9xxaSwwEkB8gpgNdcEZ5MgDU
X-TOI-MSGID: 666db8bd-9a33-4b08-8c3f-ee6cfe432dfe
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 29150
Cc: 29150 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)


Eli Zaretskii writes:

>> in case of a button down event, `describe-key' has some trickery to also
>> read the forthcoming up event. The following patch makes this trickery
>> work with xterm-mouse-mode.
>
> Thanks.  Do you understand why read-key-sequence-vector works with
> xt-mouse, while read-event doesn't?  If so, can you elaborate on that?
Unlike read-key-sequence and read-key-sequence-vector, read-event does
not use input-decode-map.  xterm-mouse-mode relies on input-decode-map to
convert special byte sequences (starting with "\e[") into proper mouse
events. read-event stops reading after the first character ("\e") of the
byte sequence -- the remaining charcters are then inserted into the
current buffer.

> Also, I take it that you assume there will be only one element in the
> array returned by read-key-sequence-vector, is that right?  If so, how
> sure are we that this will always be the case?  Because if the
> assumption could be false, this change will have Emacs wait for some
> other input, and the user might think that Emacs hanged.
Yes, that was my assumption. read-key-sequence-vector is called after a
mouse-down event was read.  If someone presses a prefix key before
releasing the mouse or if the up event is a prefix to some binding, then
strange things may happen.  I wasn't able to think of and construct a
case, in which, after the user releases the mouse button,
read-key-sequence-vector still tries to read additional characters. In
any case, \C-g will interrupt read-key-sequence-vector.  But see below.

> Anyway, in general, I'm wary of such changes, which replace one API
> for reading input by another, which works subtly differently.  We had
> in the recent past several incidents where similar changes seemed to
> work, only to reveal many moons later that some rarely-used but useful
> functionality stopped working or became semi-broken.  So I think I'd
> prefer a fix that is specific to xt-mouse (assuming that we can
> reliably detect that the clicks come from xt-mouse), and leave the
> other use cases alone.  If such a solution is possible and makes
> sense, we could even install it on the release branch.
If you are still not convinced, that read-key-sequence-vector is
harmless, then please find a modified patch below.  There I check, as
suggested, that the mouse-down event under consideration was generated
by xterm-mouse-mode.  This is quite easy to accomplish, because
xterm-mouse anyway remembers the last mouse-down event in a terminal
paramerter.

diff --git a/lisp/help.el b/lisp/help.el
index bc8035db0e..fbb9fc8cbe 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -717,7 +717,7 @@ help-read-key-sequence
         (cursor-in-echo-area t)
         saved-yank-menu)
     (unwind-protect
-        (let (key)
+        (let (key down-ev)
           ;; If yank-menu is empty, populate it temporarily, so that
           ;; "Select and Paste" menu can generate a complete event.
           (when (null (cdr yank-menu))
@@ -743,17 +743,21 @@ help-read-key-sequence
                 (let ((last-idx (1- (length key))))
                   (and (eventp (aref key last-idx))
                        (memq 'down (event-modifiers (aref key last-idx)))))
-                (or (and (eventp (aref key 0))
-                         (memq 'down (event-modifiers (aref key 0)))
+                (or (and (eventp (setq down-ev (aref key 0)))
+                         (memq 'down (event-modifiers down-ev))
                          ;; However, for the C-down-mouse-2 popup
                          ;; menu, there is no subsequent up-event.  In
                          ;; this case, the up-event is the next
                          ;; element in the supplied vector.
                          (= (length key) 1))
                     (and (> (length key) 1)
-                         (eventp (aref key 1))
-                         (memq 'down (event-modifiers (aref key 1)))))
-                (read-event))))
+                         (eventp (setq down-ev (aref key 1)))
+                         (memq 'down (event-modifiers down-ev))))
+                (if (and (terminal-parameter nil 'xterm-mouse-mode)
+                         (equal (terminal-parameter nil 'xterm-mouse-last-down)
+                                down-ev))
+                    (aref (read-key-sequence-vector nil) 0)
+                  (read-event)))))
       ;; Put yank-menu back as it was, if we changed it.
       (when saved-yank-menu
         (setq yank-menu (copy-sequence saved-yank-menu))

>> PS: It would be nice, if that person also can have a look at patch #29104
>
> It's in my queue, if no one else beats me to it.  And there, too, more
> detailed description of what you saw and what led you to your proposed
> solution might go a long way towards admitting the change sooner.
Thanks a lot.  I will comment on that patch in a separate email.

Olaf

-- 
Olaf Rogalsky
Schwörhausgasse 5
89073 Ulm
Germany




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#29150; Package emacs. Full text available.

Message received at 29150 <at> debbugs.gnu.org:


Received: (at 29150) by debbugs.gnu.org; 6 Nov 2017 15:59:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 06 10:59:58 2017
Received: from localhost ([127.0.0.1]:54410 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eBjoc-00026D-13
	for submit <at> debbugs.gnu.org; Mon, 06 Nov 2017 10:59:58 -0500
Received: from eggs.gnu.org ([208.118.235.92]:47125)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eBjoZ-00025y-Rz
 for 29150 <at> debbugs.gnu.org; Mon, 06 Nov 2017 10:59:56 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eBjoP-0005ws-HX
 for 29150 <at> debbugs.gnu.org; Mon, 06 Nov 2017 10:59:50 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41831)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eBjoP-0005wn-E9; Mon, 06 Nov 2017 10:59:45 -0500
Received: from [176.228.60.248] (port=2876 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1eBjoO-0007mx-7C; Mon, 06 Nov 2017 10:59:45 -0500
Date: Mon, 06 Nov 2017 17:59:50 +0200
Message-Id: <83y3njs8i1.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Olaf Rogalsky <olaf.rogalsky@HIDDEN>
In-reply-to: <87wp34a2i1.fsf@HIDDEN> (message from Olaf Rogalsky on Sun, 
 05 Nov 2017 21:34:30 +0100)
Subject: Re: bug#29150: Fwd: 26.0.90;
 Input decoding is sometimes skipped in TTY (xterm-mouse-mode)
References: <87y3nka4ez.fsf@HIDDEN> <87wp34a2i1.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 29150
Cc: 29150 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> From: Olaf Rogalsky <olaf.rogalsky@HIDDEN>
> Date: Sun, 05 Nov 2017 21:34:30 +0100
> 
> in case of a button down event, `describe-key' has some trickery to also
> read the forthcoming up event. The following patch makes this trickery
> work with xterm-mouse-mode.

Thanks.  Do you understand why read-key-sequence-vector works with
xt-mouse, while read-event doesn't?  If so, can you elaborate on that?

Also, I take it that you assume there will be only one element in the
array returned by read-key-sequence-vector, is that right?  If so, how
sure are we that this will always be the case?  Because if the
assumption could be false, this change will have Emacs wait for some
other input, and the user might think that Emacs hanged.

Anyway, in general, I'm wary of such changes, which replace one API
for reading input by another, which works subtly differently.  We had
in the recent past several incidents where similar changes seemed to
work, only to reveal many moons later that some rarely-used but useful
functionality stopped working or became semi-broken.  So I think I'd
prefer a fix that is specific to xt-mouse (assuming that we can
reliably detect that the clicks come from xt-mouse), and leave the
other use cases alone.  If such a solution is possible and makes
sense, we could even install it on the release branch.

> PS: It would be nice, if that person also can have a look at patch #29104

It's in my queue, if no one else beats me to it.  And there, too, more
detailed description of what you saw and what led you to your proposed
solution might go a long way towards admitting the change sooner.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#29150; Package emacs. Full text available.

Message received at 29150 <at> debbugs.gnu.org:


Received: (at 29150) by debbugs.gnu.org; 5 Nov 2017 20:34:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 05 15:34:57 2017
Received: from localhost ([127.0.0.1]:52654 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eBRdB-0008QB-PC
	for submit <at> debbugs.gnu.org; Sun, 05 Nov 2017 15:34:57 -0500
Received: from mailout04.t-online.de ([194.25.134.18]:41314)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <olaf.rogalsky@HIDDEN>) id 1eBRdA-0008Q3-3g
 for 29150 <at> debbugs.gnu.org; Sun, 05 Nov 2017 15:34:56 -0500
Received: from fwd15.aul.t-online.de (fwd15.aul.t-online.de [172.20.27.63])
 by mailout04.t-online.de (Postfix) with SMTP id 3E197419900E
 for <29150 <at> debbugs.gnu.org>; Sun,  5 Nov 2017 21:34:54 +0100 (CET)
Received: from blaubaer
 (TJ5tJsZboh0s58IALJViGYObJYGTNPUuHRthcDf9VhjkpeuHuK5IB7MRs8bDGfMgVv@[84.57.184.143])
 by fwd15.t-online.de with (TLSv1.2:DHE-RSA-AES256-SHA256 encrypted)
 esmtp id 1eBRd8-1VsHAm0; Sun, 5 Nov 2017 21:34:54 +0100
References: <87y3nka4ez.fsf@HIDDEN>
From: Olaf Rogalsky <olaf.rogalsky@HIDDEN>
To: 29150 <at> debbugs.gnu.org
Subject: Fwd: 26.0.90;
 Input decoding is sometimes skipped in TTY (xterm-mouse-mode)
Date: Sun, 05 Nov 2017 21:34:30 +0100
Message-ID: <87wp34a2i1.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-ID: TJ5tJsZboh0s58IALJViGYObJYGTNPUuHRthcDf9VhjkpeuHuK5IB7MRs8bDGfMgVv
X-TOI-MSGID: 7dce9c54-b019-4731-8717-d2dc23b735d4
X-Spam-Score: 1.7 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  Hi, in case of a button down event, `describe-key' has some
 trickery to also read the forthcoming up event. The following patch makes
 this trickery work with xterm-mouse-mode. I don't have write permission to
 the repositiory. I therefore would appreciate it very much, if someone else
 could review und submit the patch. [...] 
 Content analysis details:   (1.7 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.5 RCVD_IN_SORBS_SPAM     RBL: SORBS: sender is a spam source
 [194.25.134.18 listed in dnsbl.sorbs.net]
 1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net
 [Blocked - see <http://www.spamcop.net/bl.shtml?194.25.134.18>]
 -0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
 [194.25.134.18 listed in wl.mailspike.net]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at http://www.dnswl.org/, no
 trust [194.25.134.18 listed in list.dnswl.org]
 -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain
 -0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
X-Debbugs-Envelope-To: 29150
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.7 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  Hi, in case of a button down event, `describe-key' has some
    trickery to also read the forthcoming up event. The following patch makes
    this trickery work with xterm-mouse-mode. I don't have write permission to
    the repositiory. I therefore would appreciate it very much, if someone else
    could review und submit the patch. [...] 
 
 Content analysis details:   (1.7 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net
                [Blocked - see <http://www.spamcop.net/bl.shtml?194.25.134.18>]
  0.5 RCVD_IN_SORBS_SPAM     RBL: SORBS: sender is a spam source
                             [194.25.134.18 listed in dnsbl.sorbs.net]
 -0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
                             [194.25.134.18 listed in wl.mailspike.net]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at http://www.dnswl.org/, no
                             trust
                             [194.25.134.18 listed in list.dnswl.org]
 -0.0 RP_MATCHES_RCVD        Envelope sender domain matches handover relay domain
 -0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders

Hi,

in case of a button down event, `describe-key' has some trickery to also
read the forthcoming up event. The following patch makes this trickery
work with xterm-mouse-mode.

I don't have write permission to the repositiory. I therefore would
appreciate it very much, if someone else could review und submit the
patch.

PS: It would be nice, if that person also can have a look at patch #29104

PSS: I don't think, that #29143 is related. Both, `Evil-mode' *and*
     `xterm-mouse-mode' fool around with the ?\e prefix in the
     `input-decode-map', but they obviously do it in an incompatible
     way.


diff --git a/lisp/help.el b/lisp/help.el
index bc8035db0e..247f060f24 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -753,7 +753,7 @@ help-read-key-sequence
                     (and (> (length key) 1)
                          (eventp (aref key 1))
                          (memq 'down (event-modifiers (aref key 1)))))
-                (read-event))))
+                (aref (read-key-sequence-vector nil) 0))))
       ;; Put yank-menu back as it was, if we changed it.
       (when saved-yank-menu
         (setq yank-menu (copy-sequence saved-yank-menu))

-- 
Olaf Rogalsky
Schwörhausgasse 5
89073 Ulm
Germany




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#29150; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 5 Nov 2017 07:43:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 05 02:43:01 2017
Received: from localhost ([127.0.0.1]:51164 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eBFa8-0007YU-V3
	for submit <at> debbugs.gnu.org; Sun, 05 Nov 2017 02:43:01 -0500
Received: from eggs.gnu.org ([208.118.235.92]:48853)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <agrambot@HIDDEN>) id 1eBFa6-0007YB-Ua
 for submit <at> debbugs.gnu.org; Sun, 05 Nov 2017 02:42:59 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <agrambot@HIDDEN>) id 1eBFa0-00082S-QN
 for submit <at> debbugs.gnu.org; Sun, 05 Nov 2017 02:42:53 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
 T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:34091)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <agrambot@HIDDEN>) id 1eBFa0-00082M-My
 for submit <at> debbugs.gnu.org; Sun, 05 Nov 2017 02:42:52 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:39814)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <agrambot@HIDDEN>) id 1eBFZz-0006yh-AF
 for bug-gnu-emacs@HIDDEN; Sun, 05 Nov 2017 02:42:52 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <agrambot@HIDDEN>) id 1eBFZw-00080J-89
 for bug-gnu-emacs@HIDDEN; Sun, 05 Nov 2017 02:42:51 -0500
Received: from mail-io0-x22d.google.com ([2607:f8b0:4001:c06::22d]:49890)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <agrambot@HIDDEN>) id 1eBFZw-0007za-1b
 for bug-gnu-emacs@HIDDEN; Sun, 05 Nov 2017 02:42:48 -0500
Received: by mail-io0-x22d.google.com with SMTP id n137so12651882iod.6
 for <bug-gnu-emacs@HIDDEN>; Sun, 05 Nov 2017 00:42:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:subject:date:message-id:mime-version;
 bh=BW1Vp34tnMjueKKktySt0S3VOAd9w9BUtaHdChbGLn8=;
 b=j8Eab0KYHutxi88qBWRIM3uYUWt24wSK0GDAhydYwZ3bjCSTd7JmCmrKRO4V6OpLCa
 ty5z5Oxtrkry3PnIMQqGKhtyo9f2k92uqRJGD5o7qujkvww3+BzXCG1iLc5H4XqqJ2i+
 QmBLxFC0xJLtr0wN3RbEZAxYB/KyGrtLrnnpYfNkdsCF4Fu/9s3FzzxAHm/VBhVcxo2C
 wxCpBigCz7UyWIrPrtsqVrRzXFBRwm96FdE9/Y8UfPkUbfg6ckryp6aFOVDEbVRAFwbU
 us3o1AtbMghgr52+ZDraPA6WGMtWNNk4REYh6oylqV7GLPzwVkq8b4NHS/rzKUvWZnJI
 bvIw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:subject:date:message-id:mime-version;
 bh=BW1Vp34tnMjueKKktySt0S3VOAd9w9BUtaHdChbGLn8=;
 b=EupOx4MWW26F6WDnJNajQueTow9MNFkG+CjS7L/xEI92P+BFz1n95xPM1JN/ZeydGv
 maz+z0JHdOXk9b3/L6UkUGMdfyRDChUewrCZ9ftHCCx7z+FUKkzTxfHqCoYMT0hsCHG9
 BzUVhPQeP9KeUZN8m9oiZ+SBbV1uvDwsodpd5J5kcrd908+1z7l2oUCNzgL0gTi9Qvng
 bdvKl9QeBrOMQCuF/VAf52CVe6kY3SxkOdo3TbHEQWhIdV4j1M1mqJUyKK4h3WjaDHMZ
 piKtxDJ0rcddrDmKm7jjtYwlaYyGqqjCN/q1HCRU8MLtyIiiOQlwOD0UAR4OwO7Iopds
 CZJw==
X-Gm-Message-State: AMCzsaUSOT3eQR1FQt+ny1BI+kyn4YfgzeafMdaQyW/XnSk83ZCyyoAO
 up+m9SabfyAS3fQbQ+S8y26OtQ==
X-Google-Smtp-Source: ABhQp+SvEp5AXJ166pnAh/5TowpcI2KRV48HMbCBWDS/+sgNEMOK+Rz3dCMfla7Qx7sGftS9zOAfzA==
X-Received: by 10.107.112.11 with SMTP id l11mr12806926ioc.214.1509867766873; 
 Sun, 05 Nov 2017 00:42:46 -0700 (PDT)
Received: from lylat (S010664777d9cebe3.ss.shawcable.net. [70.64.85.59])
 by smtp.gmail.com with ESMTPSA id b185sm4641650ioa.24.2017.11.05.00.42.45
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Sun, 05 Nov 2017 00:42:45 -0700 (PDT)
From: Alex <agrambot@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 26.0.90; Input decoding is sometimes skipped in TTY (xterm-mouse-mode)
Date: Sun, 05 Nov 2017 01:42:02 -0600
Message-ID: <87zi81yxx1.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

I don't know how to reproduce this outside of `xterm-mouse-mode', but
this seems to be an issue with `input-decode-map' in TTY.

Examples (from emacs -Q -nw with `xterm-mouse-mode' enabled):

1. C-h k <mouse-1>

This will open the help buffer for the click, but also insert the
control sequence for the click.

This also happens when modifying the click with Alt xor Ctrl.

2. <M-mouse-1>

This will insert the click control sequence when releasing the button.

3. I'm not sure, but I wouldn't be surprised if Bug#29143 is also an
example of this. I don't know why it only happens in evil-mode, though.


I don't see anything on the `xterm-mouse-mode' side that would cause the
above since in `turn-on-xterm-mouse-tracking-on-terminal' "\e[<" (the
prefix of the control sequences inserted above) is added to
`input-decode-map', and its binding, `xterm-mouse--read-event-sequence',
isn't called whenever the sequence is inserted.




Acknowledgement sent to Alex <agrambot@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#29150; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 8 Nov 2017 21:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.