GNU bug report logs - #29272
26.0.90; "C-h k C-mouse-3" followed by menu selection asks for more keys

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: Eli Zaretskii <eliz@HIDDEN>; Keywords: confirmed; dated Sun, 12 Nov 2017 11:24:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added tag(s) confirmed. Request was from Noam Postavsky <npostavs@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 29272) by debbugs.gnu.org; 19 Nov 2017 20:29:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 19 15:29:52 2017
Received: from localhost ([127.0.0.1]:47970 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eGWDw-0001Is-4X
	for submit <at> debbugs.gnu.org; Sun, 19 Nov 2017 15:29:52 -0500
Received: from ocolin.muc.de ([193.149.48.4]:55368 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1eGWDv-0001Ik-3b
 for 29272 <at> debbugs.gnu.org; Sun, 19 Nov 2017 15:29:51 -0500
Received: (qmail 37974 invoked by uid 3782); 19 Nov 2017 20:29:46 -0000
Received: from acm.muc.de (p548C7514.dip0.t-ipconnect.de [84.140.117.20]) by
 colin.muc.de (tmda-ofmipd) with ESMTP;
 Sun, 19 Nov 2017 21:29:45 +0100
Received: (qmail 19008 invoked by uid 1000); 19 Nov 2017 20:26:48 -0000
Date: Sun, 19 Nov 2017 20:26:48 +0000
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#29272: 26.0.90; "C-h k C-mouse-3" followed by menu selection
 asks for more keys
Message-ID: <20171119202648.GD9922@ACM>
References: <83shdjn3ju.fsf@HIDDEN> <83mv3rn02t.fsf@HIDDEN>
 <20171114205449.GA8025@ACM> <83r2svg72w.fsf@HIDDEN>
 <20171119161943.GA9922@ACM> <83lgj2dtfs.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <83lgj2dtfs.fsf@HIDDEN>
User-Agent: Mutt/1.7.2 (2016-11-26)
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: 1.3 (+)
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:  Hello, Eli On Sun, Nov 19, 2017 at 20:17:27 +0200,
 Eli Zaretskii
 wrote: > > Date: Sun, 19 Nov 2017 16:19:43 +0000 > > Cc: 29272 <at> debbugs.gnu.org
 > > From: Alan Mackenzie <acm@HIDDEN> > > > I only see this in a text-mode
 frame (in my case it's "<mouse-1> > > > <indent-pp-sexp>"). On GUI frame,
 there's no "translation". [...] 
 Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -0.0 T_RP_MATCHES_RCVD      Envelope sender domain matches handover relay
 domain
 1.3 GAPPY_SUBJECT          Subject: contains G.a.p.p.y-T.e.x.t
X-Debbugs-Envelope-To: 29272
Cc: 29272 <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: 1.3 (+)
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:  Hello, Eli On Sun, Nov 19, 2017 at 20:17:27 +0200, Eli Zaretskii
    wrote: > > Date: Sun, 19 Nov 2017 16:19:43 +0000 > > Cc: 29272 <at> debbugs.gnu.org
    > > From: Alan Mackenzie <acm@HIDDEN> > > > I only see this in a text-mode
    frame (in my case it's "<mouse-1> > > > <indent-pp-sexp>"). On GUI frame,
    there's no "translation". [...] 
 
 Content analysis details:   (1.3 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -0.0 T_RP_MATCHES_RCVD      Envelope sender domain matches handover relay
                             domain
  1.3 GAPPY_SUBJECT          Subject: contains G.a.p.p.y-T.e.x.t

Hello, Eli

On Sun, Nov 19, 2017 at 20:17:27 +0200, Eli Zaretskii wrote:
> > Date: Sun, 19 Nov 2017 16:19:43 +0000
> > Cc: 29272 <at> debbugs.gnu.org
> > From: Alan Mackenzie <acm@HIDDEN>

> > > I only see this in a text-mode frame (in my case it's "<mouse-1>
> > > <indent-pp-sexp>").  On GUI frame, there's no "translation".

> > Not on an X-Windows frame - X seems to handle all the mouse-movement and
> > intermediate click events itself.

> Crystal ball says that your "X-Windows" is an Emacs build with some
> toolkit.

Indeed.  The default GTK, I believe.  I usually work on a tty, so I've
never bothered too much about it.

> I'm guessing that a non-toolkit build on X will have the same problem
> as we see on text-mode frames, because in a non-toolkit build Emacs
> handles all the mouse clicks in a menu.

I suppose so.

Still, we're getting fixed on master.  I agree with you that it's too
big a change, and too small a bug to justify putting it on the release
branch.

-- 
Alan Mackenzie (Nuremberg, Germany).




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

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


Received: (at 29272) by debbugs.gnu.org; 19 Nov 2017 18:17:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 19 13:17:51 2017
Received: from localhost ([127.0.0.1]:47908 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eGUAB-0006nU-HF
	for submit <at> debbugs.gnu.org; Sun, 19 Nov 2017 13:17:51 -0500
Received: from eggs.gnu.org ([208.118.235.92]:54015)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eGUAA-0006nH-S2
 for 29272 <at> debbugs.gnu.org; Sun, 19 Nov 2017 13:17:51 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eGU9z-0004r1-Fm
 for 29272 <at> debbugs.gnu.org; Sun, 19 Nov 2017 13:17:43 -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_40,GAPPY_SUBJECT,
 T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52482)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eGU9z-0004qv-CX; Sun, 19 Nov 2017 13:17:39 -0500
Received: from [176.228.60.248] (port=2155 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 1eGU9y-0000QH-D4; Sun, 19 Nov 2017 13:17:39 -0500
Date: Sun, 19 Nov 2017 20:17:27 +0200
Message-Id: <83lgj2dtfs.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
In-reply-to: <20171119161943.GA9922@ACM> (message from Alan Mackenzie on Sun, 
 19 Nov 2017 16:19:43 +0000)
Subject: Re: bug#29272: 26.0.90; "C-h k C-mouse-3" followed by menu selection
 asks for more keys
References: <83shdjn3ju.fsf@HIDDEN> <83mv3rn02t.fsf@HIDDEN>
 <20171114205449.GA8025@ACM> <83r2svg72w.fsf@HIDDEN>
 <20171119161943.GA9922@ACM>
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: -3.7 (---)
X-Debbugs-Envelope-To: 29272
Cc: 29272 <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: -3.7 (---)

> Date: Sun, 19 Nov 2017 16:19:43 +0000
> Cc: 29272 <at> debbugs.gnu.org
> From: Alan Mackenzie <acm@HIDDEN>
> 
> > I only see this in a text-mode frame (in my case it's "<mouse-1>
> > <indent-pp-sexp>").  On GUI frame, there's no "translation".
> 
> Not on an X-Windows frame - X seems to handle all the mouse-movement and
> intermediate click events itself.

Crystal ball says that your "X-Windows" is an Emacs build with some
toolkit.  I'm guessing that a non-toolkit build on X will have the
same problem as we see on text-mode frames, because in a non-toolkit
build Emacs handles all the mouse clicks in a menu.




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

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


Received: (at 29272) by debbugs.gnu.org; 19 Nov 2017 17:57:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 19 12:57:27 2017
Received: from localhost ([127.0.0.1]:47779 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eGTqQ-0006Bv-VZ
	for submit <at> debbugs.gnu.org; Sun, 19 Nov 2017 12:57:27 -0500
Received: from ocolin.muc.de ([193.149.48.4]:20991 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1eGTqP-0006Bn-D5
 for 29272 <at> debbugs.gnu.org; Sun, 19 Nov 2017 12:57:25 -0500
Received: (qmail 93597 invoked by uid 3782); 19 Nov 2017 17:57:24 -0000
Received: from acm.muc.de (p548C7514.dip0.t-ipconnect.de [84.140.117.20]) by
 colin.muc.de (tmda-ofmipd) with ESMTP;
 Sun, 19 Nov 2017 18:57:23 +0100
Received: (qmail 10576 invoked by uid 1000); 19 Nov 2017 17:54:26 -0000
Date: Sun, 19 Nov 2017 17:54:26 +0000
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#29272: 26.0.90; "C-h k C-mouse-3" followed by menu selection
 asks for more keys
Message-ID: <20171119175426.GC9922@ACM>
References: <83shdjn3ju.fsf@HIDDEN> <83mv3rn02t.fsf@HIDDEN>
 <20171114205449.GA8025@ACM> <83r2svg72w.fsf@HIDDEN>
 <20171119161943.GA9922@ACM> <83shdadwsy.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <83shdadwsy.fsf@HIDDEN>
User-Agent: Mutt/1.7.2 (2016-11-26)
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: 1.3 (+)
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:  Hello, Eli. On Sun, Nov 19, 2017 at 19:04:45 +0200,
 Eli Zaretskii
 wrote: > > Date: Sun, 19 Nov 2017 16:19:43 +0000 > > Cc: 29272 <at> debbugs.gnu.org
 > > From: Alan Mackenzie <acm@HIDDEN> > > > In any case, this is a much more
 minor bug than the one I reported, so > > > please install your changes on
 the release branch. Bonus points if > > > you can find where does the
 "translation" come from. [...] 
 Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -0.0 T_RP_MATCHES_RCVD      Envelope sender domain matches handover relay
 domain
 1.3 GAPPY_SUBJECT          Subject: contains G.a.p.p.y-T.e.x.t
X-Debbugs-Envelope-To: 29272
Cc: 29272 <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: 1.3 (+)
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:  Hello, Eli. On Sun, Nov 19, 2017 at 19:04:45 +0200, Eli Zaretskii
    wrote: > > Date: Sun, 19 Nov 2017 16:19:43 +0000 > > Cc: 29272 <at> debbugs.gnu.org
    > > From: Alan Mackenzie <acm@HIDDEN> > > > In any case, this is a much more
    minor bug than the one I reported, so > > > please install your changes on
    the release branch. Bonus points if > > > you can find where does the "translation"
    come from. [...] 
 
 Content analysis details:   (1.3 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -0.0 T_RP_MATCHES_RCVD      Envelope sender domain matches handover relay
                             domain
  1.3 GAPPY_SUBJECT          Subject: contains G.a.p.p.y-T.e.x.t

Hello, Eli.

On Sun, Nov 19, 2017 at 19:04:45 +0200, Eli Zaretskii wrote:
> > Date: Sun, 19 Nov 2017 16:19:43 +0000
> > Cc: 29272 <at> debbugs.gnu.org
> > From: Alan Mackenzie <acm@HIDDEN>

> > > In any case, this is a much more minor bug than the one I reported, so
> > > please install your changes on the release branch.  Bonus points if
> > > you can find where does the "translation" come from.

> > I claim my prize.  :-)

> > The following patch (which absolutely requires the patch to bug #29349
> > "read_key_sequence is only partially recursive.  This is a bug." to work)
> > fixes the above glitch on Linux tty (and possibly on other platforms).
> > It works by disregarding the "intermediate" events in UNTRANSLATED when
> > comparing the processed key sequence with the UNTRANSLATED string of
> > events:

> OK, but I still would like to understand where did that "translation"
> come from.  I don't think I get that from the above description.

It comes from the menu processing with GPM.  Each mouse click (but I'm
not sure about mouse movements) in a menu is entered into
read_key_sequence's raw event buffer.  This happens in the recursive call
of read_key_sequence which happens when r_k_s calls read_key, and a menu
gets processed.

> Thanks.

-- 
Alan Mackenzie (Nuremberg, Germany).




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

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


Received: (at 29272) by debbugs.gnu.org; 19 Nov 2017 17:45:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 19 12:45:08 2017
Received: from localhost ([127.0.0.1]:47764 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eGTeW-0005v7-AB
	for submit <at> debbugs.gnu.org; Sun, 19 Nov 2017 12:45:08 -0500
Received: from eggs.gnu.org ([208.118.235.92]:43476)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eGTeV-0005uw-6B
 for 29272 <at> debbugs.gnu.org; Sun, 19 Nov 2017 12:45:07 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eGTeK-0003bz-Rv
 for 29272 <at> debbugs.gnu.org; Sun, 19 Nov 2017 12:45:01 -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.4 required=5.0 tests=BAYES_05,GAPPY_SUBJECT,
 T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51892)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eGTeK-0003bv-OJ; Sun, 19 Nov 2017 12:44:56 -0500
Received: from [176.228.60.248] (port=2130 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 1eGTeK-0007d4-1y; Sun, 19 Nov 2017 12:44:56 -0500
Date: Sun, 19 Nov 2017 19:44:46 +0200
Message-Id: <83po8eduy9.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: acm@HIDDEN
In-reply-to: <83shdadwsy.fsf@HIDDEN> (message from Eli Zaretskii on Sun, 19
 Nov 2017 19:04:45 +0200)
Subject: Re: bug#29272: 26.0.90;
 "C-h k C-mouse-3" followed by menu selection asks for more keys
References: <83shdjn3ju.fsf@HIDDEN> <83mv3rn02t.fsf@HIDDEN>
 <20171114205449.GA8025@ACM> <83r2svg72w.fsf@HIDDEN>
 <20171119161943.GA9922@ACM> <83shdadwsy.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: -3.7 (---)
X-Debbugs-Envelope-To: 29272
Cc: 29272 <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: -3.7 (---)

> Date: Sun, 19 Nov 2017 19:04:45 +0200
> From: Eli Zaretskii <eliz@HIDDEN>
> Cc: 29272 <at> debbugs.gnu.org
> 
> OK, but I still would like to understand where did that "translation"
> come from.  I don't think I get that from the above description.

Specifically, can you walk me through help-key-description, and tell
what values do you see there.  For example, where did mouse-1 come
from, if the original mouse click was C-mouse-3?  Isn't that the root
cause?




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

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


Received: (at 29272) by debbugs.gnu.org; 19 Nov 2017 17:05:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 19 12:05:06 2017
Received: from localhost ([127.0.0.1]:47732 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eGT1m-00051Z-FP
	for submit <at> debbugs.gnu.org; Sun, 19 Nov 2017 12:05:06 -0500
Received: from eggs.gnu.org ([208.118.235.92]:34749)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eGT1l-00050z-4E
 for 29272 <at> debbugs.gnu.org; Sun, 19 Nov 2017 12:05:05 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eGT1b-0002ha-I9
 for 29272 <at> debbugs.gnu.org; Sun, 19 Nov 2017 12:05:00 -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_40,GAPPY_SUBJECT,
 T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51070)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eGT1b-0002hU-EU; Sun, 19 Nov 2017 12:04:55 -0500
Received: from [176.228.60.248] (port=2106 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 1eGT1a-0002uV-V7; Sun, 19 Nov 2017 12:04:55 -0500
Date: Sun, 19 Nov 2017 19:04:45 +0200
Message-Id: <83shdadwsy.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
In-reply-to: <20171119161943.GA9922@ACM> (message from Alan Mackenzie on Sun, 
 19 Nov 2017 16:19:43 +0000)
Subject: Re: bug#29272: 26.0.90; "C-h k C-mouse-3" followed by menu selection
 asks for more keys
References: <83shdjn3ju.fsf@HIDDEN> <83mv3rn02t.fsf@HIDDEN>
 <20171114205449.GA8025@ACM> <83r2svg72w.fsf@HIDDEN>
 <20171119161943.GA9922@ACM>
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: -3.7 (---)
X-Debbugs-Envelope-To: 29272
Cc: 29272 <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: -3.7 (---)

> Date: Sun, 19 Nov 2017 16:19:43 +0000
> Cc: 29272 <at> debbugs.gnu.org
> From: Alan Mackenzie <acm@HIDDEN>
> 
> > In any case, this is a much more minor bug than the one I reported, so
> > please install your changes on the release branch.  Bonus points if
> > you can find where does the "translation" come from.
> 
> I claim my prize.  :-)
> 
> The following patch (which absolutely requires the patch to bug #29349
> "read_key_sequence is only partially recursive.  This is a bug." to work)
> fixes the above glitch on Linux tty (and possibly on other platforms).
> It works by disregarding the "intermediate" events in UNTRANSLATED when
> comparing the processed key sequence with the UNTRANSLATED string of
> events:

OK, but I still would like to understand where did that "translation"
come from.  I don't think I get that from the above description.

Thanks.




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

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


Received: (at 29272) by debbugs.gnu.org; 19 Nov 2017 16:22:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 19 11:22:48 2017
Received: from localhost ([127.0.0.1]:47706 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eGSMo-000449-6B
	for submit <at> debbugs.gnu.org; Sun, 19 Nov 2017 11:22:48 -0500
Received: from ocolin.muc.de ([193.149.48.4]:15858 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1eGSMm-000441-S5
 for 29272 <at> debbugs.gnu.org; Sun, 19 Nov 2017 11:22:45 -0500
Received: (qmail 67421 invoked by uid 3782); 19 Nov 2017 16:22:41 -0000
Received: from acm.muc.de (p548C7514.dip0.t-ipconnect.de [84.140.117.20]) by
 colin.muc.de (tmda-ofmipd) with ESMTP;
 Sun, 19 Nov 2017 17:22:40 +0100
Received: (qmail 10004 invoked by uid 1000); 19 Nov 2017 16:19:43 -0000
Date: Sun, 19 Nov 2017 16:19:43 +0000
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#29272: 26.0.90; "C-h k C-mouse-3" followed by menu selection
 asks for more keys
Message-ID: <20171119161943.GA9922@ACM>
References: <83shdjn3ju.fsf@HIDDEN> <83mv3rn02t.fsf@HIDDEN>
 <20171114205449.GA8025@ACM> <83r2svg72w.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <83r2svg72w.fsf@HIDDEN>
User-Agent: Mutt/1.7.2 (2016-11-26)
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: 1.3 (+)
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:  Hello, Eli. On Sat, Nov 18, 2017 at 13:27:35 +0200,
 Eli Zaretskii
 wrote: > > Date: Tue, 14 Nov 2017 20:54:49 +0000 > > Cc: 29272 <at> debbugs.gnu.org
 > > From: Alan Mackenzie <acm@HIDDEN> > > The following patch attempts to
 catch and filter out obtrusive events. > > Could you try it out, please,
 even though it's not perfect (see below). > > It's based on the emacs-26
 branch: [...] 
 Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -0.0 T_RP_MATCHES_RCVD      Envelope sender domain matches handover relay
 domain
 1.3 GAPPY_SUBJECT          Subject: contains G.a.p.p.y-T.e.x.t
X-Debbugs-Envelope-To: 29272
Cc: 29272 <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: 1.3 (+)
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:  Hello, Eli. On Sat, Nov 18, 2017 at 13:27:35 +0200, Eli Zaretskii
    wrote: > > Date: Tue, 14 Nov 2017 20:54:49 +0000 > > Cc: 29272 <at> debbugs.gnu.org
    > > From: Alan Mackenzie <acm@HIDDEN> > > The following patch attempts to
    catch and filter out obtrusive events. > > Could you try it out, please,
   even though it's not perfect (see below). > > It's based on the emacs-26 branch:
    [...] 
 
 Content analysis details:   (1.3 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -0.0 T_RP_MATCHES_RCVD      Envelope sender domain matches handover relay
                             domain
  1.3 GAPPY_SUBJECT          Subject: contains G.a.p.p.y-T.e.x.t

Hello, Eli.

On Sat, Nov 18, 2017 at 13:27:35 +0200, Eli Zaretskii wrote:
> > Date: Tue, 14 Nov 2017 20:54:49 +0000
> > Cc: 29272 <at> debbugs.gnu.org
> > From: Alan Mackenzie <acm@HIDDEN>

> > The following patch attempts to catch and filter out obtrusive events.
> > Could you try it out, please, even though it's not perfect (see below).
> > It's based on the emacs-26 branch:

> Thanks, this seems to fix the problem.  I take it that you've verified
> it doesn't re-introduce the original bug?

> > However, the problem is that in C-h k  C-mouse-3
> > <select-something-from-the-menus>, we get a spurious "translation"
> > message in *Help*, looking something like:

> >     <C-down-mouse-3> <file> <new-file> (translated from <mouse-1> <new-file>) at
> >     that spot runs the command find-file (found in global-map), which is an
> >     interactive compiled Lisp function in `files.el'.

> > That was from a Linux tty session using gpm.  In X, I got the message

> >     .... (translated from <C-down-mouse-3> <C-down-mouse-3> ....)

> I only see this in a text-mode frame (in my case it's "<mouse-1>
> <indent-pp-sexp>").  On GUI frame, there's no "translation".

Not on an X-Windows frame - X seems to handle all the mouse-movement and
intermediate click events itself.  On a linux tty with GPM, you do indeed
see these intermediate events.

> > .  I don't believe this glitch has to do with my patch - I think it's
> > been there for some while, but this bug has prevented it being seen
> > before.

> I think you are right, as I see the same problem in Emacs 24.5.

> In any case, this is a much more minor bug than the one I reported, so
> please install your changes on the release branch.  Bonus points if
> you can find where does the "translation" come from.

I claim my prize.  :-)

The following patch (which absolutely requires the patch to bug #29349
"read_key_sequence is only partially recursive.  This is a bug." to work)
fixes the above glitch on Linux tty (and possibly on other platforms).
It works by disregarding the "intermediate" events in UNTRANSLATED when
comparing the processed key sequence with the UNTRANSLATED string of
events:



diff --git a/lisp/help.el b/lisp/help.el
index 212e3679da..f5192e1902 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -583,14 +583,66 @@ where-is
 	  (princ string)))))
   nil)
 
+(defun help--equivalent-sequence-p (key untranslated)
+  "Is KEY a (possibly translated) version of UNTRANSLATED?
+If so return t, otherwise return nil.
+
+KEY is a key sequence, either a string or a vector.  UNTRANSLATED
+is a vector of events which gave rise to KEY, typically the output from
+`this-single-command-raw-keys'.
+
+The idea here is that for menu structure key sequences,
+UNTRANSLATED in certain environments contains things like
+<mouse-movement> and intermediate mouse button presses.  These
+will be disregarded in the comparison between KEY and
+UNTRANSLATED."
+  (let* ((len-key (length key))
+	 (len-unt (length untranslated))
+	 (key-idx 0)
+	 (unt-idx 0)
+	 key-elt unt-elt mods)
+    (cond
+     ((and (stringp key)
+	   (eq len-key len-unt))
+      (while (and (< key-idx len-key)
+		  (eq (aref key key-idx)
+		      (aref untranslated key-idx)))
+	(setq key-idx (1+ key-idx)))
+      (eq key-idx len-key))
+     ((vectorp key)
+      ;; In this while go round one elt of `key' each time round
+      (while
+	  (and (< key-idx len-key)
+	       (< unt-idx len-unt)
+	       (progn
+		 (setq key-elt (aref key key-idx))
+		 ;; In this while, skip an intermediate mouse click, etc.
+		 ;; from `untranslated' each time round.
+		 (while
+		     (and
+		      (< unt-idx len-unt)
+		      (progn
+			(setq unt-elt (aref untranslated unt-idx))
+			(not (eq unt-elt key-elt)))
+		      (progn
+			(setq mods (event-modifiers unt-elt))
+			(or (eq (car-safe unt-elt) 'mouse-movement)
+			    (cl-intersection '(click double triple drag down)
+					     mods))))
+		   (setq unt-idx (1+ unt-idx)))
+		 (eq unt-elt key-elt)))
+	(setq key-idx (1+ key-idx)
+	      unt-idx (1+ unt-idx)))
+      (eq key-idx len-key)))))
+
 (defun help-key-description (key untranslated)
   (let ((string (key-description key)))
     (if (or (not untranslated)
 	    (and (eq (aref untranslated 0) ?\e) (not (eq (aref key 0) ?\e))))
 	string
-      (let ((otherstring (key-description untranslated)))
-	(if (equal string otherstring)
-	    string
+      (if (help--equivalent-sequence-p key untranslated)
+          string
+        (let ((otherstring (key-description untranslated)))
 	  (format "%s (translated from %s)" string otherstring))))))
 
 (defun help--analyze-key (key untranslated)



> Thanks.

-- 
Alan Mackenzie (Nuremberg, Germany).




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

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


Received: (at 29272) by debbugs.gnu.org; 18 Nov 2017 15:18:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 18 10:18:37 2017
Received: from localhost ([127.0.0.1]:46503 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eG4tA-0000uR-RH
	for submit <at> debbugs.gnu.org; Sat, 18 Nov 2017 10:18:37 -0500
Received: from ocolin.muc.de ([193.149.48.4]:54565 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1eG4t8-0000uH-9u
 for 29272 <at> debbugs.gnu.org; Sat, 18 Nov 2017 10:18:34 -0500
Received: (qmail 45366 invoked by uid 3782); 18 Nov 2017 15:18:30 -0000
Received: from acm.muc.de (p548C78EA.dip0.t-ipconnect.de [84.140.120.234]) by
 colin.muc.de (tmda-ofmipd) with ESMTP;
 Sat, 18 Nov 2017 16:18:29 +0100
Received: (qmail 17938 invoked by uid 1000); 18 Nov 2017 15:15:41 -0000
Date: Sat, 18 Nov 2017 15:15:41 +0000
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#29272: 26.0.90; "C-h k C-mouse-3" followed by menu selection
 asks for more keys
Message-ID: <20171118151541.GB3819@ACM>
References: <83shdjn3ju.fsf@HIDDEN> <83mv3rn02t.fsf@HIDDEN>
 <20171114205449.GA8025@ACM> <83r2svg72w.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <83r2svg72w.fsf@HIDDEN>
User-Agent: Mutt/1.7.2 (2016-11-26)
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: 1.3 (+)
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:  Hello, Eli. On Sat, Nov 18, 2017 at 13:27:35 +0200,
 Eli Zaretskii
 wrote: > > Date: Tue, 14 Nov 2017 20:54:49 +0000 > > Cc: 29272 <at> debbugs.gnu.org
 > > From: Alan Mackenzie <acm@HIDDEN> > > The following patch attempts to
 catch and filter out obtrusive events. > > Could you try it out, please,
 even though it's not perfect (see below). > > It's based on the emacs-26
 branch: [...] 
 Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain
 1.3 GAPPY_SUBJECT          Subject: contains G.a.p.p.y-T.e.x.t
X-Debbugs-Envelope-To: 29272
Cc: 29272 <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: 1.3 (+)
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:  Hello, Eli. On Sat, Nov 18, 2017 at 13:27:35 +0200, Eli Zaretskii
    wrote: > > Date: Tue, 14 Nov 2017 20:54:49 +0000 > > Cc: 29272 <at> debbugs.gnu.org
    > > From: Alan Mackenzie <acm@HIDDEN> > > The following patch attempts to
    catch and filter out obtrusive events. > > Could you try it out, please,
   even though it's not perfect (see below). > > It's based on the emacs-26 branch:
    [...] 
 
 Content analysis details:   (1.3 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -0.0 RP_MATCHES_RCVD        Envelope sender domain matches handover relay domain
  1.3 GAPPY_SUBJECT          Subject: contains G.a.p.p.y-T.e.x.t

Hello, Eli.

On Sat, Nov 18, 2017 at 13:27:35 +0200, Eli Zaretskii wrote:
> > Date: Tue, 14 Nov 2017 20:54:49 +0000
> > Cc: 29272 <at> debbugs.gnu.org
> > From: Alan Mackenzie <acm@HIDDEN>

> > The following patch attempts to catch and filter out obtrusive events.
> > Could you try it out, please, even though it's not perfect (see below).
> > It's based on the emacs-26 branch:

> Thanks, this seems to fix the problem.  I take it that you've verified
> it doesn't re-introduce the original bug?

> > However, the problem is that in C-h k  C-mouse-3
> > <select-something-from-the-menus>, we get a spurious "translation"
> > message in *Help*, looking something like:

> >     <C-down-mouse-3> <file> <new-file> (translated from <mouse-1> <new-file>) at
> >     that spot runs the command find-file (found in global-map), which is an
> >     interactive compiled Lisp function in `files.el'.

> > That was from a Linux tty session using gpm.  In X, I got the message

> >     .... (translated from <C-down-mouse-3> <C-down-mouse-3> ....)

> I only see this in a text-mode frame (in my case it's "<mouse-1>
> <indent-pp-sexp>").  On GUI frame, there's no "translation".

> > .  I don't believe this glitch has to do with my patch - I think it's
> > been there for some while, but this bug has prevented it being seen
> > before.

> I think you are right, as I see the same problem in Emacs 24.5.

> In any case, this is a much more minor bug than the one I reported, so
> please install your changes on the release branch.

DONE.  Though I changed the timeout from 0.001s to 0.01s, because I'd had
a bit of trouble with the shorter timeout with edebug in operation.

> Bonus points if you can find where does the "translation" come from.

I understand that, now.  If I can fix bug #29349 (the one I reported this
morning about read_key_sequence not being properly recursive), I can fix
the problems here with C-mouse-3 on Linux TTYs with GPM.  There might
also be problems on MS-Windows, though I haven't been able to verify or
test this at all.

> Thanks.

-- 
Alan Mackenzie (Nuremberg, Germany).




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

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


Received: (at 29272) by debbugs.gnu.org; 18 Nov 2017 11:27:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 18 06:27:59 2017
Received: from localhost ([127.0.0.1]:45604 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eG1Hz-00024n-6U
	for submit <at> debbugs.gnu.org; Sat, 18 Nov 2017 06:27:59 -0500
Received: from eggs.gnu.org ([208.118.235.92]:56393)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eG1Hx-00024Z-Fl
 for 29272 <at> debbugs.gnu.org; Sat, 18 Nov 2017 06:27:57 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eG1Hp-0001dc-5g
 for 29272 <at> debbugs.gnu.org; Sat, 18 Nov 2017 06:27:52 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: **
X-Spam-Status: No, score=2.8 required=5.0 tests=BAYES_50,GAPPY_SUBJECT,
 RP_MATCHES_RCVD autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55738)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eG1Hp-0001dS-2D; Sat, 18 Nov 2017 06:27:49 -0500
Received: from [176.228.60.248] (port=4656 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 1eG1Ho-00063k-9E; Sat, 18 Nov 2017 06:27:48 -0500
Date: Sat, 18 Nov 2017 13:27:35 +0200
Message-Id: <83r2svg72w.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
In-reply-to: <20171114205449.GA8025@ACM> (message from Alan Mackenzie on Tue, 
 14 Nov 2017 20:54:49 +0000)
Subject: Re: bug#29272: 26.0.90; "C-h k C-mouse-3" followed by menu selection
 asks for more keys
References: <83shdjn3ju.fsf@HIDDEN>
 <83mv3rn02t.fsf@HIDDEN> <20171114205449.GA8025@ACM>
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: -3.7 (---)
X-Debbugs-Envelope-To: 29272
Cc: 29272 <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: -3.7 (---)

> Date: Tue, 14 Nov 2017 20:54:49 +0000
> Cc: 29272 <at> debbugs.gnu.org
> From: Alan Mackenzie <acm@HIDDEN>
> 
> You're not kidding about the refactoring.  ;-)

No, not at all.

> The following patch attempts to catch and filter out obtrusive events.
> Could you try it out, please, even though it's not perfect (see below).
> It's based on the emacs-26 branch:

Thanks, this seems to fix the problem.  I take it that you've verified
it doesn't re-introduce the original bug?

> However, the problem is that in C-h k  C-mouse-3
> <select-something-from-the-menus>, we get a spurious "translation"
> message in *Help*, looking something like:
> 
>     <C-down-mouse-3> <file> <new-file> (translated from <mouse-1> <new-file>) at
>     that spot runs the command find-file (found in global-map), which is an
>     interactive compiled Lisp function in `files.el'.
> 
> That was from a Linux tty session using gpm.  In X, I got the message
> 
>     .... (translated from <C-down-mouse-3> <C-down-mouse-3> ....)

I only see this in a text-mode frame (in my case it's "<mouse-1>
<indent-pp-sexp>").  On GUI frame, there's no "translation".

> .  I don't believe this glitch has to do with my patch - I think it's
> been there for some while, but this bug has prevented it being seen
> before.

I think you are right, as I see the same problem in Emacs 24.5.

In any case, this is a much more minor bug than the one I reported, so
please install your changes on the release branch.  Bonus points if
you can find where does the "translation" come from.

Thanks.




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

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


Received: (at 29272) by debbugs.gnu.org; 14 Nov 2017 20:56:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 14 15:56:57 2017
Received: from localhost ([127.0.0.1]:40619 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eEiGP-00030b-Cl
	for submit <at> debbugs.gnu.org; Tue, 14 Nov 2017 15:56:57 -0500
Received: from ocolin.muc.de ([193.149.48.4]:14615 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1eEiGO-00030T-8q
 for 29272 <at> debbugs.gnu.org; Tue, 14 Nov 2017 15:56:57 -0500
Received: (qmail 9709 invoked by uid 3782); 14 Nov 2017 20:56:52 -0000
Received: from acm.muc.de (p548C6DFA.dip0.t-ipconnect.de [84.140.109.250]) by
 colin.muc.de (tmda-ofmipd) with ESMTP;
 Tue, 14 Nov 2017 21:56:51 +0100
Received: (qmail 8132 invoked by uid 1000); 14 Nov 2017 20:54:49 -0000
Date: Tue, 14 Nov 2017 20:54:49 +0000
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#29272: 26.0.90; "C-h k C-mouse-3" followed by menu selection
 asks for more keys
Message-ID: <20171114205449.GA8025@ACM>
References: <83shdjn3ju.fsf@HIDDEN>
 <83mv3rn02t.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <83mv3rn02t.fsf@HIDDEN>
User-Agent: Mutt/1.7.2 (2016-11-26)
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: 1.3 (+)
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:  Hello, Eli. On Sun, Nov 12, 2017 at 14:38:50 +0200,
 Eli Zaretskii
 wrote: > > Date: Sun, 12 Nov 2017 13:23:49 +0200 > > From: Eli Zaretskii
 <eliz@HIDDEN> > > To reproduce: [...] 
 Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain
 1.3 GAPPY_SUBJECT          Subject: contains G.a.p.p.y-T.e.x.t
X-Debbugs-Envelope-To: 29272
Cc: 29272 <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: 1.3 (+)
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:  Hello, Eli. On Sun, Nov 12, 2017 at 14:38:50 +0200, Eli Zaretskii
    wrote: > > Date: Sun, 12 Nov 2017 13:23:49 +0200 > > From: Eli Zaretskii
   <eliz@HIDDEN> > > To reproduce: [...] 
 
 Content analysis details:   (1.3 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -0.0 RP_MATCHES_RCVD        Envelope sender domain matches handover relay domain
  1.3 GAPPY_SUBJECT          Subject: contains G.a.p.p.y-T.e.x.t

Hello, Eli.

On Sun, Nov 12, 2017 at 14:38:50 +0200, Eli Zaretskii wrote:
> > Date: Sun, 12 Nov 2017 13:23:49 +0200
> > From: Eli Zaretskii <eliz@HIDDEN>

> > To reproduce:

> >   emacs -Q
> >   C-h k C-mouse-3

> > This pops up a Lisp Interaction Mode menu.  Select some item from the
> > menu.  The expected result is to show in *Help* the description of the
> > command selected from the menu.  Instead, you are prompted again for a
> > key or a mouse click.

> > "C-h l" shows this:

> >   C-h k [describe-key]
> >   <C-down-mouse-3> <indent-pp-sexp> <help-echo> <help-echo>

> > (I'm guessing help-echo comes from the menu items traversed by the
> > mouse while selecting the item.)

I would think so, too.

> I think those help-echo events are the reason.  We have this in
> help-read-key-sequence:

>           (while
>               (pcase (setq key (read-key-sequence "\
> Describe the following key, mouse click, or menu item: "))
>                 ((and (pred vectorp) (let `(,key0 . ,_) (aref key 0))
>                       (guard (symbolp key0)) (let keyname (symbol-name key0)))
>                  (if no-mouse-movement
>                      (string-match "mouse-movement" keyname)
>                    (and (string-match "\\(mouse\\|down\\|click\\|drag\\)"
>                                       keyname)
>                         (not (sit-for (/ double-click-time 1000.0) t)))))))

> What I think happens is that after the mouse-click event we get a
> help-echo event, which causes sit-for to exit with nil value, and we
> keep looping, because the loop expects only mouse events.

Yes.

> Alan, could you please take a look?  I think this was introduced by
> your changes in 10c0e1c (which you, no doubt, will have hard time
> recognizing among the code that meanwhile was completely refactored),
> which I think was an attempt to fix bug#22731 (not mentioned in the
> log message).  I think the changes failed to consider mouse clicks
> that invoke menu items.

You're not kidding about the refactoring.  ;-)

The following patch attempts to catch and filter out obtrusive events.
Could you try it out, please, even though it's not perfect (see below).
It's based on the emacs-26 branch:



diff --git a/lisp/help.el b/lisp/help.el
index fbb9fc8cbe..d119615180 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -728,11 +728,17 @@ help-read-key-sequence
 Describe the following key, mouse click, or menu item: "))
                 ((and (pred vectorp) (let `(,key0 . ,_) (aref key 0))
                       (guard (symbolp key0)) (let keyname (symbol-name key0)))
-                 (if no-mouse-movement
-                     (string-match "mouse-movement" keyname)
-                   (and (string-match "\\(mouse\\|down\\|click\\|drag\\)"
-                                      keyname)
-                        (not (sit-for (/ double-click-time 1000.0) t)))))))
+                 (or
+                  (and no-mouse-movement
+                       (string-match "mouse-movement" keyname))
+                  (and (string-match "\\(mouse\\|down\\|click\\|drag\\)"
+                                     keyname)
+                       (progn
+                         ;; Discard events (e.g. <help-echo>) which might
+                         ;; spuriously trigger the `sit-for'.
+                         (sleep-for 0.001)
+                         (while (read-event nil nil 0.001))
+                         (not (sit-for (/ double-click-time 1000.0) t))))))))
           (list
            key
            ;; If KEY is a down-event, read and include the


I think I've corrected what looks like a bug, there; even when
`no-mouse-movement' is non-nil (i.e. in C-h c), it should still check for
double clicks.

However, the problem is that in C-h k  C-mouse-3
<select-something-from-the-menus>, we get a spurious "translation"
message in *Help*, looking something like:

    <C-down-mouse-3> <file> <new-file> (translated from <mouse-1> <new-file>) at
    that spot runs the command find-file (found in global-map), which is an
    interactive compiled Lisp function in `files.el'.

That was from a Linux tty session using gpm.  In X, I got the message

    .... (translated from <C-down-mouse-3> <C-down-mouse-3> ....)

.  I don't believe this glitch has to do with my patch - I think it's
been there for some while, but this bug has prevented it being seen
before.

-- 
Alan Mackenzie (Nuremberg, Germany).




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

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


Received: (at 29272) by debbugs.gnu.org; 12 Nov 2017 13:25:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 12 08:25:53 2017
Received: from localhost ([127.0.0.1]:36152 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eDsGm-0008Uf-Qs
	for submit <at> debbugs.gnu.org; Sun, 12 Nov 2017 08:25:53 -0500
Received: from ocolin.muc.de ([193.149.48.4]:31893 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1eDsGl-0008UW-7i
 for 29272 <at> debbugs.gnu.org; Sun, 12 Nov 2017 08:25:51 -0500
Received: (qmail 23564 invoked by uid 3782); 12 Nov 2017 13:25:45 -0000
Received: from acm.muc.de (p548C60E3.dip0.t-ipconnect.de [84.140.96.227]) by
 colin.muc.de (tmda-ofmipd) with ESMTP;
 Sun, 12 Nov 2017 14:25:44 +0100
Received: (qmail 11995 invoked by uid 1000); 12 Nov 2017 13:24:08 -0000
Date: Sun, 12 Nov 2017 13:24:08 +0000
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#29272: 26.0.90; "C-h k C-mouse-3" followed by menu selection
 asks for more keys
Message-ID: <20171112132408.GA20916@ACM>
References: <83shdjn3ju.fsf@HIDDEN>
 <83mv3rn02t.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <83mv3rn02t.fsf@HIDDEN>
User-Agent: Mutt/1.7.2 (2016-11-26)
X-Delivery-Agent: TMDA/1.1.12 (Macallan)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: 1.3 (+)
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:  Hello, Eli. On Sun, Nov 12, 2017 at 14:38:50 +0200,
 Eli Zaretskii
 wrote: > > Date: Sun, 12 Nov 2017 13:23:49 +0200 > > From: Eli Zaretskii
 <eliz@HIDDEN> > > To reproduce: [...] 
 Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain
 1.3 GAPPY_SUBJECT          Subject: contains G.a.p.p.y-T.e.x.t
X-Debbugs-Envelope-To: 29272
Cc: 29272 <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: 1.3 (+)
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:  Hello, Eli. On Sun, Nov 12, 2017 at 14:38:50 +0200, Eli Zaretskii
    wrote: > > Date: Sun, 12 Nov 2017 13:23:49 +0200 > > From: Eli Zaretskii
   <eliz@HIDDEN> > > To reproduce: [...] 
 
 Content analysis details:   (1.3 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -0.0 RP_MATCHES_RCVD        Envelope sender domain matches handover relay domain
  1.3 GAPPY_SUBJECT          Subject: contains G.a.p.p.y-T.e.x.t

Hello, Eli.

On Sun, Nov 12, 2017 at 14:38:50 +0200, Eli Zaretskii wrote:
> > Date: Sun, 12 Nov 2017 13:23:49 +0200
> > From: Eli Zaretskii <eliz@HIDDEN>

> > To reproduce:

> >   emacs -Q
> >   C-h k C-mouse-3

> > This pops up a Lisp Interaction Mode menu.  Select some item from the
> > menu.  The expected result is to show in *Help* the description of the
> > command selected from the menu.  Instead, you are prompted again for a
> > key or a mouse click.

> > "C-h l" shows this:

> >   C-h k [describe-key]
> >   <C-down-mouse-3> <indent-pp-sexp> <help-echo> <help-echo>

> > (I'm guessing help-echo comes from the menu items traversed by the
> > mouse while selecting the item.)

> I think those help-echo events are the reason.  We have this in
> help-read-key-sequence:

>           (while
>               (pcase (setq key (read-key-sequence "\
> Describe the following key, mouse click, or menu item: "))
>                 ((and (pred vectorp) (let `(,key0 . ,_) (aref key 0))
>                       (guard (symbolp key0)) (let keyname (symbol-name key0)))
>                  (if no-mouse-movement
>                      (string-match "mouse-movement" keyname)
>                    (and (string-match "\\(mouse\\|down\\|click\\|drag\\)"
>                                       keyname)
>                         (not (sit-for (/ double-click-time 1000.0) t)))))))

> What I think happens is that after the mouse-click event we get a
> help-echo event, which causes sit-for to exit with nil value, and we
> keep looping, because the loop expects only mouse events.

> Alan, could you please take a look?

Will do.

> I think this was introduced by your changes in 10c0e1c (which you, no
> doubt, will have hard time recognizing among the code that meanwhile
> was completely refactored), which I think was an attempt to fix
> bug#22731 (not mentioned in the log message).  I think the changes
> failed to consider mouse clicks that invoke menu items.

That could well be the case.  I'll be looking at it.

-- 
Alan Mackenzie (Nuremberg, Germany).




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

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


Received: (at 29272) by debbugs.gnu.org; 12 Nov 2017 12:39:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 12 07:39:02 2017
Received: from localhost ([127.0.0.1]:36126 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eDrXQ-0007PE-Qs
	for submit <at> debbugs.gnu.org; Sun, 12 Nov 2017 07:39:02 -0500
Received: from eggs.gnu.org ([208.118.235.92]:46765)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eDrXO-0007P2-IM
 for 29272 <at> debbugs.gnu.org; Sun, 12 Nov 2017 07:38:58 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eDrXE-000523-3z
 for 29272 <at> debbugs.gnu.org; Sun, 12 Nov 2017 07:38: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=2.8 required=5.0 tests=BAYES_50,GAPPY_SUBJECT,
 RP_MATCHES_RCVD autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40605)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eDrXE-00051w-0U; Sun, 12 Nov 2017 07:38:48 -0500
Received: from [176.228.60.248] (port=3932 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 1eDrXC-0004tn-6p; Sun, 12 Nov 2017 07:38:47 -0500
Date: Sun, 12 Nov 2017 14:38:50 +0200
Message-Id: <83mv3rn02t.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
In-reply-to: <83shdjn3ju.fsf@HIDDEN> (message from Eli Zaretskii on Sun, 12
 Nov 2017 13:23:49 +0200)
Subject: Re: bug#29272: 26.0.90;
 "C-h k C-mouse-3" followed by menu selection asks for more keys
References: <83shdjn3ju.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: -3.7 (---)
X-Debbugs-Envelope-To: 29272
Cc: 29272 <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: -3.7 (---)

> Date: Sun, 12 Nov 2017 13:23:49 +0200
> From: Eli Zaretskii <eliz@HIDDEN>
> 
> To reproduce:
> 
>   emacs -Q
>   C-h k C-mouse-3
> 
> This pops up a Lisp Interaction Mode menu.  Select some item from the
> menu.  The expected result is to show in *Help* the description of the
> command selected from the menu.  Instead, you are prompted again for a
> key or a mouse click.
> 
> "C-h l" shows this:
> 
>   C-h k [describe-key]
>   <C-down-mouse-3> <indent-pp-sexp> <help-echo> <help-echo>
> 
> (I'm guessing help-echo comes from the menu items traversed by the
> mouse while selecting the item.)

I think those help-echo events are the reason.  We have this in
help-read-key-sequence:

          (while
              (pcase (setq key (read-key-sequence "\
Describe the following key, mouse click, or menu item: "))
                ((and (pred vectorp) (let `(,key0 . ,_) (aref key 0))
                      (guard (symbolp key0)) (let keyname (symbol-name key0)))
                 (if no-mouse-movement
                     (string-match "mouse-movement" keyname)
                   (and (string-match "\\(mouse\\|down\\|click\\|drag\\)"
                                      keyname)
                        (not (sit-for (/ double-click-time 1000.0) t)))))))

What I think happens is that after the mouse-click event we get a
help-echo event, which causes sit-for to exit with nil value, and we
keep looping, because the loop expects only mouse events.

Alan, could you please take a look?  I think this was introduced by
your changes in 10c0e1c (which you, no doubt, will have hard time
recognizing among the code that meanwhile was completely refactored),
which I think was an attempt to fix bug#22731 (not mentioned in the
log message).  I think the changes failed to consider mouse clicks
that invoke menu items.




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

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


Received: (at submit) by debbugs.gnu.org; 12 Nov 2017 11:24:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 12 06:24:01 2017
Received: from localhost ([127.0.0.1]:36073 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eDqMq-0003fD-P2
	for submit <at> debbugs.gnu.org; Sun, 12 Nov 2017 06:24:00 -0500
Received: from eggs.gnu.org ([208.118.235.92]:39516)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eDqMo-0003ez-OM
 for submit <at> debbugs.gnu.org; Sun, 12 Nov 2017 06:23:58 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eDqMi-0003xE-Fm
 for submit <at> debbugs.gnu.org; Sun, 12 Nov 2017 06:23: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=2.8 required=5.0 tests=BAYES_50,GAPPY_SUBJECT,
 RP_MATCHES_RCVD autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:53399)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <eliz@HIDDEN>) id 1eDqMi-0003x8-CA
 for submit <at> debbugs.gnu.org; Sun, 12 Nov 2017 06:23:52 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:58708)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eDqMh-0003Dt-7q
 for bug-gnu-emacs@HIDDEN; Sun, 12 Nov 2017 06:23:52 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eDqMc-0003rw-9t
 for bug-gnu-emacs@HIDDEN; Sun, 12 Nov 2017 06:23:51 -0500
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40166)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eDqMc-0003rq-5q
 for bug-gnu-emacs@HIDDEN; Sun, 12 Nov 2017 06:23:46 -0500
Received: from [176.228.60.248] (port=3857 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 1eDqMb-00047o-JX
 for bug-gnu-emacs@HIDDEN; Sun, 12 Nov 2017 06:23:46 -0500
Date: Sun, 12 Nov 2017 13:23:49 +0200
Message-Id: <83shdjn3ju.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 26.0.90;
 "C-h k C-mouse-3" followed by menu selection asks for more keys
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -3.7 (---)
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>
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: -3.7 (---)

To reproduce:

  emacs -Q
  C-h k C-mouse-3

This pops up a Lisp Interaction Mode menu.  Select some item from the
menu.  The expected result is to show in *Help* the description of the
command selected from the menu.  Instead, you are prompted again for a
key or a mouse click.

"C-h l" shows this:

  C-h k [describe-key]
  <C-down-mouse-3> <indent-pp-sexp> <help-echo> <help-echo>

(I'm guessing help-echo comes from the menu items traversed by the
mouse while selecting the item.)

This works in Emacs 25.2, so it's a recent regression.

In GNU Emacs 26.0.90 (build 1, i686-pc-mingw32)
 of 2017-10-12 built on HOME-C4E4A596F7
Windowing system distributor 'Microsoft Corp.', version 5.1.2600
Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Type C-x 1 to delete the help window.

Configured using:
 'configure --prefix=/d/usr --with-wide-int --with-modules
 --enable-checking=yes,glyphs 'CFLAGS=-Og -gdwarf-4 -g3''

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS MODULES LCMS2

Important settings:
  value of $LANG: ENU
  locale-coding-system: cp1255

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv
bytecomp byte-compile cconv dired dired-loaddefs format-spec rfc822 mml
mml-sec password-cache epa derived epg epg-config gnus-util rmail
rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils cl-extra help-fns radix-tree help-mode
easymenu cl-loaddefs cl-lib elec-pair time-date mule-util tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32
ls-lisp disp-table term/w32-win w32-win w32-vars term/common-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core term/tty-colors frame cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote w32notify w32 lcms2
multi-tty make-network-process emacs)

Memory information:
((conses 16 103039 10652)
 (symbols 56 21441 1)
 (miscs 48 40 97)
 (strings 16 32209 1748)
 (string-bytes 1 779452)
 (vectors 16 14316)
 (vector-slots 8 648524 8150)
 (floats 8 52 222)
 (intervals 40 292 114)
 (buffers 880 12))




Acknowledgement sent to Eli Zaretskii <eliz@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#29272; 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: Tue, 28 Nov 2017 02:00:02 UTC

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