GNU bug report logs - #29478
26.0.90; `C-h k' followed by mouse clicks no longer shows down event

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: Drew Adams <drew.adams@HIDDEN>; Keywords: confirmed; dated Mon, 27 Nov 2017 23:23:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at 29478) by debbugs.gnu.org; 30 Jan 2018 16:59:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 30 11:59:22 2018
Received: from localhost ([127.0.0.1]:49784 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1egZFi-0006C6-B4
	for submit <at> debbugs.gnu.org; Tue, 30 Jan 2018 11:59:22 -0500
Received: from chene.dit.umontreal.ca ([132.204.246.20]:47739)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1egZFg-0006Bs-1E
 for 29478 <at> debbugs.gnu.org; Tue, 30 Jan 2018 11:59:20 -0500
Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242])
 by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w0UGxIbE022968;
 Tue, 30 Jan 2018 11:59:18 -0500
Received: by pastel.home (Postfix, from userid 20848)
 id 33207606D4; Tue, 30 Jan 2018 11:59:18 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: [Patch] bug#29478: 26.0.90;
 `C-h k' followed by mouse clicks no longer shows down event
Message-ID: <jwvy3kfuvtv.fsf-monnier+emacsbugs@HIDDEN>
References: <20171128221036.GC14868@ACM> <83bmji2xye.fsf@HIDDEN>
 <83tvwzubez.fsf@HIDDEN> <20171222220549.GC8072@ACM>
 <833741lr0t.fsf@HIDDEN> <20171223111726.GA6618@ACM>
 <jwv4lohjv1e.fsf-monnier+emacsbugs@HIDDEN>
 <20171223210407.GC6618@ACM>
 <jwvbmioipxp.fsf-monnier+emacsbugs@HIDDEN> <831sjcfq1v.fsf@HIDDEN>
 <jwva7xv8une.fsf-monnier+emacsbugs@HIDDEN> <83zi5q997a.fsf@HIDDEN>
 <jwvwp04qoxg.fsf-monnier+emacsbugs@HIDDEN>
 <jwvr2qcqmbm.fsf-monnier+emacsbugs@HIDDEN> <83shark8nl.fsf@HIDDEN>
 <jwvy3kjxsma.fsf-monnier+emacsbugs@HIDDEN> <83tvv5j3zy.fsf@HIDDEN>
 <jwvo9lcgwqj.fsf-monnier+emacsbugs@HIDDEN> <83y3kgghbm.fsf@HIDDEN>
 <jwv1si7xwfq.fsf-monnier+emacsbugs@HIDDEN> <83372ngxt1.fsf@HIDDEN>
Date: Tue, 30 Jan 2018 11:59:18 -0500
In-Reply-To: <83372ngxt1.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 30 Jan
 2018 17:40:10 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-NAI-Spam-Flag: NO
X-NAI-Spam-Level: 
X-NAI-Spam-Threshold: 5
X-NAI-Spam-Score: 0.1
X-NAI-Spam-Rules: 3 Rules triggered
 GEN_SPAM_FEATRE=0.1, EDT_SA_DN_PASS=0, RV6211=0
X-NAI-Spam-Version: 2.3.0.9418 : core <6211> : inlines <6348> : streams
 <1777543> : uri <2582870>
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: 29478
Cc: acm@HIDDEN, 29478 <at> debbugs.gnu.org, npostavs@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: -1.3 (-)

>> Should I push it to master?
> I think so, yes.

Thanks, done,


        Stefan




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

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


Received: (at 29478) by debbugs.gnu.org; 30 Jan 2018 15:40:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 30 10:40:23 2018
Received: from localhost ([127.0.0.1]:49719 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1egY1G-0003xO-Qu
	for submit <at> debbugs.gnu.org; Tue, 30 Jan 2018 10:40:23 -0500
Received: from eggs.gnu.org ([208.118.235.92]:39886)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1egY1E-0003xC-FZ
 for 29478 <at> debbugs.gnu.org; Tue, 30 Jan 2018 10:40:20 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1egY15-0008H1-BF
 for 29478 <at> debbugs.gnu.org; Tue, 30 Jan 2018 10:40:15 -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,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33870)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1egY0u-0008Di-PY; Tue, 30 Jan 2018 10:40:00 -0500
Received: from [176.228.60.248] (port=3078 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 1egY0u-0007yp-6G; Tue, 30 Jan 2018 10:40:00 -0500
Date: Tue, 30 Jan 2018 17:40:10 +0200
Message-Id: <83372ngxt1.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
In-reply-to: <jwv1si7xwfq.fsf-monnier+emacsbugs@HIDDEN> (message from Stefan
 Monnier on Tue, 30 Jan 2018 09:18:04 -0500)
Subject: Re: [Patch] bug#29478: 26.0.90;
 `C-h k' followed by mouse clicks no longer shows down event
References: <20171128221036.GC14868@ACM> <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
 <20171222220549.GC8072@ACM> <833741lr0t.fsf@HIDDEN>
 <20171223111726.GA6618@ACM>
 <jwv4lohjv1e.fsf-monnier+emacsbugs@HIDDEN>
 <20171223210407.GC6618@ACM>
 <jwvbmioipxp.fsf-monnier+emacsbugs@HIDDEN> <831sjcfq1v.fsf@HIDDEN>
 <jwva7xv8une.fsf-monnier+emacsbugs@HIDDEN> <83zi5q997a.fsf@HIDDEN>
 <jwvwp04qoxg.fsf-monnier+emacsbugs@HIDDEN>
 <jwvr2qcqmbm.fsf-monnier+emacsbugs@HIDDEN> <83shark8nl.fsf@HIDDEN>
 <jwvy3kjxsma.fsf-monnier+emacsbugs@HIDDEN> <83tvv5j3zy.fsf@HIDDEN>
 <jwvo9lcgwqj.fsf-monnier+emacsbugs@HIDDEN> <83y3kgghbm.fsf@HIDDEN>
 <jwv1si7xwfq.fsf-monnier+emacsbugs@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: 29478
Cc: acm@HIDDEN, 29478 <at> debbugs.gnu.org, npostavs@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>
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: Stefan Monnier <monnier@HIDDEN>
> Cc: acm@HIDDEN, 29478 <at> debbugs.gnu.org, npostavs@HIDDEN
> Date: Tue, 30 Jan 2018 09:18:04 -0500
> 
> >> OK, in help--filter-info-list in the patch below I follow the rule of
> >> getting rid of all `undefined` keys except when there are only undefined
> >> keys in which case I keep the last one (e.g. the triple-mouse-N).
> > Thanks.
> 
> Should I push it to master?

I think so, yes.




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

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


Received: (at 29478) by debbugs.gnu.org; 30 Jan 2018 14:18:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 30 09:18:10 2018
Received: from localhost ([127.0.0.1]:48700 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1egWjh-0001rf-RX
	for submit <at> debbugs.gnu.org; Tue, 30 Jan 2018 09:18:09 -0500
Received: from pruche.dit.umontreal.ca ([132.204.246.22]:48623)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1egWje-0001rW-5d
 for 29478 <at> debbugs.gnu.org; Tue, 30 Jan 2018 09:18:08 -0500
Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242])
 by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w0UEI4Zr026595;
 Tue, 30 Jan 2018 09:18:05 -0500
Received: by pastel.home (Postfix, from userid 20848)
 id 9BFA96027F; Tue, 30 Jan 2018 09:18:04 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: [Patch] bug#29478: 26.0.90;
 `C-h k' followed by mouse clicks no longer shows down event
Message-ID: <jwv1si7xwfq.fsf-monnier+emacsbugs@HIDDEN>
References: <20171128221036.GC14868@ACM> <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
 <20171222220549.GC8072@ACM> <833741lr0t.fsf@HIDDEN>
 <20171223111726.GA6618@ACM>
 <jwv4lohjv1e.fsf-monnier+emacsbugs@HIDDEN>
 <20171223210407.GC6618@ACM>
 <jwvbmioipxp.fsf-monnier+emacsbugs@HIDDEN> <831sjcfq1v.fsf@HIDDEN>
 <jwva7xv8une.fsf-monnier+emacsbugs@HIDDEN> <83zi5q997a.fsf@HIDDEN>
 <jwvwp04qoxg.fsf-monnier+emacsbugs@HIDDEN>
 <jwvr2qcqmbm.fsf-monnier+emacsbugs@HIDDEN> <83shark8nl.fsf@HIDDEN>
 <jwvy3kjxsma.fsf-monnier+emacsbugs@HIDDEN> <83tvv5j3zy.fsf@HIDDEN>
 <jwvo9lcgwqj.fsf-monnier+emacsbugs@HIDDEN> <83y3kgghbm.fsf@HIDDEN>
Date: Tue, 30 Jan 2018 09:18:04 -0500
In-Reply-To: <83y3kgghbm.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 30 Jan
 2018 05:23:57 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-NAI-Spam-Flag: NO
X-NAI-Spam-Level: 
X-NAI-Spam-Threshold: 5
X-NAI-Spam-Score: 0.1
X-NAI-Spam-Rules: 3 Rules triggered
 GEN_SPAM_FEATRE=0.1, EDT_SA_DN_PASS=0, RV6211=0
X-NAI-Spam-Version: 2.3.0.9418 : core <6211> : inlines <6347> : streams
 <1777533> : uri <2582776>
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: 29478
Cc: acm@HIDDEN, 29478 <at> debbugs.gnu.org, npostavs@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: -1.3 (-)

>> OK, in help--filter-info-list in the patch below I follow the rule of
>> getting rid of all `undefined` keys except when there are only undefined
>> keys in which case I keep the last one (e.g. the triple-mouse-N).
> Thanks.

Should I push it to master?


        Stefan




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

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


Received: (at 29478) by debbugs.gnu.org; 30 Jan 2018 03:24:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 29 22:24:10 2018
Received: from localhost ([127.0.0.1]:48414 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1egMWo-0000nP-B4
	for submit <at> debbugs.gnu.org; Mon, 29 Jan 2018 22:24:10 -0500
Received: from eggs.gnu.org ([208.118.235.92]:57704)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1egMWm-0000nB-4C
 for 29478 <at> debbugs.gnu.org; Mon, 29 Jan 2018 22:24:08 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1egMWd-00082m-Oj
 for 29478 <at> debbugs.gnu.org; Mon, 29 Jan 2018 22:24:02 -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,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43300)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1egMWT-0007tE-4h; Mon, 29 Jan 2018 22:23:49 -0500
Received: from [176.228.60.248] (port=2346 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 1egMWS-0003nw-Jt; Mon, 29 Jan 2018 22:23:48 -0500
Date: Tue, 30 Jan 2018 05:23:57 +0200
Message-Id: <83y3kgghbm.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
In-reply-to: <jwvo9lcgwqj.fsf-monnier+emacsbugs@HIDDEN> (message from Stefan
 Monnier on Mon, 29 Jan 2018 16:54:09 -0500)
Subject: Re: [Patch] bug#29478: 26.0.90;
 `C-h k' followed by mouse clicks no longer shows down event
References: <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
 <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
 <20171222220549.GC8072@ACM> <833741lr0t.fsf@HIDDEN>
 <20171223111726.GA6618@ACM>
 <jwv4lohjv1e.fsf-monnier+emacsbugs@HIDDEN>
 <20171223210407.GC6618@ACM>
 <jwvbmioipxp.fsf-monnier+emacsbugs@HIDDEN> <831sjcfq1v.fsf@HIDDEN>
 <jwva7xv8une.fsf-monnier+emacsbugs@HIDDEN> <83zi5q997a.fsf@HIDDEN>
 <jwvwp04qoxg.fsf-monnier+emacsbugs@HIDDEN>
 <jwvr2qcqmbm.fsf-monnier+emacsbugs@HIDDEN> <83shark8nl.fsf@HIDDEN>
 <jwvy3kjxsma.fsf-monnier+emacsbugs@HIDDEN> <83tvv5j3zy.fsf@HIDDEN>
 <jwvo9lcgwqj.fsf-monnier+emacsbugs@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: 29478
Cc: acm@HIDDEN, 29478 <at> debbugs.gnu.org, npostavs@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>
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: Stefan Monnier <monnier@HIDDEN>
> Cc: acm@HIDDEN, 29478 <at> debbugs.gnu.org, npostavs@HIDDEN
> Date: Mon, 29 Jan 2018 16:54:09 -0500
> 
> > It means I'm okay with this:
> >
> >   FOO is undefined
> >
> > but prefer not to see the second line in this:
> >
> >   FOO at that spot runs BAR
> >   down-FOO at that spot is undefined
> 
> OK, in help--filter-info-list in the patch below I follow the rule of
> getting rid of all `undefined` keys except when there are only undefined
> keys in which case I keep the last one (e.g. the triple-mouse-N).

Thanks.




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

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


Received: (at 29478) by debbugs.gnu.org; 29 Jan 2018 21:49:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 29 16:49:52 2018
Received: from localhost ([127.0.0.1]:48281 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1egHJH-0008Fa-M3
	for submit <at> debbugs.gnu.org; Mon, 29 Jan 2018 16:49:52 -0500
Received: from chene.dit.umontreal.ca ([132.204.246.20]:48107)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1egHJF-0008FQ-9L
 for 29478 <at> debbugs.gnu.org; Mon, 29 Jan 2018 16:49:50 -0500
Received: from lechazo.home (lechon.iro.umontreal.ca [132.204.27.242])
 by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w0TLnkdZ012535;
 Mon, 29 Jan 2018 16:49:47 -0500
Received: by lechazo.home (Postfix, from userid 20848)
 id D902160164; Mon, 29 Jan 2018 16:54:09 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: [Patch] bug#29478: 26.0.90;
 `C-h k' followed by mouse clicks no longer shows down event
Message-ID: <jwvo9lcgwqj.fsf-monnier+emacsbugs@HIDDEN>
References: <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
 <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
 <20171222220549.GC8072@ACM> <833741lr0t.fsf@HIDDEN>
 <20171223111726.GA6618@ACM>
 <jwv4lohjv1e.fsf-monnier+emacsbugs@HIDDEN>
 <20171223210407.GC6618@ACM>
 <jwvbmioipxp.fsf-monnier+emacsbugs@HIDDEN> <831sjcfq1v.fsf@HIDDEN>
 <jwva7xv8une.fsf-monnier+emacsbugs@HIDDEN> <83zi5q997a.fsf@HIDDEN>
 <jwvwp04qoxg.fsf-monnier+emacsbugs@HIDDEN>
 <jwvr2qcqmbm.fsf-monnier+emacsbugs@HIDDEN> <83shark8nl.fsf@HIDDEN>
 <jwvy3kjxsma.fsf-monnier+emacsbugs@HIDDEN> <83tvv5j3zy.fsf@HIDDEN>
Date: Mon, 29 Jan 2018 16:54:09 -0500
In-Reply-To: <83tvv5j3zy.fsf@HIDDEN> (Eli Zaretskii's message of "Sun, 28 Jan
 2018 19:18:57 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-NAI-Spam-Flag: NO
X-NAI-Spam-Level: 
X-NAI-Spam-Threshold: 5
X-NAI-Spam-Score: 0.2
X-NAI-Spam-Rules: 3 Rules triggered
	ATR_WMN=0.2, EDT_SA_DN_PASS=0, RV6210=0
X-NAI-Spam-Version: 2.3.0.9418 : core <6210> : inlines <6345> : streams
 <1777470> : uri <2582239>
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: 29478
Cc: acm@HIDDEN, 29478 <at> debbugs.gnu.org, npostavs@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: -1.3 (-)

> It means I'm okay with this:
>
>   FOO is undefined
>
> but prefer not to see the second line in this:
>
>   FOO at that spot runs BAR
>   down-FOO at that spot is undefined

OK, in help--filter-info-list in the patch below I follow the rule of
getting rid of all `undefined` keys except when there are only undefined
keys in which case I keep the last one (e.g. the triple-mouse-N).


        Stefan


diff --git a/lisp/help.el b/lisp/help.el
index 014af5141e..ccac854d8b 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1,4 +1,4 @@
-;;; help.el --- help commands for Emacs
+;;; help.el --- help commands for Emacs  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 1985-1986, 1993-1994, 1998-2018 Free Software
 ;; Foundation, Inc.
@@ -593,19 +592,27 @@
 	    string
 	  (format "%s (translated from %s)" string otherstring))))))
 
+(defun help--binding-undefined-p (defn)
+  (or (null defn) (integerp defn) (equal defn 'undefined)))
+
 (defun help--analyze-key (key untranslated)
   "Get information about KEY its corresponding UNTRANSLATED events.
 Returns a list of the form (BRIEF-DESC DEFN EVENT MOUSE-MSG)."
   (if (numberp untranslated)
-      (setq untranslated (this-single-command-raw-keys)))
-  (let* ((event (aref key (if (and (symbolp (aref key 0))
-				   (> (length key) 1)
-				   (consp (aref key 1)))
-			      1
-			    0)))
+      (error "Missing `untranslated'!"))
+  (let* ((event (when (> (length key) 0)
+                  (aref key (if (and (symbolp (aref key 0))
+		                     (> (length key) 1)
+		                     (consp (aref key 1)))
+                                ;; Look at the second event when the first
+                                ;; is a pseudo-event like `mode-line' or
+                                ;; `left-fringe'.
+		                1
+	                      0))))
 	 (modifiers (event-modifiers event))
 	 (mouse-msg (if (or (memq 'click modifiers) (memq 'down modifiers)
-			    (memq 'drag modifiers)) " at that spot" ""))
+			    (memq 'drag modifiers))
+                        " at that spot" ""))
 	 (defn (key-binding key t)))
     ;; Handle the case where we faked an entry in "Select and Paste" menu.
     (when (and (eq defn nil)
@@ -621,27 +628,47 @@ help--analyze-key
     (list
      ;; Now describe the key, perhaps as changed.
      (let ((key-desc (help-key-description key untranslated)))
-       (if (or (null defn) (integerp defn) (equal defn 'undefined))
+       (if (help--binding-undefined-p defn)
            (format "%s%s is undefined" key-desc mouse-msg)
          (format "%s%s runs the command %S" key-desc mouse-msg defn)))
      defn event mouse-msg)))
 
-(defun describe-key-briefly (&optional key insert untranslated)
-  "Print the name of the function KEY invokes.  KEY is a string.
+(defun help--filter-info-list (info-list i)
+  "Drop the undefined keys."
+  (or
+   ;; Remove all `undefined' keys.
+   (delq nil (mapcar (lambda (x)
+                       (unless (help--binding-undefined-p (nth i x)) x))
+                     info-list))
+   ;; If nothing left, then keep one (the last one).
+   (last info-list)))
+
+(defun describe-key-briefly (&optional key-list insert untranslated)
+  "Print the name of the functions KEY-LIST invokes.
+KEY-LIST is a list of pairs (SEQ . RAW-SEQ) of key sequences, where
+RAW-SEQ is the untranslated form of the key sequence SEQ.
 If INSERT (the prefix arg) is non-nil, insert the message in the buffer.
-If non-nil, UNTRANSLATED is a vector of the untranslated events.
-It can also be a number in which case the untranslated events from
-the last key hit are used.
 
-If KEY is a menu item or a tool-bar button that is disabled, this command
-temporarily enables it to allow getting help on disabled items and buttons."
+While reading KEY-LIST interactively, this command temporarily enables
+menu items or tool-bar buttons that are disabled to allow getting help
+on them."
+  (declare (advertised-calling-convention (key-list &optional insert) "27.1"))
   (interactive
    ;; Ignore mouse movement events because it's too easy to miss the
    ;; message while moving the mouse.
-   (pcase-let ((`(,key ,_up-event) (help-read-key-sequence 'no-mouse-movement)))
-     `(,key ,current-prefix-arg 1)))
-  (princ (car (help--analyze-key key untranslated))
-         (if insert (current-buffer) standard-output)))
+   (let ((key-list (help--read-key-sequence 'no-mouse-movement)))
+     `(,key-list ,current-prefix-arg)))
+  (when (arrayp key-list)
+    ;; Old calling convention, changed
+    (setq key-list (list (cons key-list
+                               (if (numberp untranslated)
+                                   (this-single-command-raw-keys)
+                                 untranslated)))))
+  (let* ((info-list (mapcar (lambda (kr)
+                              (help--analyze-key (car kr) (cdr kr)))
+                            key-list))
+         (msg (mapconcat #'car (help--filter-info-list info-list 1) "\n")))
+    (if insert (insert msg) (message "%s" msg))))
 
 (defun help--key-binding-keymap (key &optional accept-default no-remap position)
   "Return a keymap holding a binding for KEY within current keymaps.
@@ -688,8 +715,7 @@ help--binding-locus
                                               (format "%s-map" mode)))))
                                        minor-mode-map-alist))
                                 (list 'global-map
-                                      (intern-soft (format "%s-map" major-mode)))))
-              found)
+                                      (intern-soft (format "%s-map" major-mode))))))
           ;; Look into these advertised symbols first.
           (dolist (sym advertised-syms)
             (when (and
@@ -706,225 +732,136 @@ help--binding-locus
                (throw 'found x))))
           nil)))))
 
-(defun help-read-key-sequence (&optional no-mouse-movement)
-  "Reads a key sequence from the user.
-Returns a list of the form (KEY UP-EVENT), where KEY is the key
-sequence, and UP-EVENT is the up-event that was discarded by
-reading KEY, or nil.
+(defun help--read-key-sequence (&optional no-mouse-movement)
+  "Read a key sequence from the user.
+Usually reads a single key sequence, except when that sequence might
+hide another one (e.g. a down event, where the user is interested
+in getting info about the up event, or a click event, where the user
+wants to get info about the double click).
+Return a list of elements of the form (SEQ . RAW-SEQ), where SEQ is a key
+sequence, and RAW-SEQ is its untranslated form.
 If NO-MOUSE-MOVEMENT is non-nil, ignore key sequences starting
 with `mouse-movement' events."
   (let ((enable-disabled-menus-and-buttons t)
         (cursor-in-echo-area t)
         saved-yank-menu)
     (unwind-protect
-        (let (key keys down-ev discarded-up)
+        (let (last-modifiers key-list)
           ;; If yank-menu is empty, populate it temporarily, so that
           ;; "Select and Paste" menu can generate a complete event.
           (when (null (cdr yank-menu))
             (setq saved-yank-menu (copy-sequence yank-menu))
             (menu-bar-update-yank-menu "(any string)" nil))
           (while
-              (pcase (setq key (read-key-sequence "\
+              ;; Read at least one key-sequence.
+              (or (null key-list)
+                  ;; After a down event, also read the (presumably) following
+                  ;; up-event.
+                  (memq 'down last-modifiers)
+                  ;; After a click, see if a double click is on the way.
+                  (and (memq 'click last-modifiers)
+                       (not (sit-for (/ double-click-time 1000.0) t))))
+            (let* ((seq (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)))
-                 (or
-                  (and no-mouse-movement
-                       (string-match "mouse-movement" keyname))
-                  (progn (push key keys) nil)
-                  (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.01)
-                         (while (read-event nil nil 0.01))
-                         (not (sit-for
-                               (if (numberp double-click-time)
-                                   (/ double-click-time 1000.0)
-                                 3.0)
-                               t))))))))
-          ;; When we have a sequence of mouse events, discard the most
-          ;; recent ones till we find one with a binding.
-          (let ((keys-1 keys))
-            (while (and keys-1
-                        (not (key-binding (car keys-1))))
-              ;; If we discard the last event, and this was a mouse
-              ;; up, remember this.
-              (if (and (eq keys-1 keys)
-                       (vectorp (car keys-1))
-                       (let* ((last-idx (1- (length (car keys-1))))
-                              (last (aref (car keys-1) last-idx)))
-                         (and (eventp last)
-                              (memq 'click (event-modifiers last)))))
-                  (setq discarded-up t))
-              (setq keys-1 (cdr keys-1)))
-            (if keys-1
-                (setq key (car keys-1))))
-          (list
-           key
-           ;; If KEY is a down-event, read and include the
-           ;; corresponding up-event.  Note that there are also
-           ;; down-events on scroll bars and mode lines: the actual
-           ;; event then is in the second element of the vector.
-           (and (not discarded-up) ; Don't attempt to ignore the up-event twice.
-                (vectorp key)
-                (let ((last-idx (1- (length key))))
-                  (and (eventp (aref key last-idx))
-                       (memq 'down (event-modifiers (aref key last-idx)))))
-                (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 (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)))))
+                   (raw-seq (this-single-command-raw-keys))
+                   (keyn (when (> (length seq) 0)
+                           (aref seq (1- (length seq)))))
+                   (base (event-basic-type keyn))
+                   (modifiers (event-modifiers keyn)))
+              (cond
+               ((zerop (length seq)))   ;FIXME: Can this happen?
+               ((and no-mouse-movement (eq base 'mouse-movement)) nil)
+               ((eq base 'help-echo) nil)
+               (t
+                (setq last-modifiers modifiers)
+                (push (cons seq raw-seq) key-list)))))
+          (nreverse key-list))
       ;; Put yank-menu back as it was, if we changed it.
       (when saved-yank-menu
         (setq yank-menu (copy-sequence saved-yank-menu))
         (fset 'yank-menu (cons 'keymap yank-menu))))))
 
-(defun help-downify-mouse-event-type (base)
-  "Add \"down-\" to BASE if it is not already there.
-BASE is a symbol, a mouse event type.  If the modification is done,
-return the new symbol.  Otherwise return nil."
-  (let ((base-s (symbol-name base)))
-    ;; Note: the order of the components in the following string is
-    ;; determined by `apply_modifiers_uncached' in src/keyboard.c.
-    (string-match "\\(A-\\)?\
-\\(C-\\)?\
-\\(H-\\)?\
-\\(M-\\)?\
-\\(S-\\)?\
-\\(s-\\)?\
-\\(double-\\)?\
-\\(triple-\\)?\
-\\(up-\\)?\
-\\(\\(down-\\)?\\)\
-\\(drag-\\)?" base-s)
-    (when (and (null (match-beginning 11)) ; "down-"
-               (null (match-beginning 12))) ; "drag-"
-      (intern (replace-match "down-" t t base-s 10)) )))
-
-(defun describe-key (&optional key untranslated up-event)
-  "Display documentation of the function invoked by KEY.
-KEY can be any kind of a key sequence; it can include keyboard events,
+(defun describe-key (&optional key-list buffer up-event)
+  "Display documentation of the function invoked by KEY-LIST.
+KEY-LIST can be any kind of a key sequence; it can include keyboard events,
 mouse events, and/or menu events.  When calling from a program,
-pass KEY as a string or a vector.
-
-If non-nil, UNTRANSLATED is a vector of the corresponding untranslated events.
-It can also be a number, in which case the untranslated events from
-the last key sequence entered are used.
-UP-EVENT is the up-event that was discarded by reading KEY, or nil.
-
-If KEY is a menu item or a tool-bar button that is disabled, this command
-temporarily enables it to allow getting help on disabled items and buttons."
-  (interactive
-   (pcase-let ((`(,key ,up-event) (help-read-key-sequence)))
-     `(,key ,(prefix-numeric-value current-prefix-arg) ,up-event)))
-  (pcase-let ((`(,brief-desc ,defn ,event ,mouse-msg)
-               (help--analyze-key key untranslated))
-              (defn-up nil) (defn-up-tricky nil)
-              (key-locus-up nil) (key-locus-up-tricky nil)
-              (mouse-1-remapped nil) (mouse-1-tricky nil)
-              (ev-type nil))
-    (if (or (null defn)
-            (integerp defn)
-            (equal defn 'undefined))
-        (message "%s" brief-desc)
-      (help-setup-xref (list #'describe-function defn)
-		       (called-interactively-p 'interactive))
-      ;; Need to do this before erasing *Help* buffer in case event
-      ;; is a mouse click in an existing *Help* buffer.
-      (when up-event
-	(setq ev-type (event-basic-type up-event))
-	(let ((sequence (vector up-event)))
-	  (when (and (eq ev-type 'mouse-1)
-		     mouse-1-click-follows-link
-		     (not (eq mouse-1-click-follows-link 'double))
-		     (setq mouse-1-remapped
-			   (mouse-on-link-p (event-start up-event))))
-	    (setq mouse-1-tricky (and (integerp mouse-1-click-follows-link)
-				      (> mouse-1-click-follows-link 0)))
-	    (cond ((stringp mouse-1-remapped)
-		   (setq sequence mouse-1-remapped))
-		  ((vectorp mouse-1-remapped)
-		   (setcar up-event (elt mouse-1-remapped 0)))
-		  (t (setcar up-event 'mouse-2))))
-	  (setq defn-up (key-binding sequence nil nil (event-start up-event)))
-          (setq key-locus-up (help--binding-locus sequence (event-start up-event)))
-	  (when mouse-1-tricky
-	    (setq sequence (vector up-event))
-	    (aset sequence 0 'mouse-1)
-	    (setq defn-up-tricky (key-binding sequence nil nil (event-start up-event)))
-            (setq key-locus-up-tricky (help--binding-locus sequence (event-start up-event))))))
+pass KEY-LIST as a list of elements (SEQ . RAW-SEQ) where SEQ is
+a key-sequence and RAW-SEQ is its untranslated form.
+
+While reading KEY-LIST interactively, this command temporarily enables
+menu items or tool-bar buttons that are disabled to allow getting help
+on them.
+
+BUFFER is the buffer in which to lookup those keys; it defaults to the
+current buffer."
+  (declare (advertised-calling-convention (key-list &optional buffer) "27.1"))
+  (interactive (list (help--read-key-sequence)))
+  (when (arrayp key-list)
+    ;; Compatibility with old calling convention.
+    (setq key-list (cons (list key-list) (if up-event (list up-event))))
+    (when buffer
+      (let ((raw (if (numberp buffer) (this-single-command-raw-keys) buffer)))
+        (setf (cdar (last key-list)) raw)))
+    (setq buffer nil))
+  (let* ((buf (or buffer (current-buffer)))
+         (on-link
+          (mapcar (lambda (kr)
+                    (let ((raw (cdr kr)))
+                      (and (not (memq mouse-1-click-follows-link '(nil double)))
+                           (> (length raw) 0)
+                           (eq (car-safe (aref raw 0)) 'mouse-1)
+                           (with-current-buffer buf
+                             (mouse-on-link-p (event-start (aref raw 0)))))))
+                  key-list))
+         (info-list
+          (help--filter-info-list
+           (with-current-buffer buf
+             (mapcar (lambda (x)
+                       (pcase-let* ((`(,seq . ,raw-seq) x)
+                                    (`(,brief-desc ,defn ,event ,_mouse-msg)
+                                     (help--analyze-key seq raw-seq))
+                                    (locus
+                                     (help--binding-locus
+                                      seq (event-start event))))
+                         `(,seq ,brief-desc ,defn ,locus)))
+                     key-list))
+           2)))
+    (help-setup-xref (list (lambda (key-list buf)
+                             (describe-key key-list
+                                           (if (buffer-live-p buf) buf)))
+                           key-list buf)
+		     (called-interactively-p 'interactive))
+    (if (and (<= (length info-list) 1)
+             (help--binding-undefined-p (nth 2 (car info-list))))
+        (message "%s" (nth 1 (car info-list)))
       (with-help-window (help-buffer)
-        (princ brief-desc)
-        (let ((key-locus (help--binding-locus key (event-start event))))
-          (when key-locus
-            (princ (format " (found in %s)" key-locus))))
-        (princ ", which is ")
-	(describe-function-1 defn)
-        (when (vectorp key)
-          (let* ((last (1- (length key)))
-                 (elt (aref key last))
-                 (elt-1 (if (listp elt) (copy-sequence elt) elt))
-                 key-1 down-event-type)
-            (when (and (listp elt-1)
-                       (symbolp (car elt-1))
-                       (setq down-event-type (help-downify-mouse-event-type
-                                              (car elt-1))))
-              (setcar elt-1 down-event-type)
-              (setq key-1 (vector elt-1))
-              (when (key-binding key-1)
-                (princ (format "
-
-For documentation of the corresponding mouse down event <%s>,
-click and hold the mouse button longer than %s second(s)."
-                               down-event-type (if (numberp double-click-time)
-                                                   (/ double-click-time 1000.0)
-                                                 3)))))))
-	(when up-event
-	  (unless (or (null defn-up)
-		      (integerp defn-up)
-		      (equal defn-up 'undefined))
-	    (princ (format "
-
------------------ up-event %s----------------
-
-%s%s%s runs the command %S%s, which is "
-			   (if mouse-1-tricky "(short click) " "")
-			   (key-description (vector up-event))
-			   mouse-msg
-			   (if mouse-1-remapped
-                               " is remapped to <mouse-2>, which" "")
-			   defn-up (if key-locus-up
-                                       (format " (found in %s)" key-locus-up)
-                                     "")))
-	    (describe-function-1 defn-up))
-	  (unless (or (null defn-up-tricky)
-		      (integerp defn-up-tricky)
-		      (eq defn-up-tricky 'undefined))
-	    (princ (format "
-
------------------ up-event (long click) ----------------
-
-Pressing <%S>%s for longer than %d milli-seconds
-runs the command %S%s, which is "
-			   ev-type mouse-msg
-			   mouse-1-click-follows-link
-			   defn-up-tricky (if key-locus-up-tricky
-                                              (format " (found in %s)" key-locus-up-tricky)
-                                            "")))
-	    (describe-function-1 defn-up-tricky)))))))
+        (when (> (length info-list) 1)
+          ;; FIXME: Make this into clickable hyperlinks.
+          (princ "There were several key-sequences:\n\n")
+          (princ (mapconcat (lambda (info)
+                              (pcase-let ((`(,_seq ,brief-desc ,_defn ,_locus)
+                                           info))
+                                (concat "  " brief-desc)))
+                            info-list
+                            "\n"))
+          (when (delq nil on-link)
+            (princ "\n\nThose are influenced by `mouse-1-click-follows-link'"))
+          (princ "\n\nThey're all described below."))
+        (pcase-dolist (`(,_seq ,brief-desc ,defn ,locus)
+                       info-list)
+          (when defn
+            (when (> (length info-list) 1)
+              (with-current-buffer standard-output
+                (insert "\n\n"
+                        (eval-when-compile
+                          (propertize "\n" 'face '(:height 0.1 :inverse-video t)))
+                        "\n")))
+
+            (princ brief-desc)
+            (when locus
+              (princ (format " (found in %s)" locus)))
+            (princ ", which is ")
+	    (describe-function-1 defn)))))))
 
 (defun describe-mode (&optional buffer)
   "Display documentation of current major mode and minor modes.
@@ -1120,7 +1058,7 @@ lookup-minor-mode-from-indicator
 
 ;;; Automatic resizing of temporary buffers.
 (defcustom temp-buffer-max-height
-  (lambda (buffer)
+  (lambda (_buffer)
     (if (and (display-graphic-p) (eq (selected-window) (frame-root-window)))
 	(/ (x-display-pixel-height) (frame-char-height) 2)
       (/ (- (frame-height) 2) 2)))
@@ -1137,7 +1075,7 @@ temp-buffer-max-height
   :version "24.3")
 
 (defcustom temp-buffer-max-width
-  (lambda (buffer)
+  (lambda (_buffer)
     (if (and (display-graphic-p) (eq (selected-window) (frame-root-window)))
 	(/ (x-display-pixel-width) (frame-char-width) 2)
       (/ (- (frame-width) 2) 2)))




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

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


Received: (at 29478) by debbugs.gnu.org; 28 Jan 2018 17:19:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 28 12:19:15 2018
Received: from localhost ([127.0.0.1]:46432 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1efqbp-0005Cv-I7
	for submit <at> debbugs.gnu.org; Sun, 28 Jan 2018 12:19:15 -0500
Received: from eggs.gnu.org ([208.118.235.92]:36267)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1efqbn-0005Cj-ND
 for 29478 <at> debbugs.gnu.org; Sun, 28 Jan 2018 12:19:12 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1efqbf-00038P-4X
 for 29478 <at> debbugs.gnu.org; Sun, 28 Jan 2018 12:19:06 -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_20,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42672)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1efqbU-00034n-Ud; Sun, 28 Jan 2018 12:18:52 -0500
Received: from [176.228.60.248] (port=4717 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 1efqbU-0001o7-BN; Sun, 28 Jan 2018 12:18:52 -0500
Date: Sun, 28 Jan 2018 19:18:57 +0200
Message-Id: <83tvv5j3zy.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
In-reply-to: <jwvy3kjxsma.fsf-monnier+emacsbugs@HIDDEN> (message from Stefan
 Monnier on Sun, 28 Jan 2018 11:02:26 -0500)
Subject: Re: [Patch] bug#29478: 26.0.90;
 `C-h k' followed by mouse clicks no longer shows down event
References: <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
 <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
 <20171222220549.GC8072@ACM> <833741lr0t.fsf@HIDDEN>
 <20171223111726.GA6618@ACM>
 <jwv4lohjv1e.fsf-monnier+emacsbugs@HIDDEN>
 <20171223210407.GC6618@ACM>
 <jwvbmioipxp.fsf-monnier+emacsbugs@HIDDEN> <831sjcfq1v.fsf@HIDDEN>
 <jwva7xv8une.fsf-monnier+emacsbugs@HIDDEN> <83zi5q997a.fsf@HIDDEN>
 <jwvwp04qoxg.fsf-monnier+emacsbugs@HIDDEN>
 <jwvr2qcqmbm.fsf-monnier+emacsbugs@HIDDEN> <83shark8nl.fsf@HIDDEN>
 <jwvy3kjxsma.fsf-monnier+emacsbugs@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: 29478
Cc: acm@HIDDEN, 29478 <at> debbugs.gnu.org, npostavs@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>
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: Stefan Monnier <monnier@HIDDEN>
> Cc: acm@HIDDEN, 29478 <at> debbugs.gnu.org, npostavs@HIDDEN
> Date: Sun, 28 Jan 2018 11:02:26 -0500
> 
> > > We can probably come up with some heuristic to keep "at least one line
> > > of output" or something, but I think it's more useful for the user to
> > > report all the events and their binding or lack thereof since we don't
> > > really know what the user is looking for.
> 
> > I'd prefer the "undefined" lines to appear only if none of the
> > possible interpretations is bound to a command, yes.
> 
> Not sure what this means.

It means I'm okay with this:

  FOO is undefined

but prefer not to see the second line in this:

  FOO at that spot runs BAR
  down-FOO at that spot is undefined




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

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


Received: (at 29478) by debbugs.gnu.org; 28 Jan 2018 16:02:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 28 11:02:30 2018
Received: from localhost ([127.0.0.1]:46408 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1efpPa-0003U0-CE
	for submit <at> debbugs.gnu.org; Sun, 28 Jan 2018 11:02:30 -0500
Received: from pruche.dit.umontreal.ca ([132.204.246.22]:41508)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1efpPY-0003Ts-61
 for 29478 <at> debbugs.gnu.org; Sun, 28 Jan 2018 11:02:28 -0500
Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242])
 by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w0SG2QMO007870;
 Sun, 28 Jan 2018 11:02:27 -0500
Received: by pastel.home (Postfix, from userid 20848)
 id 7788E605CC; Sun, 28 Jan 2018 11:02:26 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: [Patch] bug#29478: 26.0.90;
 `C-h k' followed by mouse clicks no longer shows down event
Message-ID: <jwvy3kjxsma.fsf-monnier+emacsbugs@HIDDEN>
References: <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
 <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
 <20171222220549.GC8072@ACM> <833741lr0t.fsf@HIDDEN>
 <20171223111726.GA6618@ACM>
 <jwv4lohjv1e.fsf-monnier+emacsbugs@HIDDEN>
 <20171223210407.GC6618@ACM>
 <jwvbmioipxp.fsf-monnier+emacsbugs@HIDDEN> <831sjcfq1v.fsf@HIDDEN>
 <jwva7xv8une.fsf-monnier+emacsbugs@HIDDEN> <83zi5q997a.fsf@HIDDEN>
 <jwvwp04qoxg.fsf-monnier+emacsbugs@HIDDEN>
 <jwvr2qcqmbm.fsf-monnier+emacsbugs@HIDDEN> <83shark8nl.fsf@HIDDEN>
Date: Sun, 28 Jan 2018 11:02:26 -0500
In-Reply-To: <83shark8nl.fsf@HIDDEN> (Eli Zaretskii's message of "Sat, 27 Jan
 2018 10:28:30 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-NAI-Spam-Flag: NO
X-NAI-Spam-Threshold: 5
X-NAI-Spam-Score: 0
X-NAI-Spam-Rules: 2 Rules triggered
	EDT_SA_DN_PASS=0, RV6209=0
X-NAI-Spam-Version: 2.3.0.9418 : core <6209> : inlines <6344> : streams
 <1777352> : uri <2581394>
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: 29478
Cc: acm@HIDDEN, 29478 <at> debbugs.gnu.org, npostavs@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: -1.3 (-)

>> +(defun help--first-event (keyseq)
>> +  (when (> (length keyseq) 0)
>> +    (aref keyseq (if (and (symbolp (aref keyseq 0))
>> +		          (> (length keyseq) 1)
>> +		          (consp (aref keyseq 1)))
>> +                     ;; Look at the second event when the first
>> +                     ;; is a pseudo-event like `mode-line' of `left-fringe'.
>> +		     1
>> +	           0))))
>
> Should we perhaps test explicitly for pseudo-events, in case some day
> we have events we don't want to skip?  Or maybe have an assertion
> here, for that future day?

[ This code was moved from help--analyze-key, so improving it is
  orthogonal to the patch under discussion.  Especially now that I see
  that the reason why I extracted this function (to use it in
  help-read-key-sequence) doesn't apply any more.  ]

You mean we should check that (aref keyseq 0) is within
(mode-line left-fringe right-fringe ...)?

I guess we could but what could we do with the result of the check?
Signaling an error would not be very useful to the user.

Note that the output of this function is only used to extract the
modifiers of the event to then decide whether we add the text "at that
spot" or not, so it's really not important.

>> -(defun describe-key-briefly (&optional key insert untranslated)
>> -  "Print the name of the function KEY invokes.  KEY is a string.
>> +(defun describe-key-briefly (key-list &optional insert)
>> +  "Print the name of the functions KEY-LIST invokes.
>
> Is it a good idea to change the signature of this function?

It's indeed the main issue I see with the patch: it completely changes
the signature of several functions.

> I'm sure it's used in many places, including outside Emacs.

I couldn't find any use of those functions outside of Emacs (I did find
uses as commands, but not as functions).  But indeed I now see that
there are some uses within Emacs, which I'd need to fix.

I'll change the new code to accept the old calling convention.

>>  (defun help-read-key-sequence (&optional no-mouse-movement)
>> -  "Reads a key sequence from the user.
>> -Returns a list of the form (KEY UP-EVENT), where KEY is the key
>> -sequence, and UP-EVENT is the up-event that was discarded by
>> -reading KEY, or nil.
>> +  "Read \"a\" key sequence from the user.
>
> Why "a" in quotes?

Because it can also return several key sequences.  But now that you
mention it, it's better not to put those quotes and simply explain it
better in the subsequent text.

>> +Return a list of elements of the form (SEQ . RAW-SEQ), where SEQ is a key
>> +sequence, and RAW-SEQ is its untranslated form.
> This also changes the format of the return value in incompatible way,
> doesn't it?

Yes.

> Is this incompatible change justified?

Yes: we can't recover all the RAW-SEQs after the call (only the
RAW-SEQ of the last element which can still be obtained from
this-single-command-raw-keys), so the old return value format throws
away information we need to emit complete information.

In any case, this function is (or at least should be) internal, so I now
renamed it with a "help--" prefix.  If external callers show up, we may
have to revisit this, but I couldn't find any.

>> -(defun describe-key (&optional key untranslated up-event)
>> -  "Display documentation of the function invoked by KEY.
>> -KEY can be any kind of a key sequence; it can include keyboard events,
>> +(defun describe-key (key-list &optional buffer)
>> +  "Display documentation of the function invoked by KEY-LIST.
>> +KEY-LIST can be any kind of a key sequence; it can include keyboard events,
>>  mouse events, and/or menu events.  When calling from a program,
> Same issue here.

I'll also add compatibility to the old calling convention.

> > We can probably come up with some heuristic to keep "at least one line
> > of output" or something, but I think it's more useful for the user to
> > report all the events and their binding or lack thereof since we don't
> > really know what the user is looking for.

> I'd prefer the "undefined" lines to appear only if none of the
> possible interpretations is bound to a command, yes.

Not sure what this means.


        Stefan




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

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


Received: (at 29478) by debbugs.gnu.org; 27 Jan 2018 08:28:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 27 03:28:50 2018
Received: from localhost ([127.0.0.1]:44322 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1efLr0-0007cS-4z
	for submit <at> debbugs.gnu.org; Sat, 27 Jan 2018 03:28:50 -0500
Received: from eggs.gnu.org ([208.118.235.92]:42770)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1efLqy-0007cG-8A
 for 29478 <at> debbugs.gnu.org; Sat, 27 Jan 2018 03:28:48 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1efLqq-00075X-1T
 for 29478 <at> debbugs.gnu.org; Sat, 27 Jan 2018 03:28: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=-0.0 required=5.0 tests=BAYES_40,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50506)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1efLqg-000727-5m; Sat, 27 Jan 2018 03:28:30 -0500
Received: from [176.228.60.248] (port=2324 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 1efLqf-0007Me-F2; Sat, 27 Jan 2018 03:28:29 -0500
Date: Sat, 27 Jan 2018 10:28:30 +0200
Message-Id: <83shark8nl.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
In-reply-to: <jwvr2qcqmbm.fsf-monnier+emacsbugs@HIDDEN> (message from Stefan
 Monnier on Fri, 26 Jan 2018 17:37:22 -0500)
Subject: Re: [Patch] bug#29478: 26.0.90;
 `C-h k' followed by mouse clicks no longer shows down event
References: <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
 <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
 <20171222220549.GC8072@ACM> <833741lr0t.fsf@HIDDEN>
 <20171223111726.GA6618@ACM>
 <jwv4lohjv1e.fsf-monnier+emacsbugs@HIDDEN>
 <20171223210407.GC6618@ACM>
 <jwvbmioipxp.fsf-monnier+emacsbugs@HIDDEN> <831sjcfq1v.fsf@HIDDEN>
 <jwva7xv8une.fsf-monnier+emacsbugs@HIDDEN> <83zi5q997a.fsf@HIDDEN>
 <jwvwp04qoxg.fsf-monnier+emacsbugs@HIDDEN>
 <jwvr2qcqmbm.fsf-monnier+emacsbugs@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
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: 29478
Cc: acm@HIDDEN, 29478 <at> debbugs.gnu.org, npostavs@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>
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: Stefan Monnier <monnier@HIDDEN>
> Cc: acm@HIDDEN, 29478 <at> debbugs.gnu.org, npostavs@HIDDEN
> Date: Fri, 26 Jan 2018 17:37:22 -0500
> 
> >>> If you want a patch that applies, the one below should work.
> >> Thanks.  It needs some more work.  E.g., "C-h k C-mouse-1" signals an
> >> error:
> >>   help-fns--analyze-function: Symbol’s function definition is void: nil
> > The patch below fixes this...
> 
> Sorry, wrong patch!
> 
> I meant this one,
> 
> 
>         Stefan
> 
> 
> diff --git a/lisp/help.el b/lisp/help.el
> index 014af5141e..1f92c38927 100644
> --- a/lisp/help.el
> +++ b/lisp/help.el
> @@ -1,4 +1,4 @@
> -;;; help.el --- help commands for Emacs
> +;;; help.el --- help commands for Emacs  -*- lexical-binding:t -*-
>  
>  ;; Copyright (C) 1985-1986, 1993-1994, 1998-2018 Free Software
>  ;; Foundation, Inc.
> @@ -593,19 +593,26 @@ help-key-description
>  	    string
>  	  (format "%s (translated from %s)" string otherstring))))))
>  
> +(defun help--first-event (keyseq)
> +  (when (> (length keyseq) 0)
> +    (aref keyseq (if (and (symbolp (aref keyseq 0))
> +		          (> (length keyseq) 1)
> +		          (consp (aref keyseq 1)))
> +                     ;; Look at the second event when the first
> +                     ;; is a pseudo-event like `mode-line' of `left-fringe'.
> +		     1
> +	           0))))

Should we perhaps test explicitly for pseudo-events, in case some day
we have events we don't want to skip?  Or maybe have an assertion
here, for that future day?

> -(defun describe-key-briefly (&optional key insert untranslated)
> -  "Print the name of the function KEY invokes.  KEY is a string.
> +(defun describe-key-briefly (key-list &optional insert)
> +  "Print the name of the functions KEY-LIST invokes.

Is it a good idea to change the signature of this function?  I'm sure
it's used in many places, including outside Emacs.

>  (defun help-read-key-sequence (&optional no-mouse-movement)
> -  "Reads a key sequence from the user.
> -Returns a list of the form (KEY UP-EVENT), where KEY is the key
> -sequence, and UP-EVENT is the up-event that was discarded by
> -reading KEY, or nil.
> +  "Read \"a\" key sequence from the user.

Why "a" in quotes?

> +Return a list of elements of the form (SEQ . RAW-SEQ), where SEQ is a key
> +sequence, and RAW-SEQ is its untranslated form.

This also changes the format of the return value in incompatible way,
doesn't it?  Is this incompatible change justified?

> -(defun describe-key (&optional key untranslated up-event)
> -  "Display documentation of the function invoked by KEY.
> -KEY can be any kind of a key sequence; it can include keyboard events,
> +(defun describe-key (key-list &optional buffer)
> +  "Display documentation of the function invoked by KEY-LIST.
> +KEY-LIST can be any kind of a key sequence; it can include keyboard events,
>  mouse events, and/or menu events.  When calling from a program,

Same issue here.

Thanks.




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

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


Received: (at 29478) by debbugs.gnu.org; 27 Jan 2018 07:59:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 27 02:59:43 2018
Received: from localhost ([127.0.0.1]:44301 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1efLOo-0006vd-Cp
	for submit <at> debbugs.gnu.org; Sat, 27 Jan 2018 02:59:42 -0500
Received: from eggs.gnu.org ([208.118.235.92]:39278)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1efLOm-0006vR-4u
 for 29478 <at> debbugs.gnu.org; Sat, 27 Jan 2018 02:59:40 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1efLOc-0005Mv-LX
 for 29478 <at> debbugs.gnu.org; Sat, 27 Jan 2018 02:59:34 -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,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50251)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1efLOP-0005D5-Da; Sat, 27 Jan 2018 02:59:17 -0500
Received: from [176.228.60.248] (port=2297 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 1efLOO-0005ub-3J; Sat, 27 Jan 2018 02:59:17 -0500
Date: Sat, 27 Jan 2018 09:59:15 +0200
Message-Id: <83vafnka0c.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
In-reply-to: <jwvwp04qoxg.fsf-monnier+emacsbugs@HIDDEN> (message from Stefan
 Monnier on Fri, 26 Jan 2018 17:00:15 -0500)
Subject: Re: [Patch] bug#29478: 26.0.90;
 `C-h k' followed by mouse clicks no longer shows down event
References: <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
 <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
 <20171222220549.GC8072@ACM> <833741lr0t.fsf@HIDDEN>
 <20171223111726.GA6618@ACM>
 <jwv4lohjv1e.fsf-monnier+emacsbugs@HIDDEN>
 <20171223210407.GC6618@ACM>
 <jwvbmioipxp.fsf-monnier+emacsbugs@HIDDEN> <831sjcfq1v.fsf@HIDDEN>
 <jwva7xv8une.fsf-monnier+emacsbugs@HIDDEN> <83zi5q997a.fsf@HIDDEN>
 <jwvwp04qoxg.fsf-monnier+emacsbugs@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: 29478
Cc: acm@HIDDEN, 29478 <at> debbugs.gnu.org, npostavs@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>
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: Stefan Monnier <monnier@HIDDEN>
> Cc: acm@HIDDEN, 29478 <at> debbugs.gnu.org, npostavs@HIDDEN
> Date: Fri, 26 Jan 2018 17:00:15 -0500
> 
> >   <S-down-mouse-1> at that spot runs the command mouse-appearance-menu
> >   <S-mouse-1> at that spot is undefined
> >
> > I'd expect the second line not to appear.
> 
> About that, I wrote:
> 
>     OTOH, for text-terminals, we add a "(translated from <escape-sequence>)"
>     and we could do the same here (that's what my patch originally did, by
>     the way, and that's what I've been using all these years since I think
>     it's very valuable information), which would say:
>     
>        <C-H-mouse-1> (translated from <C-H-down-mouse-1> <C-H-mouse-1>)
>        at that spot is undefined
> 
> but I misremembered, the above also appears in vanilla Emacs.  Regarding
> your example:
> 
>     <S-down-mouse-1> at that spot runs the command mouse-appearance-menu
>     <S-mouse-1> at that spot is undefined
> 
> it's hard to do much better: the S-mouse-1 event is eaten by
> `mouse-appearance-menu` but it's basically impossible to determine
> that automatically.
> 
> And if you want to "not show undefined sequences", does that mean we
> don't say anything at all for `C-h k M-_` rather than "M-_ is undefined"?
> How 'bout `C-h c M-S-double-mouse-1` which with my code says (courtesy
> copy-next-command-output (!)):
> 
>     <M-S-mouse-1> (translated from <M-S-down-mouse-1> <M-S-mouse-1>) at that spot is undefined
>     <M-S-double-mouse-1> (translated from <M-S-double-down-mouse-1> <M-S-double-mouse-1>) is undefined
> 
> We can probably come up with some heuristic to keep "at least one line
> of output" or something, but I think it's more useful for the user to
> report all the events and their binding or lack thereof since we don't
> really know what the user is looking for.

I'd prefer the "undefined" lines to appear only if none of the
possible interpretations is bound to a command, yes.




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

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


Received: (at 29478) by debbugs.gnu.org; 26 Jan 2018 22:37:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 26 17:37:27 2018
Received: from localhost ([127.0.0.1]:44130 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1efCcg-000777-IU
	for submit <at> debbugs.gnu.org; Fri, 26 Jan 2018 17:37:27 -0500
Received: from pruche.dit.umontreal.ca ([132.204.246.22]:53739)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1efCce-00076y-BC
 for 29478 <at> debbugs.gnu.org; Fri, 26 Jan 2018 17:37:25 -0500
Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242])
 by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w0QMbMah030950;
 Fri, 26 Jan 2018 17:37:22 -0500
Received: by pastel.home (Postfix, from userid 20848)
 id 65CB460608; Fri, 26 Jan 2018 17:37:22 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: [Patch] bug#29478: 26.0.90;
 `C-h k' followed by mouse clicks no longer shows down event
Message-ID: <jwvr2qcqmbm.fsf-monnier+emacsbugs@HIDDEN>
References: <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
 <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
 <20171222220549.GC8072@ACM> <833741lr0t.fsf@HIDDEN>
 <20171223111726.GA6618@ACM>
 <jwv4lohjv1e.fsf-monnier+emacsbugs@HIDDEN>
 <20171223210407.GC6618@ACM>
 <jwvbmioipxp.fsf-monnier+emacsbugs@HIDDEN> <831sjcfq1v.fsf@HIDDEN>
 <jwva7xv8une.fsf-monnier+emacsbugs@HIDDEN> <83zi5q997a.fsf@HIDDEN>
 <jwvwp04qoxg.fsf-monnier+emacsbugs@HIDDEN>
Date: Fri, 26 Jan 2018 17:37:22 -0500
In-Reply-To: <jwvwp04qoxg.fsf-monnier+emacsbugs@HIDDEN> (Stefan Monnier's
 message of "Fri, 26 Jan 2018 17:00:15 -0500")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-NAI-Spam-Flag: NO
X-NAI-Spam-Threshold: 5
X-NAI-Spam-Score: 0
X-NAI-Spam-Rules: 2 Rules triggered
	EDT_SA_DN_PASS=0, RV6209=0
X-NAI-Spam-Version: 2.3.0.9418 : core <6209> : inlines <6344> : streams
 <1777187> : uri <2580078>
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: 29478
Cc: acm@HIDDEN, 29478 <at> debbugs.gnu.org, npostavs@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: -1.3 (-)

>>> If you want a patch that applies, the one below should work.
>> Thanks.  It needs some more work.  E.g., "C-h k C-mouse-1" signals an
>> error:
>>   help-fns--analyze-function: Symbol=E2=80=99s function definition is vo=
id: nil
> The patch below fixes this...

Sorry, wrong patch!

I meant this one,


        Stefan


diff --git a/lisp/help.el b/lisp/help.el
index 014af5141e..1f92c38927 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1,4 +1,4 @@
-;;; help.el --- help commands for Emacs
+;;; help.el --- help commands for Emacs  -*- lexical-binding:t -*-
=20
 ;; Copyright (C) 1985-1986, 1993-1994, 1998-2018 Free Software
 ;; Foundation, Inc.
@@ -593,19 +593,26 @@ help-key-description
 	    string
 	  (format "%s (translated from %s)" string otherstring))))))
=20
+(defun help--first-event (keyseq)
+  (when (> (length keyseq) 0)
+    (aref keyseq (if (and (symbolp (aref keyseq 0))
+		          (> (length keyseq) 1)
+		          (consp (aref keyseq 1)))
+                     ;; Look at the second event when the first
+                     ;; is a pseudo-event like `mode-line' of `left-fringe=
'.
+		     1
+	           0))))
+
 (defun help--analyze-key (key untranslated)
   "Get information about KEY its corresponding UNTRANSLATED events.
 Returns a list of the form (BRIEF-DESC DEFN EVENT MOUSE-MSG)."
   (if (numberp untranslated)
-      (setq untranslated (this-single-command-raw-keys)))
-  (let* ((event (aref key (if (and (symbolp (aref key 0))
-				   (> (length key) 1)
-				   (consp (aref key 1)))
-			      1
-			    0)))
+      (error "Missing `untranslated'!"))
+  (let* ((event (help--first-event key))
 	 (modifiers (event-modifiers event))
 	 (mouse-msg (if (or (memq 'click modifiers) (memq 'down modifiers)
-			    (memq 'drag modifiers)) " at that spot" ""))
+			    (memq 'drag modifiers))
+                        " at that spot" ""))
 	 (defn (key-binding key t)))
     ;; Handle the case where we faked an entry in "Select and Paste" menu.
     (when (and (eq defn nil)
@@ -626,22 +633,26 @@ help--analyze-key
          (format "%s%s runs the command %S" key-desc mouse-msg defn)))
      defn event mouse-msg)))
=20
-(defun describe-key-briefly (&optional key insert untranslated)
-  "Print the name of the function KEY invokes.  KEY is a string.
+(defun describe-key-briefly (key-list &optional insert)
+  "Print the name of the functions KEY-LIST invokes.
+KEY-LIST is a list of pairs (SEQ . RAW-SEQ) of key sequences, where
+RAW-SEQ is the untranslated form of the key sequence SEQ.
 If INSERT (the prefix arg) is non-nil, insert the message in the buffer.
-If non-nil, UNTRANSLATED is a vector of the untranslated events.
-It can also be a number in which case the untranslated events from
-the last key hit are used.
=20
-If KEY is a menu item or a tool-bar button that is disabled, this command
-temporarily enables it to allow getting help on disabled items and buttons=
."
+While reading KEY-LIST interactively, this command temporarily enables
+menu items or tool-bar buttons that are disabled to allow getting help
+on them."
   (interactive
    ;; Ignore mouse movement events because it's too easy to miss the
    ;; message while moving the mouse.
-   (pcase-let ((`(,key ,_up-event) (help-read-key-sequence 'no-mouse-movem=
ent)))
-     `(,key ,current-prefix-arg 1)))
-  (princ (car (help--analyze-key key untranslated))
-         (if insert (current-buffer) standard-output)))
+   (let ((key-list (help-read-key-sequence 'no-mouse-movement)))
+     `(,key-list ,current-prefix-arg)))
+  (let ((msg (mapconcat (lambda (x)
+                          (pcase-let ((`(,seq . ,raw-seq) x))
+                            (car (help--analyze-key seq raw-seq))))
+                        key-list
+                        "\n")))
+    (if insert (insert msg) (message "%s" msg))))
=20
 (defun help--key-binding-keymap (key &optional accept-default no-remap pos=
ition)
   "Return a keymap holding a binding for KEY within current keymaps.
@@ -688,8 +699,7 @@ help--binding-locus
                                               (format "%s-map" mode)))))
                                        minor-mode-map-alist))
                                 (list 'global-map
-                                      (intern-soft (format "%s-map" major-=
mode)))))
-              found)
+                                      (intern-soft (format "%s-map" major-=
mode))))))
           ;; Look into these advertised symbols first.
           (dolist (sym advertised-syms)
             (when (and
@@ -707,224 +717,105 @@ help--binding-locus
           nil)))))
=20
 (defun help-read-key-sequence (&optional no-mouse-movement)
-  "Reads a key sequence from the user.
-Returns a list of the form (KEY UP-EVENT), where KEY is the key
-sequence, and UP-EVENT is the up-event that was discarded by
-reading KEY, or nil.
+  "Read \"a\" key sequence from the user.
+Return a list of elements of the form (SEQ . RAW-SEQ), where SEQ is a key
+sequence, and RAW-SEQ is its untranslated form.
 If NO-MOUSE-MOVEMENT is non-nil, ignore key sequences starting
 with `mouse-movement' events."
   (let ((enable-disabled-menus-and-buttons t)
         (cursor-in-echo-area t)
         saved-yank-menu)
     (unwind-protect
-        (let (key keys down-ev discarded-up)
+        (let (last-modifiers key-list)
           ;; If yank-menu is empty, populate it temporarily, so that
           ;; "Select and Paste" menu can generate a complete event.
           (when (null (cdr yank-menu))
             (setq saved-yank-menu (copy-sequence yank-menu))
             (menu-bar-update-yank-menu "(any string)" nil))
           (while
-              (pcase (setq key (read-key-sequence "\
+              ;; Read at least one key-sequence.
+              (or (null key-list)
+                  ;; After a down event, also read the (presumably) follow=
ing
+                  ;; up-event.
+                  (memq 'down last-modifiers)
+                  ;; After a click, see if a double click is on the way.
+                  (and (memq 'click last-modifiers)
+                       (not (sit-for (/ double-click-time 1000.0) t))))
+            (let* ((seq (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 key=
0)))
-                 (or
-                  (and no-mouse-movement
-                       (string-match "mouse-movement" keyname))
-                  (progn (push key keys) nil)
-                  (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.01)
-                         (while (read-event nil nil 0.01))
-                         (not (sit-for
-                               (if (numberp double-click-time)
-                                   (/ double-click-time 1000.0)
-                                 3.0)
-                               t))))))))
-          ;; When we have a sequence of mouse events, discard the most
-          ;; recent ones till we find one with a binding.
-          (let ((keys-1 keys))
-            (while (and keys-1
-                        (not (key-binding (car keys-1))))
-              ;; If we discard the last event, and this was a mouse
-              ;; up, remember this.
-              (if (and (eq keys-1 keys)
-                       (vectorp (car keys-1))
-                       (let* ((last-idx (1- (length (car keys-1))))
-                              (last (aref (car keys-1) last-idx)))
-                         (and (eventp last)
-                              (memq 'click (event-modifiers last)))))
-                  (setq discarded-up t))
-              (setq keys-1 (cdr keys-1)))
-            (if keys-1
-                (setq key (car keys-1))))
-          (list
-           key
-           ;; If KEY is a down-event, read and include the
-           ;; corresponding up-event.  Note that there are also
-           ;; down-events on scroll bars and mode lines: the actual
-           ;; event then is in the second element of the vector.
-           (and (not discarded-up) ; Don't attempt to ignore the up-event =
twice.
-                (vectorp key)
-                (let ((last-idx (1- (length key))))
-                  (and (eventp (aref key last-idx))
-                       (memq 'down (event-modifiers (aref key last-idx)))))
-                (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.
-                         (=3D (length key) 1))
-                    (and (> (length key) 1)
-                         (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)))))
+                   (raw-seq (this-single-command-raw-keys))
+                   (keyn (when (> (length seq) 0)
+                           (aref seq (1- (length seq)))))
+                   (base (event-basic-type keyn))
+                   (modifiers (event-modifiers keyn)))
+              (cond
+               ((zerop (length seq)))   ;FIXME: Can this happen?
+               ((and no-mouse-movement (eq base 'mouse-movement)) nil)
+               ((eq base 'help-echo) nil)
+               (t
+                (setq last-modifiers modifiers)
+                (push (cons seq raw-seq) key-list)))))
+          (nreverse key-list))
       ;; Put yank-menu back as it was, if we changed it.
       (when saved-yank-menu
         (setq yank-menu (copy-sequence saved-yank-menu))
         (fset 'yank-menu (cons 'keymap yank-menu))))))
=20
-(defun help-downify-mouse-event-type (base)
-  "Add \"down-\" to BASE if it is not already there.
-BASE is a symbol, a mouse event type.  If the modification is done,
-return the new symbol.  Otherwise return nil."
-  (let ((base-s (symbol-name base)))
-    ;; Note: the order of the components in the following string is
-    ;; determined by `apply_modifiers_uncached' in src/keyboard.c.
-    (string-match "\\(A-\\)?\
-\\(C-\\)?\
-\\(H-\\)?\
-\\(M-\\)?\
-\\(S-\\)?\
-\\(s-\\)?\
-\\(double-\\)?\
-\\(triple-\\)?\
-\\(up-\\)?\
-\\(\\(down-\\)?\\)\
-\\(drag-\\)?" base-s)
-    (when (and (null (match-beginning 11)) ; "down-"
-               (null (match-beginning 12))) ; "drag-"
-      (intern (replace-match "down-" t t base-s 10)) )))
-
-(defun describe-key (&optional key untranslated up-event)
-  "Display documentation of the function invoked by KEY.
-KEY can be any kind of a key sequence; it can include keyboard events,
+(defun describe-key (key-list &optional buffer)
+  "Display documentation of the function invoked by KEY-LIST.
+KEY-LIST can be any kind of a key sequence; it can include keyboard events,
 mouse events, and/or menu events.  When calling from a program,
-pass KEY as a string or a vector.
-
-If non-nil, UNTRANSLATED is a vector of the corresponding untranslated eve=
nts.
-It can also be a number, in which case the untranslated events from
-the last key sequence entered are used.
-UP-EVENT is the up-event that was discarded by reading KEY, or nil.
-
-If KEY is a menu item or a tool-bar button that is disabled, this command
-temporarily enables it to allow getting help on disabled items and buttons=
."
-  (interactive
-   (pcase-let ((`(,key ,up-event) (help-read-key-sequence)))
-     `(,key ,(prefix-numeric-value current-prefix-arg) ,up-event)))
-  (pcase-let ((`(,brief-desc ,defn ,event ,mouse-msg)
-               (help--analyze-key key untranslated))
-              (defn-up nil) (defn-up-tricky nil)
-              (key-locus-up nil) (key-locus-up-tricky nil)
-              (mouse-1-remapped nil) (mouse-1-tricky nil)
-              (ev-type nil))
-    (if (or (null defn)
-            (integerp defn)
-            (equal defn 'undefined))
-        (message "%s" brief-desc)
-      (help-setup-xref (list #'describe-function defn)
-		       (called-interactively-p 'interactive))
-      ;; Need to do this before erasing *Help* buffer in case event
-      ;; is a mouse click in an existing *Help* buffer.
-      (when up-event
-	(setq ev-type (event-basic-type up-event))
-	(let ((sequence (vector up-event)))
-	  (when (and (eq ev-type 'mouse-1)
-		     mouse-1-click-follows-link
-		     (not (eq mouse-1-click-follows-link 'double))
-		     (setq mouse-1-remapped
-			   (mouse-on-link-p (event-start up-event))))
-	    (setq mouse-1-tricky (and (integerp mouse-1-click-follows-link)
-				      (> mouse-1-click-follows-link 0)))
-	    (cond ((stringp mouse-1-remapped)
-		   (setq sequence mouse-1-remapped))
-		  ((vectorp mouse-1-remapped)
-		   (setcar up-event (elt mouse-1-remapped 0)))
-		  (t (setcar up-event 'mouse-2))))
-	  (setq defn-up (key-binding sequence nil nil (event-start up-event)))
-          (setq key-locus-up (help--binding-locus sequence (event-start up=
-event)))
-	  (when mouse-1-tricky
-	    (setq sequence (vector up-event))
-	    (aset sequence 0 'mouse-1)
-	    (setq defn-up-tricky (key-binding sequence nil nil (event-start up-ev=
ent)))
-            (setq key-locus-up-tricky (help--binding-locus sequence (event=
-start up-event))))))
-      (with-help-window (help-buffer)
-        (princ brief-desc)
-        (let ((key-locus (help--binding-locus key (event-start event))))
-          (when key-locus
-            (princ (format " (found in %s)" key-locus))))
-        (princ ", which is ")
-	(describe-function-1 defn)
-        (when (vectorp key)
-          (let* ((last (1- (length key)))
-                 (elt (aref key last))
-                 (elt-1 (if (listp elt) (copy-sequence elt) elt))
-                 key-1 down-event-type)
-            (when (and (listp elt-1)
-                       (symbolp (car elt-1))
-                       (setq down-event-type (help-downify-mouse-event-type
-                                              (car elt-1))))
-              (setcar elt-1 down-event-type)
-              (setq key-1 (vector elt-1))
-              (when (key-binding key-1)
-                (princ (format "
-
-For documentation of the corresponding mouse down event <%s>,
-click and hold the mouse button longer than %s second(s)."
-                               down-event-type (if (numberp double-click-t=
ime)
-                                                   (/ double-click-time 10=
00.0)
-                                                 3)))))))
-	(when up-event
-	  (unless (or (null defn-up)
-		      (integerp defn-up)
-		      (equal defn-up 'undefined))
-	    (princ (format "
-
------------------ up-event %s----------------
-
-%s%s%s runs the command %S%s, which is "
-			   (if mouse-1-tricky "(short click) " "")
-			   (key-description (vector up-event))
-			   mouse-msg
-			   (if mouse-1-remapped
-                               " is remapped to <mouse-2>, which" "")
-			   defn-up (if key-locus-up
-                                       (format " (found in %s)" key-locus-=
up)
-                                     "")))
-	    (describe-function-1 defn-up))
-	  (unless (or (null defn-up-tricky)
-		      (integerp defn-up-tricky)
-		      (eq defn-up-tricky 'undefined))
-	    (princ (format "
-
------------------ up-event (long click) ----------------
-
-Pressing <%S>%s for longer than %d milli-seconds
-runs the command %S%s, which is "
-			   ev-type mouse-msg
-			   mouse-1-click-follows-link
-			   defn-up-tricky (if key-locus-up-tricky
-                                              (format " (found in %s)" key=
-locus-up-tricky)
-                                            "")))
-	    (describe-function-1 defn-up-tricky)))))))
+pass KEY-LIST as a list of elements (SEQ . RAW-SEQ) where SEQ is
+a key-sequence and RAW-SEQ is its untranslated form.
+
+While reading KEY-LIST interactively, this command temporarily enables
+menu items or tool-bar buttons that are disabled to allow getting help
+on them."
+  (interactive (list (help-read-key-sequence)))
+  (let* ((buf (or buffer (current-buffer)))
+         (info-list
+          (with-current-buffer buf
+            (mapcar (lambda (x)
+                      (pcase-let* ((`(,seq . ,raw-seq) x)
+                                   (`(,brief-desc ,defn ,event ,_mouse-msg)
+                                    (help--analyze-key seq raw-seq))
+                                   (locus
+                                    (help--binding-locus
+                                     seq (event-start event))))
+                        `(,seq ,brief-desc ,defn ,locus)))
+                    key-list))))
+    (help-setup-xref (list (lambda (key-list)
+                             (describe-key key-list
+                                           (if (buffer-live-p buf) buf)))
+                           key-list)
+		     (called-interactively-p 'interactive))
+    (with-help-window (help-buffer)
+      (when (> (length info-list) 1)
+        ;; FIXME: Make this into clickable hyperlinks.
+        (princ "There were several key-sequences:\n\n")
+        (princ (mapconcat (lambda (info)
+                             (pcase-let ((`(,_seq ,brief-desc ,_defn ,_loc=
us)
+                                          info))
+                               (concat "  " brief-desc)))
+                           info-list
+                           "\n"))
+        (princ "\n\nThey're all described below."))
+      (pcase-dolist (`(,_seq ,brief-desc ,defn ,locus)
+                     info-list)
+        (when defn
+          (when (> (length info-list) 1)
+            (with-current-buffer standard-output
+              (insert "\n\n"
+                      ;; FIXME: Can't eval-when-compile, because string
+                      ;; constant in purespace can't have properties!
+                      (propertize "\n" 'face '(:height 0.1 :inverse-video =
t))
+                      "\n")))
+
+          (princ brief-desc)
+          (when locus
+            (princ (format " (found in %s)" locus)))
+          (princ ", which is ")
+	  (describe-function-1 defn))))))
 
 (defun describe-mode (&optional buffer)
   "Display documentation of current major mode and minor modes.
@@ -1120,7 +1011,7 @@ lookup-minor-mode-from-indicator
 
 ;;; Automatic resizing of temporary buffers.
 (defcustom temp-buffer-max-height
-  (lambda (buffer)
+  (lambda (_buffer)
     (if (and (display-graphic-p) (eq (selected-window) (frame-root-window)=
))
 	(/ (x-display-pixel-height) (frame-char-height) 2)
       (/ (- (frame-height) 2) 2)))
@@ -1137,7 +1028,7 @@ temp-buffer-max-height
   :version "24.3")
=20
 (defcustom temp-buffer-max-width
-  (lambda (buffer)
+  (lambda (_buffer)
     (if (and (display-graphic-p) (eq (selected-window) (frame-root-window)=
))
 	(/ (x-display-pixel-width) (frame-char-width) 2)
       (/ (- (frame-width) 2) 2)))




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

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


Received: (at 29478) by debbugs.gnu.org; 26 Jan 2018 22:00:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 26 17:00:22 2018
Received: from localhost ([127.0.0.1]:44112 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1efC2n-0006Gy-5l
	for submit <at> debbugs.gnu.org; Fri, 26 Jan 2018 17:00:22 -0500
Received: from chene.dit.umontreal.ca ([132.204.246.20]:59123)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1efC2k-0006Gp-9I
 for 29478 <at> debbugs.gnu.org; Fri, 26 Jan 2018 17:00:19 -0500
Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242])
 by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w0QM0Fn8020420;
 Fri, 26 Jan 2018 17:00:15 -0500
Received: by pastel.home (Postfix, from userid 20848)
 id 7F46D60608; Fri, 26 Jan 2018 17:00:15 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: [Patch] bug#29478: 26.0.90;
 `C-h k' followed by mouse clicks no longer shows down event
Message-ID: <jwvwp04qoxg.fsf-monnier+emacsbugs@HIDDEN>
References: <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
 <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
 <20171222220549.GC8072@ACM> <833741lr0t.fsf@HIDDEN>
 <20171223111726.GA6618@ACM>
 <jwv4lohjv1e.fsf-monnier+emacsbugs@HIDDEN>
 <20171223210407.GC6618@ACM>
 <jwvbmioipxp.fsf-monnier+emacsbugs@HIDDEN> <831sjcfq1v.fsf@HIDDEN>
 <jwva7xv8une.fsf-monnier+emacsbugs@HIDDEN> <83zi5q997a.fsf@HIDDEN>
Date: Fri, 26 Jan 2018 17:00:15 -0500
In-Reply-To: <83zi5q997a.fsf@HIDDEN> (Eli Zaretskii's message of "Sat, 06 Jan
 2018 19:40:57 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-NAI-Spam-Flag: NO
X-NAI-Spam-Threshold: 5
X-NAI-Spam-Score: 0
X-NAI-Spam-Rules: 2 Rules triggered
	EDT_SA_DN_PASS=0, RV6209=0
X-NAI-Spam-Version: 2.3.0.9418 : core <6209> : inlines <6344> : streams
 <1777185> : uri <2580057>
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: 29478
Cc: acm@HIDDEN, 29478 <at> debbugs.gnu.org, npostavs@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: -1.3 (-)

>> If you want a patch that applies, the one below should work.
> Thanks.  It needs some more work.  E.g., "C-h k C-mouse-1" signals an
> error:
>
>   help-fns--analyze-function: Symbol=E2=80=99s function definition is voi=
d: nil

The patch below fixes this...

> and "C-h k C-mouse-3" followed by a menu selection asks for another
> key or mouse click, although it already has got a full key sequence.

...and this.

> In general, I see the idea is to show both down-mouse-N event and
> mouse-N event, both with "C-h c" and "C-h k".  That could be okay, but
> why show undefined sequences?  E.g, "C-h c S-mouse-1" shows this in
> the echo area:
>
>   <S-down-mouse-1> at that spot runs the command mouse-appearance-menu
>   <S-mouse-1> at that spot is undefined
>
> I'd expect the second line not to appear.

About that, I wrote:

    OTOH, for text-terminals, we add a "(translated from <escape-sequence>)"
    and we could do the same here (that's what my patch originally did, by
    the way, and that's what I've been using all these years since I think
    it's very valuable information), which would say:
=20=20=20=20
       <C-H-mouse-1> (translated from <C-H-down-mouse-1> <C-H-mouse-1>)
       at that spot is undefined

but I misremembered, the above also appears in vanilla Emacs.  Regarding
your example:

    <S-down-mouse-1> at that spot runs the command mouse-appearance-menu
    <S-mouse-1> at that spot is undefined

it's hard to do much better: the S-mouse-1 event is eaten by
`mouse-appearance-menu` but it's basically impossible to determine
that automatically.

And if you want to "not show undefined sequences", does that mean we
don't say anything at all for `C-h k M-_` rather than "M-_ is undefined"?
How 'bout `C-h c M-S-double-mouse-1` which with my code says (courtesy
copy-next-command-output (!)):

    <M-S-mouse-1> (translated from <M-S-down-mouse-1> <M-S-mouse-1>) at tha=
t spot is undefined
    <M-S-double-mouse-1> (translated from <M-S-double-down-mouse-1> <M-S-do=
uble-mouse-1>) is undefined

We can probably come up with some heuristic to keep "at least one line
of output" or something, but I think it's more useful for the user to
report all the events and their binding or lack thereof since we don't
really know what the user is looking for.

All in all, the behavior provided in the patch below may not be always
100% ideal for everyone, but the code is simpler, more robust, and gives
more information.

The details of the display can still be improved, but it's already an
improvement over what we have now, so if there's no objection I'll
install it as-is.


        Stefan


diff --git a/lisp/help.el b/lisp/help.el
index 014af5141e..b992e21ad2 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -593,19 +593,26 @@ help-key-description
 	    string
 	  (format "%s (translated from %s)" string otherstring))))))
=20
+(defun help--first-event (keyseq)
+  (when (> (length keyseq) 0)
+    (aref keyseq (if (and (symbolp (aref keyseq 0))
+		          (> (length keyseq) 1)
+		          (consp (aref keyseq 1)))
+                     ;; Look at the second event when the first
+                     ;; is a pseudo-event like `mode-line' of `left-fringe=
'.
+		     1
+	           0))))
+
 (defun help--analyze-key (key untranslated)
   "Get information about KEY its corresponding UNTRANSLATED events.
 Returns a list of the form (BRIEF-DESC DEFN EVENT MOUSE-MSG)."
   (if (numberp untranslated)
-      (setq untranslated (this-single-command-raw-keys)))
-  (let* ((event (aref key (if (and (symbolp (aref key 0))
-				   (> (length key) 1)
-				   (consp (aref key 1)))
-			      1
-			    0)))
+      (error "Missing `untranslated'!"))
+  (let* ((event (help--first-event key))
 	 (modifiers (event-modifiers event))
 	 (mouse-msg (if (or (memq 'click modifiers) (memq 'down modifiers)
-			    (memq 'drag modifiers)) " at that spot" ""))
+			    (memq 'drag modifiers))
+                        " at that spot" ""))
 	 (defn (key-binding key t)))
     ;; Handle the case where we faked an entry in "Select and Paste" menu.
     (when (and (eq defn nil)
@@ -626,22 +633,26 @@ help--analyze-key
          (format "%s%s runs the command %S" key-desc mouse-msg defn)))
      defn event mouse-msg)))
=20
-(defun describe-key-briefly (&optional key insert untranslated)
-  "Print the name of the function KEY invokes.  KEY is a string.
+(defun describe-key-briefly (key-list &optional insert)
+  "Print the name of the functions KEY-LIST invokes.
+KEY-LIST is a list of pairs (SEQ . RAW-SEQ) of key sequences, where
+RAW-SEQ is the untranslated form of the key sequence SEQ.
 If INSERT (the prefix arg) is non-nil, insert the message in the buffer.
-If non-nil, UNTRANSLATED is a vector of the untranslated events.
-It can also be a number in which case the untranslated events from
-the last key hit are used.
=20
-If KEY is a menu item or a tool-bar button that is disabled, this command
-temporarily enables it to allow getting help on disabled items and buttons=
."
+While reading KEY-LIST interactively, this command temporarily enables
+menu items or tool-bar buttons that are disabled to allow getting help
+on them."
   (interactive
    ;; Ignore mouse movement events because it's too easy to miss the
    ;; message while moving the mouse.
-   (pcase-let ((`(,key ,_up-event) (help-read-key-sequence 'no-mouse-movem=
ent)))
-     `(,key ,current-prefix-arg 1)))
-  (princ (car (help--analyze-key key untranslated))
-         (if insert (current-buffer) standard-output)))
+   (let ((key-list (help-read-key-sequence 'no-mouse-movement)))
+     `(,key-list ,current-prefix-arg)))
+  (let ((msg (mapconcat (lambda (x)
+                          (pcase-let ((`(,seq . ,raw-seq) x))
+                            (car (help--analyze-key seq raw-seq))))
+                        key-list
+                        "\n")))
+    (if insert (insert msg) (message "%s" msg))))
=20
 (defun help--key-binding-keymap (key &optional accept-default no-remap pos=
ition)
   "Return a keymap holding a binding for KEY within current keymaps.
@@ -688,8 +699,7 @@ help--binding-locus
                                               (format "%s-map" mode)))))
                                        minor-mode-map-alist))
                                 (list 'global-map
-                                      (intern-soft (format "%s-map" major-=
mode)))))
-              found)
+                                      (intern-soft (format "%s-map" major-=
mode))))))
           ;; Look into these advertised symbols first.
           (dolist (sym advertised-syms)
             (when (and
@@ -707,224 +717,98 @@ help--binding-locus
           nil)))))
=20
 (defun help-read-key-sequence (&optional no-mouse-movement)
-  "Reads a key sequence from the user.
-Returns a list of the form (KEY UP-EVENT), where KEY is the key
-sequence, and UP-EVENT is the up-event that was discarded by
-reading KEY, or nil.
+  "Read \"a\" key sequence from the user.
+Return a list of elements of the form (SEQ . RAW-SEQ), where SEQ is a key
+sequence, and RAW-SEQ is its untranslated form.
 If NO-MOUSE-MOVEMENT is non-nil, ignore key sequences starting
 with `mouse-movement' events."
   (let ((enable-disabled-menus-and-buttons t)
         (cursor-in-echo-area t)
         saved-yank-menu)
     (unwind-protect
-        (let (key keys down-ev discarded-up)
+        (let (last-modifiers key-list)
           ;; If yank-menu is empty, populate it temporarily, so that
           ;; "Select and Paste" menu can generate a complete event.
           (when (null (cdr yank-menu))
             (setq saved-yank-menu (copy-sequence yank-menu))
             (menu-bar-update-yank-menu "(any string)" nil))
           (while
-              (pcase (setq key (read-key-sequence "\
+              ;; Read at least one key-sequence.
+              (or (null key-list)
+                  ;; After a down event, also read the (presumably) follow=
ing
+                  ;; up-event.
+                  (memq 'down last-modifiers)
+                  ;; After a click, see if a double click is on the way.
+                  (and (memq 'click last-modifiers)
+                       (not (sit-for (/ double-click-time 1000.0) t))))
+            (let* ((seq (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 key=
0)))
-                 (or
-                  (and no-mouse-movement
-                       (string-match "mouse-movement" keyname))
-                  (progn (push key keys) nil)
-                  (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.01)
-                         (while (read-event nil nil 0.01))
-                         (not (sit-for
-                               (if (numberp double-click-time)
-                                   (/ double-click-time 1000.0)
-                                 3.0)
-                               t))))))))
-          ;; When we have a sequence of mouse events, discard the most
-          ;; recent ones till we find one with a binding.
-          (let ((keys-1 keys))
-            (while (and keys-1
-                        (not (key-binding (car keys-1))))
-              ;; If we discard the last event, and this was a mouse
-              ;; up, remember this.
-              (if (and (eq keys-1 keys)
-                       (vectorp (car keys-1))
-                       (let* ((last-idx (1- (length (car keys-1))))
-                              (last (aref (car keys-1) last-idx)))
-                         (and (eventp last)
-                              (memq 'click (event-modifiers last)))))
-                  (setq discarded-up t))
-              (setq keys-1 (cdr keys-1)))
-            (if keys-1
-                (setq key (car keys-1))))
-          (list
-           key
-           ;; If KEY is a down-event, read and include the
-           ;; corresponding up-event.  Note that there are also
-           ;; down-events on scroll bars and mode lines: the actual
-           ;; event then is in the second element of the vector.
-           (and (not discarded-up) ; Don't attempt to ignore the up-event =
twice.
-                (vectorp key)
-                (let ((last-idx (1- (length key))))
-                  (and (eventp (aref key last-idx))
-                       (memq 'down (event-modifiers (aref key last-idx)))))
-                (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.
-                         (=3D (length key) 1))
-                    (and (> (length key) 1)
-                         (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)))))
+                   (raw-seq (this-single-command-raw-keys))
+                   (key0 (when (> (length seq) 0)
+                           (aref seq 0)))
+                   (base (event-basic-type key0))
+                   (modifiers (event-modifiers key0)))
+              (cond
+               ((and no-mouse-movement (eq base 'mouse-movement)) nil)
+               ((eq base 'help-echo) nil)
+               (t
+                (setq last-modifiers modifiers)
+                (push (cons seq raw-seq) key-list)))))
+          (nreverse key-list))
       ;; Put yank-menu back as it was, if we changed it.
       (when saved-yank-menu
         (setq yank-menu (copy-sequence saved-yank-menu))
         (fset 'yank-menu (cons 'keymap yank-menu))))))
=20
-(defun help-downify-mouse-event-type (base)
-  "Add \"down-\" to BASE if it is not already there.
-BASE is a symbol, a mouse event type.  If the modification is done,
-return the new symbol.  Otherwise return nil."
-  (let ((base-s (symbol-name base)))
-    ;; Note: the order of the components in the following string is
-    ;; determined by `apply_modifiers_uncached' in src/keyboard.c.
-    (string-match "\\(A-\\)?\
-\\(C-\\)?\
-\\(H-\\)?\
-\\(M-\\)?\
-\\(S-\\)?\
-\\(s-\\)?\
-\\(double-\\)?\
-\\(triple-\\)?\
-\\(up-\\)?\
-\\(\\(down-\\)?\\)\
-\\(drag-\\)?" base-s)
-    (when (and (null (match-beginning 11)) ; "down-"
-               (null (match-beginning 12))) ; "drag-"
-      (intern (replace-match "down-" t t base-s 10)) )))
-
-(defun describe-key (&optional key untranslated up-event)
-  "Display documentation of the function invoked by KEY.
-KEY can be any kind of a key sequence; it can include keyboard events,
+(defun describe-key (key-list)
+  "Display documentation of the function invoked by KEY-LIST.
+KEY-LIST can be any kind of a key sequence; it can include keyboard events,
 mouse events, and/or menu events.  When calling from a program,
-pass KEY as a string or a vector.
-
-If non-nil, UNTRANSLATED is a vector of the corresponding untranslated eve=
nts.
-It can also be a number, in which case the untranslated events from
-the last key sequence entered are used.
-UP-EVENT is the up-event that was discarded by reading KEY, or nil.
+pass KEY-LIST as a list of elements (SEQ . RAW-SEQ) where SEQ is
+a key-sequence and RAW-SEQ is its untranslated form.
+
+While reading KEY-LIST interactively, this command temporarily enables
+menu items or tool-bar buttons that are disabled to allow getting help
+on them."
+  (interactive (list (help-read-key-sequence)))
+  (let ((buf (current-buffer))
+        (info-list
+         (mapcar (lambda (x)
+                   (pcase-let* ((`(,seq . ,raw-seq) x)
+                                (`(,brief-desc ,defn ,event ,_mouse-msg)
+                                 (help--analyze-key seq raw-seq))
+                                (locus
+                                 (help--binding-locus seq (event-start eve=
nt))))
+                     `(,seq ,brief-desc ,defn ,locus)))
+                 key-list)))
+    (help-setup-xref (list (lambda (key-list)
+                             (with-current-buffer (if (buffer-live-p buf)
+                                                      buf (current-buffer))
+                               (describe-key key-list)))
+                           key-list)
+		     (called-interactively-p 'interactive))
+    (with-help-window (help-buffer)
+      (when (> (length info-list) 1)
+        ;; FIXME: Make this into clickable hyperlinks.
+        (princ "There were several key-sequences:\n\n")
+        (princ (mapconcat (lambda (info)
+                             (pcase-let ((`(,_seq ,brief-desc ,_defn ,_loc=
us)
+                                          info))
+                               (concat "  " brief-desc)))
+                           info-list
+                           "\n"))
+        (princ "\n\nThey're all described below."))
+      (pcase-dolist (`(,seq ,brief-desc ,defn ,locus)
+                     info-list)
+        (when (> (length info-list) 1)
+          (princ (format "\n\n----------------- event `%s' ---------------=
-\n\n"
+                          (key-description seq))))
=20
-If KEY is a menu item or a tool-bar button that is disabled, this command
-temporarily enables it to allow getting help on disabled items and buttons=
."
-  (interactive
-   (pcase-let ((`(,key ,up-event) (help-read-key-sequence)))
-     `(,key ,(prefix-numeric-value current-prefix-arg) ,up-event)))
-  (pcase-let ((`(,brief-desc ,defn ,event ,mouse-msg)
-               (help--analyze-key key untranslated))
-              (defn-up nil) (defn-up-tricky nil)
-              (key-locus-up nil) (key-locus-up-tricky nil)
-              (mouse-1-remapped nil) (mouse-1-tricky nil)
-              (ev-type nil))
-    (if (or (null defn)
-            (integerp defn)
-            (equal defn 'undefined))
-        (message "%s" brief-desc)
-      (help-setup-xref (list #'describe-function defn)
-		       (called-interactively-p 'interactive))
-      ;; Need to do this before erasing *Help* buffer in case event
-      ;; is a mouse click in an existing *Help* buffer.
-      (when up-event
-	(setq ev-type (event-basic-type up-event))
-	(let ((sequence (vector up-event)))
-	  (when (and (eq ev-type 'mouse-1)
-		     mouse-1-click-follows-link
-		     (not (eq mouse-1-click-follows-link 'double))
-		     (setq mouse-1-remapped
-			   (mouse-on-link-p (event-start up-event))))
-	    (setq mouse-1-tricky (and (integerp mouse-1-click-follows-link)
-				      (> mouse-1-click-follows-link 0)))
-	    (cond ((stringp mouse-1-remapped)
-		   (setq sequence mouse-1-remapped))
-		  ((vectorp mouse-1-remapped)
-		   (setcar up-event (elt mouse-1-remapped 0)))
-		  (t (setcar up-event 'mouse-2))))
-	  (setq defn-up (key-binding sequence nil nil (event-start up-event)))
-          (setq key-locus-up (help--binding-locus sequence (event-start up=
-event)))
-	  (when mouse-1-tricky
-	    (setq sequence (vector up-event))
-	    (aset sequence 0 'mouse-1)
-	    (setq defn-up-tricky (key-binding sequence nil nil (event-start up-ev=
ent)))
-            (setq key-locus-up-tricky (help--binding-locus sequence (event=
-start up-event))))))
-      (with-help-window (help-buffer)
         (princ brief-desc)
-        (let ((key-locus (help--binding-locus key (event-start event))))
-          (when key-locus
-            (princ (format " (found in %s)" key-locus))))
+        (when locus
+          (princ (format " (found in %s)" locus)))
         (princ ", which is ")
-	(describe-function-1 defn)
-        (when (vectorp key)
-          (let* ((last (1- (length key)))
-                 (elt (aref key last))
-                 (elt-1 (if (listp elt) (copy-sequence elt) elt))
-                 key-1 down-event-type)
-            (when (and (listp elt-1)
-                       (symbolp (car elt-1))
-                       (setq down-event-type (help-downify-mouse-event-type
-                                              (car elt-1))))
-              (setcar elt-1 down-event-type)
-              (setq key-1 (vector elt-1))
-              (when (key-binding key-1)
-                (princ (format "
-
-For documentation of the corresponding mouse down event <%s>,
-click and hold the mouse button longer than %s second(s)."
-                               down-event-type (if (numberp double-click-t=
ime)
-                                                   (/ double-click-time 10=
00.0)
-                                                 3)))))))
-	(when up-event
-	  (unless (or (null defn-up)
-		      (integerp defn-up)
-		      (equal defn-up 'undefined))
-	    (princ (format "
-
------------------ up-event %s----------------
-
-%s%s%s runs the command %S%s, which is "
-			   (if mouse-1-tricky "(short click) " "")
-			   (key-description (vector up-event))
-			   mouse-msg
-			   (if mouse-1-remapped
-                               " is remapped to <mouse-2>, which" "")
-			   defn-up (if key-locus-up
-                                       (format " (found in %s)" key-locus-=
up)
-                                     "")))
-	    (describe-function-1 defn-up))
-	  (unless (or (null defn-up-tricky)
-		      (integerp defn-up-tricky)
-		      (eq defn-up-tricky 'undefined))
-	    (princ (format "
-
------------------ up-event (long click) ----------------
-
-Pressing <%S>%s for longer than %d milli-seconds
-runs the command %S%s, which is "
-			   ev-type mouse-msg
-			   mouse-1-click-follows-link
-			   defn-up-tricky (if key-locus-up-tricky
-                                              (format " (found in %s)" key=
-locus-up-tricky)
-                                            "")))
-	    (describe-function-1 defn-up-tricky)))))))
+	(describe-function-1 defn)))))
 
 (defun describe-mode (&optional buffer)
   "Display documentation of current major mode and minor modes.




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

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


Received: (at 29478) by debbugs.gnu.org; 7 Jan 2018 18:03:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 07 13:03:36 2018
Received: from localhost ([127.0.0.1]:39831 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eYFID-0003Tk-SG
	for submit <at> debbugs.gnu.org; Sun, 07 Jan 2018 13:03:34 -0500
Received: from pmta21.teksavvy.com ([76.10.157.36]:19720)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1eYFIC-0003TX-Io
 for 29478 <at> debbugs.gnu.org; Sun, 07 Jan 2018 13:03:32 -0500
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2EfHACZX1Ja/yyKSC1cHAEBAQQBAQoBA?=
 =?us-ascii?q?YM/gVqOQ45xggKZPwqFOwKEMkMUAQEBAQEBAQEBA2gohSUBBAF5BQsLDScHCxQ?=
 =?us-ascii?q?YMS6KDgi0LCECig4BAQEBAQUBAQEBJIQgghWDP4MuixoFkzmQJYswTItZiXcoD?=
 =?us-ascii?q?4dElxeBPDYjgVAyGggwgiJGglMcGYFsI4pRAQEB?=
X-IPAS-Result: =?us-ascii?q?A2EfHACZX1Ja/yyKSC1cHAEBAQQBAQoBAYM/gVqOQ45xggK?=
 =?us-ascii?q?ZPwqFOwKEMkMUAQEBAQEBAQEBA2gohSUBBAF5BQsLDScHCxQYMS6KDgi0LCECi?=
 =?us-ascii?q?g4BAQEBAQUBAQEBJIQgghWDP4MuixoFkzmQJYswTItZiXcoD4dElxeBPDYjgVA?=
 =?us-ascii?q?yGggwgiJGglMcGYFsI4pRAQEB?=
X-IronPort-AV: E=Sophos;i="5.46,326,1511845200"; d="scan'208";a="17041347"
Received: from unknown (HELO ceviche.home) ([45.72.138.44])
 by smtp.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 07 Jan 2018 13:03:26 -0500
Received: by ceviche.home (Postfix, from userid 20848)
 id D4ADC66326; Sun,  7 Jan 2018 13:03:19 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: [SUSPECTED SPAM] Re: [Patch] bug#29478: 26.0.90;
 `C-h k' followed by mouse clicks no longer shows down event
Message-ID: <jwvefn1zh9g.fsf-monnier+emacsbugs@HIDDEN>
References: <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
 <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
 <20171222220549.GC8072@ACM> <833741lr0t.fsf@HIDDEN>
 <20171223111726.GA6618@ACM>
 <jwv4lohjv1e.fsf-monnier+emacsbugs@HIDDEN>
 <20171223210407.GC6618@ACM>
 <jwvbmioipxp.fsf-monnier+emacsbugs@HIDDEN> <831sjcfq1v.fsf@HIDDEN>
 <jwva7xv8une.fsf-monnier+emacsbugs@HIDDEN> <83zi5q997a.fsf@HIDDEN>
 <jwvpo6lzo78.fsf-monnier+emacsbugs@HIDDEN> <83efn18sv6.fsf@HIDDEN>
Date: Sun, 07 Jan 2018 13:03:19 -0500
In-Reply-To: <83efn18sv6.fsf@HIDDEN> (Eli Zaretskii's message of "Sun, 07 Jan
 2018 19:46:05 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 29478
Cc: acm@HIDDEN, 29478 <at> debbugs.gnu.org, npostavs@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: 0.3 (/)

> We don't show unbound sequences anywhere else, except if they are
> explicitly asked about.  Not sure why this case should be different.

Try C-h c C-H-mouse-1 and it will dutifully report that C-H-mouse-1
is undefined.  IOW, this is really not a new behavior in `C-h c`.

>> I think it's also useful to show to the user than there were two events.
> I don't think I agree.  Moreover, when dragging there are more than 2
> events, but we only show 2.

Indeed, there's a whole bunch of options in terms of how much detail we
may want to show.

>> > Also, if both events are bound, I think we should show the mouse-N
>> > event before the down-mouse-N event, because the former is much more
>> > important and normally is the one that's bound.
>> 
>> If the down event is unbound it's not shown (this is actually not
>> a feature I actively tried to obtained: it's just the result of
>> read-key-sequence dropping the down event if it's not bound).
> That's an inconsistency I don't think I like.

Neither do I.  But it would require a fairly nasty hack to try and make
it behave differently, and given all the key remapping we do, there will
always be such inconsistencies, I think.

OTOH, for text-terminals, we add a "(translated from <escape-sequence>)"
and we could do the same here (that's what my patch originally did, by
the way, and that's what I've been using all these years since I think
it's very valuable information), which would say:

   <C-H-mouse-1> (translated from <C-H-down-mouse-1> <C-H-mouse-1>)
   at that spot is undefined

thus exposing the fact that there was also a <C-H-down-mouse-1> event
that got dropped along the way.

>> And I think it's important to preserve the order of the events.
> The order reversed is still an order ;-)

I guess if we reverse them all (i.e. always show events last-to-first),
I could live with it.

>> As a side-benefit it reduces the amount of ad-hoc code that needs to
>> know about what is a down event or a mouse event and so on.
> Yes, correct solutions frequently need more messy code ;-)

In my experience it too often leads to code which is "more correct" in
90% of the cases but inconsistent in the rest.


        Stefan




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

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


Received: (at 29478) by debbugs.gnu.org; 7 Jan 2018 17:46:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 07 12:46:42 2018
Received: from localhost ([127.0.0.1]:39814 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eYF1u-00035s-JB
	for submit <at> debbugs.gnu.org; Sun, 07 Jan 2018 12:46:42 -0500
Received: from eggs.gnu.org ([208.118.235.92]:40466)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eYF1s-00035g-Pt
 for 29478 <at> debbugs.gnu.org; Sun, 07 Jan 2018 12:46:41 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eYF1j-0004PB-IV
 for 29478 <at> debbugs.gnu.org; Sun, 07 Jan 2018 12:46:35 -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.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44902)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eYF1Y-0004Jc-TB; Sun, 07 Jan 2018 12:46:20 -0500
Received: from [176.228.60.248] (port=1681 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 1eYF1Y-0002L1-AM; Sun, 07 Jan 2018 12:46:20 -0500
Date: Sun, 07 Jan 2018 19:46:05 +0200
Message-Id: <83efn18sv6.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
In-reply-to: <jwvpo6lzo78.fsf-monnier+emacsbugs@HIDDEN> (message from Stefan
 Monnier on Sun, 07 Jan 2018 10:31:38 -0500)
Subject: Re: [SUSPECTED SPAM] Re: [Patch] bug#29478: 26.0.90;
 `C-h k' followed by mouse clicks no longer shows down event
References: <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
 <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
 <20171222220549.GC8072@ACM> <833741lr0t.fsf@HIDDEN>
 <20171223111726.GA6618@ACM>
 <jwv4lohjv1e.fsf-monnier+emacsbugs@HIDDEN>
 <20171223210407.GC6618@ACM>
 <jwvbmioipxp.fsf-monnier+emacsbugs@HIDDEN> <831sjcfq1v.fsf@HIDDEN>
 <jwva7xv8une.fsf-monnier+emacsbugs@HIDDEN> <83zi5q997a.fsf@HIDDEN>
 <jwvpo6lzo78.fsf-monnier+emacsbugs@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: 29478
Cc: acm@HIDDEN, 29478 <at> debbugs.gnu.org, npostavs@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>
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: Stefan Monnier <monnier@HIDDEN>
> Cc: acm@HIDDEN,  29478 <at> debbugs.gnu.org,  npostavs@HIDDEN
> Date: Sun, 07 Jan 2018 10:31:38 -0500
> 
> > In general, I see the idea is to show both down-mouse-N event and
> > mouse-N event, both with "C-h c" and "C-h k".  That could be okay, but
> > why show undefined sequences?  E.g, "C-h c S-mouse-1" shows this in
> > the echo area:
> >
> >   <S-down-mouse-1> at that spot runs the command mouse-appearance-menu
> >   <S-mouse-1> at that spot is undefined
> 
> I did not make a special effort to do that, but I also didn't feel like
> stripping them away because sometimes it's useful to know what is the
> event name.  E.g. you want to bind something to "shifted left mouse
> click" because you noticed it doesn't do anything, so you already know
> it's undefined, but you don't yet know how to spell it.

We don't show unbound sequences anywhere else, except if they are
explicitly asked about.  Not sure why this case should be different.

> I think it's also useful to show to the user than there were two events.

I don't think I agree.  Moreover, when dragging there are more than 2
events, but we only show 2.

> > Also, if both events are bound, I think we should show the mouse-N
> > event before the down-mouse-N event, because the former is much more
> > important and normally is the one that's bound.
> 
> If the down event is unbound it's not shown (this is actually not
> a feature I actively tried to obtained: it's just the result of
> read-key-sequence dropping the down event if it's not bound).

That's an inconsistency I don't think I like.

> And I think it's important to preserve the order of the events.

The order reversed is still an order ;-)

> As a side-benefit it reduces the amount of ad-hoc code that needs to
> know about what is a down event or a mouse event and so on.

Yes, correct solutions frequently need more messy code ;-)




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

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


Received: (at 29478) by debbugs.gnu.org; 7 Jan 2018 15:31:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 07 10:31:48 2018
Received: from localhost ([127.0.0.1]:39748 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eYCvK-0008QW-Gw
	for submit <at> debbugs.gnu.org; Sun, 07 Jan 2018 10:31:48 -0500
Received: from pmta31.teksavvy.com ([76.10.157.38]:36113)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1eYCvJ-0008QK-0F
 for 29478 <at> debbugs.gnu.org; Sun, 07 Jan 2018 10:31:45 -0500
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2GrjQAiPFJa/yyKSC1cHAEBAQQBAQoBA?=
 =?us-ascii?q?YM/gVqEOIURhHqOcYIClz6CAYVFAoQyQxQBAQEBAQEBAQEDaCiFJQEEASNWBQs?=
 =?us-ascii?q?LDQ0CGA4CAhQYMYo8CLA5gSaCJyECig0BAQEBBgIBJYEPhSaGNzaEYT2DF4JlB?=
 =?us-ascii?q?ZIlgRSGNolvizBMi1mJdygPh0SYUzYjgVAyGggwgmiCUxwZgWwjik4BAQE?=
X-IPAS-Result: =?us-ascii?q?A2GrjQAiPFJa/yyKSC1cHAEBAQQBAQoBAYM/gVqEOIURhHq?=
 =?us-ascii?q?OcYIClz6CAYVFAoQyQxQBAQEBAQEBAQEDaCiFJQEEASNWBQsLDQ0CGA4CAhQYM?=
 =?us-ascii?q?Yo8CLA5gSaCJyECig0BAQEBBgIBJYEPhSaGNzaEYT2DF4JlBZIlgRSGNolvizB?=
 =?us-ascii?q?Mi1mJdygPh0SYUzYjgVAyGggwgmiCUxwZgWwjik4BAQE?=
Subject: [SUSPECTED SPAM] Re: [Patch] bug#29478: 26.0.90;
 `C-h k' followed by mouse clicks no longer shows down event
X-IronPort-AV: E=Sophos;i="5.46,326,1511845200"; d="scan'208";a="16978208"
Received: from unknown (HELO pastel.home) ([45.72.138.44])
 by smtp.teksavvy.com with ESMTP; 07 Jan 2018 10:31:39 -0500
Received: by pastel.home (Postfix, from userid 20848)
 id 033506049F; Sun,  7 Jan 2018 10:31:38 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Message-ID: <jwvpo6lzo78.fsf-monnier+emacsbugs@HIDDEN>
References: <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
 <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
 <20171222220549.GC8072@ACM> <833741lr0t.fsf@HIDDEN>
 <20171223111726.GA6618@ACM>
 <jwv4lohjv1e.fsf-monnier+emacsbugs@HIDDEN>
 <20171223210407.GC6618@ACM>
 <jwvbmioipxp.fsf-monnier+emacsbugs@HIDDEN> <831sjcfq1v.fsf@HIDDEN>
 <jwva7xv8une.fsf-monnier+emacsbugs@HIDDEN> <83zi5q997a.fsf@HIDDEN>
Date: Sun, 07 Jan 2018 10:31:38 -0500
In-Reply-To: <83zi5q997a.fsf@HIDDEN> (Eli Zaretskii's message of "Sat, 06 Jan
 2018 19:40:57 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 29478
Cc: acm@HIDDEN, 29478 <at> debbugs.gnu.org, npostavs@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: 0.3 (/)

>> If you want a patch that applies, the one below should work.
> Thanks.  It needs some more work.

No doubt.

> E.g., "C-h k C-mouse-1" signals an error:
>   help-fns--analyze-function: Symbol=E2=80=99s function definition is voi=
d: nil

Thanks.  I'll look into fixing this...

> and "C-h k C-mouse-3" followed by a menu selection asks for another
> key or mouse click, although it already has got a full key sequence.

... and this.

> In general, I see the idea is to show both down-mouse-N event and
> mouse-N event, both with "C-h c" and "C-h k".  That could be okay, but
> why show undefined sequences?  E.g, "C-h c S-mouse-1" shows this in
> the echo area:
>
>   <S-down-mouse-1> at that spot runs the command mouse-appearance-menu
>   <S-mouse-1> at that spot is undefined

I did not make a special effort to do that, but I also didn't feel like
stripping them away because sometimes it's useful to know what is the
event name.  E.g. you want to bind something to "shifted left mouse
click" because you noticed it doesn't do anything, so you already know
it's undefined, but you don't yet know how to spell it.

I think it's also useful to show to the user than there were two events.

> Also, if both events are bound, I think we should show the mouse-N
> event before the down-mouse-N event, because the former is much more
> important and normally is the one that's bound.

If the down event is unbound it's not shown (this is actually not
a feature I actively tried to obtained: it's just the result of
read-key-sequence dropping the down event if it's not bound).

And I think it's important to preserve the order of the events.
As a side-benefit it reduces the amount of ad-hoc code that needs to
know about what is a down event or a mouse event and so on.


        Stefan




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

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


Received: (at 29478) by debbugs.gnu.org; 6 Jan 2018 17:41:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 06 12:41:48 2018
Received: from localhost ([127.0.0.1]:38370 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eXsTc-0002HA-2j
	for submit <at> debbugs.gnu.org; Sat, 06 Jan 2018 12:41:48 -0500
Received: from eggs.gnu.org ([208.118.235.92]:57299)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eXsTa-0002Gx-Mz
 for 29478 <at> debbugs.gnu.org; Sat, 06 Jan 2018 12:41:47 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eXsTR-00030F-3D
 for 29478 <at> debbugs.gnu.org; Sat, 06 Jan 2018 12:41:41 -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,T_RP_MATCHES_RCVD,
 URIBL_BLOCKED autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55239)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eXsTE-0002qX-TM; Sat, 06 Jan 2018 12:41:24 -0500
Received: from [176.228.60.248] (port=2965 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 1eXsTD-0007mY-0H; Sat, 06 Jan 2018 12:41:24 -0500
Date: Sat, 06 Jan 2018 19:40:57 +0200
Message-Id: <83zi5q997a.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
In-reply-to: <jwva7xv8une.fsf-monnier+emacsbugs@HIDDEN> (message from Stefan
 Monnier on Tue, 02 Jan 2018 22:56:55 -0500)
Subject: Re: [Patch] bug#29478: 26.0.90;
 `C-h k' followed by mouse clicks no longer shows down event
References: <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
 <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
 <20171222220549.GC8072@ACM> <833741lr0t.fsf@HIDDEN>
 <20171223111726.GA6618@ACM>
 <jwv4lohjv1e.fsf-monnier+emacsbugs@HIDDEN>
 <20171223210407.GC6618@ACM>
 <jwvbmioipxp.fsf-monnier+emacsbugs@HIDDEN> <831sjcfq1v.fsf@HIDDEN>
 <jwva7xv8une.fsf-monnier+emacsbugs@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
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: 29478
Cc: acm@HIDDEN, 29478 <at> debbugs.gnu.org, npostavs@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>
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: Stefan Monnier <monnier@HIDDEN>
> Cc: acm@HIDDEN,  29478 <at> debbugs.gnu.org,  npostavs@HIDDEN
> Date: Tue, 02 Jan 2018 22:56:55 -0500
> 
> > This patch doesn't apply to the master branch, so I couldn't test it.
> 
> It was meant to be read rather than to be applied.

Sorry, I'm not good at reading such large patches.

> If you want a patch that applies, the one below should work.

Thanks.  It needs some more work.  E.g., "C-h k C-mouse-1" signals an
error:

  help-fns--analyze-function: Symbol’s function definition is void: nil

and "C-h k C-mouse-3" followed by a menu selection asks for another
key or mouse click, although it already has got a full key sequence.

In general, I see the idea is to show both down-mouse-N event and
mouse-N event, both with "C-h c" and "C-h k".  That could be okay, but
why show undefined sequences?  E.g, "C-h c S-mouse-1" shows this in
the echo area:

  <S-down-mouse-1> at that spot runs the command mouse-appearance-menu
  <S-mouse-1> at that spot is undefined

I'd expect the second line not to appear.

Also, if both events are bound, I think we should show the mouse-N
event before the down-mouse-N event, because the former is much more
important and normally is the one that's bound.

Thanks.




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

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


Received: (at 29478) by debbugs.gnu.org; 3 Jan 2018 03:57:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 02 22:57:05 2018
Received: from localhost ([127.0.0.1]:33703 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eWaAr-0007c0-3N
	for submit <at> debbugs.gnu.org; Tue, 02 Jan 2018 22:57:05 -0500
Received: from pmta11.teksavvy.com ([76.10.157.34]:31846)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1eWaAo-0007bV-Fk
 for 29478 <at> debbugs.gnu.org; Tue, 02 Jan 2018 22:57:03 -0500
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2FtEwCZU0xa/2Obs2tdg29GgRSDbYVch?=
 =?us-ascii?q?geOJgGCADMBlwqCAQqFNQQCAoQvRBQBAQEBAQEBAQEDaCiFJQEEAVYjBQsLNBI?=
 =?us-ascii?q?UGA0kijkIsGuDTYo/AQEBAQYBAQEBJIQMiEk2hGGGOQWKUIdQgRSQGot2i1aJc?=
 =?us-ascii?q?jWHQIpUjC+BPDYjgU8yGggwPYIqgwiBbCOGaCuCHwEBAQ?=
X-IPAS-Result: =?us-ascii?q?A2FtEwCZU0xa/2Obs2tdg29GgRSDbYVchgeOJgGCADMBlwq?=
 =?us-ascii?q?CAQqFNQQCAoQvRBQBAQEBAQEBAQEDaCiFJQEEAVYjBQsLNBIUGA0kijkIsGuDT?=
 =?us-ascii?q?Yo/AQEBAQYBAQEBJIQMiEk2hGGGOQWKUIdQgRSQGot2i1aJcjWHQIpUjC+BPDY?=
 =?us-ascii?q?jgU8yGggwPYIqgwiBbCOGaCuCHwEBAQ?=
X-IronPort-AV: E=Sophos;i="5.45,500,1508817600"; d="scan'208";a="17184928"
Received: from 107-179-155-99.cpe.teksavvy.com (HELO ceviche.home)
 ([107.179.155.99])
 by smtp.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 02 Jan 2018 22:56:55 -0500
Received: by ceviche.home (Postfix, from userid 20848)
 id 83D34662E5; Tue,  2 Jan 2018 22:56:55 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: [Patch] bug#29478: 26.0.90;
 `C-h k' followed by mouse clicks no longer shows down event
Message-ID: <jwva7xv8une.fsf-monnier+emacsbugs@HIDDEN>
References: <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
 <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
 <20171222220549.GC8072@ACM> <833741lr0t.fsf@HIDDEN>
 <20171223111726.GA6618@ACM>
 <jwv4lohjv1e.fsf-monnier+emacsbugs@HIDDEN>
 <20171223210407.GC6618@ACM>
 <jwvbmioipxp.fsf-monnier+emacsbugs@HIDDEN> <831sjcfq1v.fsf@HIDDEN>
Date: Tue, 02 Jan 2018 22:56:55 -0500
In-Reply-To: <831sjcfq1v.fsf@HIDDEN> (Eli Zaretskii's message of "Sat, 30 Dec
 2017 12:50:04 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 29478
Cc: acm@HIDDEN, 29478 <at> debbugs.gnu.org, npostavs@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: 0.3 (/)

> This patch doesn't apply to the master branch, so I couldn't test it.

It was meant to be read rather than to be applied.
If you want a patch that applies, the one below should work.


        Stefan


diff --git a/lisp/help.el b/lisp/help.el
index 014af5141e..1d985cb4a6 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -593,19 +593,26 @@ help-key-description
 	    string
 	  (format "%s (translated from %s)" string otherstring))))))
 
+(defun help--first-event (keyseq)
+  (when (> (length keyseq) 0)
+    (aref keyseq (if (and (symbolp (aref keyseq 0))
+		          (> (length keyseq) 1)
+		          (consp (aref keyseq 1)))
+                     ;; Look at the second event when the first
+                     ;; is a pseudo-event like `mode-line' of `left-fringe'.
+		     1
+	           0))))
+
 (defun help--analyze-key (key untranslated)
   "Get information about KEY its corresponding UNTRANSLATED events.
 Returns a list of the form (BRIEF-DESC DEFN EVENT MOUSE-MSG)."
   (if (numberp untranslated)
-      (setq untranslated (this-single-command-raw-keys)))
-  (let* ((event (aref key (if (and (symbolp (aref key 0))
-				   (> (length key) 1)
-				   (consp (aref key 1)))
-			      1
-			    0)))
+      (error "Missing `untranslated'!"))
+  (let* ((event (help--first-event key))
 	 (modifiers (event-modifiers event))
 	 (mouse-msg (if (or (memq 'click modifiers) (memq 'down modifiers)
-			    (memq 'drag modifiers)) " at that spot" ""))
+			    (memq 'drag modifiers))
+                        " at that spot" ""))
 	 (defn (key-binding key t)))
     ;; Handle the case where we faked an entry in "Select and Paste" menu.
     (when (and (eq defn nil)
@@ -626,22 +633,26 @@ help--analyze-key
          (format "%s%s runs the command %S" key-desc mouse-msg defn)))
      defn event mouse-msg)))
 
-(defun describe-key-briefly (&optional key insert untranslated)
-  "Print the name of the function KEY invokes.  KEY is a string.
+(defun describe-key-briefly (key-list &optional insert)
+  "Print the name of the functions KEY-LIST invokes.
+KEY-LIST is a list of pairs (SEQ . RAW-SEQ) of key sequences, where
+RAW-SEQ is the untranslated form of the key sequence SEQ.
 If INSERT (the prefix arg) is non-nil, insert the message in the buffer.
-If non-nil, UNTRANSLATED is a vector of the untranslated events.
-It can also be a number in which case the untranslated events from
-the last key hit are used.
 
-If KEY is a menu item or a tool-bar button that is disabled, this command
-temporarily enables it to allow getting help on disabled items and buttons."
+While reading KEY-LIST interactively, this command temporarily enables
+menu items or tool-bar buttons that are disabled to allow getting help
+on them."
   (interactive
    ;; Ignore mouse movement events because it's too easy to miss the
    ;; message while moving the mouse.
-   (pcase-let ((`(,key ,_up-event) (help-read-key-sequence 'no-mouse-movement)))
-     `(,key ,current-prefix-arg 1)))
-  (princ (car (help--analyze-key key untranslated))
-         (if insert (current-buffer) standard-output)))
+   (let ((key-list (help-read-key-sequence 'no-mouse-movement)))
+     `(,key-list ,current-prefix-arg)))
+  (let ((msg (mapconcat (lambda (x)
+                          (pcase-let ((`(,seq . ,raw-seq) x))
+                            (car (help--analyze-key seq raw-seq))))
+                        key-list
+                        "\n")))
+    (if insert (insert msg) (message "%s" msg))))
 
 (defun help--key-binding-keymap (key &optional accept-default no-remap position)
   "Return a keymap holding a binding for KEY within current keymaps.
@@ -688,8 +699,7 @@ help--binding-locus
                                               (format "%s-map" mode)))))
                                        minor-mode-map-alist))
                                 (list 'global-map
-                                      (intern-soft (format "%s-map" major-mode)))))
-              found)
+                                      (intern-soft (format "%s-map" major-mode))))))
           ;; Look into these advertised symbols first.
           (dolist (sym advertised-syms)
             (when (and
@@ -707,224 +717,98 @@ help--binding-locus
           nil)))))
 
 (defun help-read-key-sequence (&optional no-mouse-movement)
-  "Reads a key sequence from the user.
-Returns a list of the form (KEY UP-EVENT), where KEY is the key
-sequence, and UP-EVENT is the up-event that was discarded by
-reading KEY, or nil.
+  "Read \"a\" key sequence from the user.
+Return a list of elements of the form (SEQ . RAW-SEQ), where SEQ is a key
+sequence, and RAW-SEQ is its untranslated form.
 If NO-MOUSE-MOVEMENT is non-nil, ignore key sequences starting
 with `mouse-movement' events."
   (let ((enable-disabled-menus-and-buttons t)
         (cursor-in-echo-area t)
         saved-yank-menu)
     (unwind-protect
-        (let (key keys down-ev discarded-up)
+        (let (last-modifiers key-list)
           ;; If yank-menu is empty, populate it temporarily, so that
           ;; "Select and Paste" menu can generate a complete event.
           (when (null (cdr yank-menu))
             (setq saved-yank-menu (copy-sequence yank-menu))
             (menu-bar-update-yank-menu "(any string)" nil))
           (while
-              (pcase (setq key (read-key-sequence "\
+              ;; Read at least one key-sequence.
+              (or (null key-list)
+                  ;; After a down event, also read the (presumably) following
+                  ;; up-event.
+                  (memq 'down last-modifiers)
+                  ;; After a click, see if a double click is on the way.
+                  (and (memq 'click last-modifiers)
+                       (not (sit-for (/ double-click-time 1000.0) t))))
+            (let* ((seq (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)))
-                 (or
-                  (and no-mouse-movement
-                       (string-match "mouse-movement" keyname))
-                  (progn (push key keys) nil)
-                  (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.01)
-                         (while (read-event nil nil 0.01))
-                         (not (sit-for
-                               (if (numberp double-click-time)
-                                   (/ double-click-time 1000.0)
-                                 3.0)
-                               t))))))))
-          ;; When we have a sequence of mouse events, discard the most
-          ;; recent ones till we find one with a binding.
-          (let ((keys-1 keys))
-            (while (and keys-1
-                        (not (key-binding (car keys-1))))
-              ;; If we discard the last event, and this was a mouse
-              ;; up, remember this.
-              (if (and (eq keys-1 keys)
-                       (vectorp (car keys-1))
-                       (let* ((last-idx (1- (length (car keys-1))))
-                              (last (aref (car keys-1) last-idx)))
-                         (and (eventp last)
-                              (memq 'click (event-modifiers last)))))
-                  (setq discarded-up t))
-              (setq keys-1 (cdr keys-1)))
-            (if keys-1
-                (setq key (car keys-1))))
-          (list
-           key
-           ;; If KEY is a down-event, read and include the
-           ;; corresponding up-event.  Note that there are also
-           ;; down-events on scroll bars and mode lines: the actual
-           ;; event then is in the second element of the vector.
-           (and (not discarded-up) ; Don't attempt to ignore the up-event twice.
-                (vectorp key)
-                (let ((last-idx (1- (length key))))
-                  (and (eventp (aref key last-idx))
-                       (memq 'down (event-modifiers (aref key last-idx)))))
-                (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 (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)))))
+                   (raw-seq (this-single-command-raw-keys))
+                   (key0 (when (> (length seq) 0)
+                           (aref seq 0)))
+                   (base (event-basic-type key0))
+                   (modifiers (event-modifiers key0)))
+              (cond
+               ((and no-mouse-movement (eq base 'mouse-movement)) nil)
+               ((eq base 'help-echo) nil)
+               (t
+                (setq last-modifiers modifiers)
+                (push (cons seq raw-seq) key-list)))))
+          (nreverse key-list))
       ;; Put yank-menu back as it was, if we changed it.
       (when saved-yank-menu
         (setq yank-menu (copy-sequence saved-yank-menu))
         (fset 'yank-menu (cons 'keymap yank-menu))))))
 
-(defun help-downify-mouse-event-type (base)
-  "Add \"down-\" to BASE if it is not already there.
-BASE is a symbol, a mouse event type.  If the modification is done,
-return the new symbol.  Otherwise return nil."
-  (let ((base-s (symbol-name base)))
-    ;; Note: the order of the components in the following string is
-    ;; determined by `apply_modifiers_uncached' in src/keyboard.c.
-    (string-match "\\(A-\\)?\
-\\(C-\\)?\
-\\(H-\\)?\
-\\(M-\\)?\
-\\(S-\\)?\
-\\(s-\\)?\
-\\(double-\\)?\
-\\(triple-\\)?\
-\\(up-\\)?\
-\\(\\(down-\\)?\\)\
-\\(drag-\\)?" base-s)
-    (when (and (null (match-beginning 11)) ; "down-"
-               (null (match-beginning 12))) ; "drag-"
-      (intern (replace-match "down-" t t base-s 10)) )))
-
-(defun describe-key (&optional key untranslated up-event)
-  "Display documentation of the function invoked by KEY.
-KEY can be any kind of a key sequence; it can include keyboard events,
+(defun describe-key (key-list)
+  "Display documentation of the function invoked by KEY-LIST.
+KEY-LIST can be any kind of a key sequence; it can include keyboard events,
 mouse events, and/or menu events.  When calling from a program,
-pass KEY as a string or a vector.
-
-If non-nil, UNTRANSLATED is a vector of the corresponding untranslated events.
-It can also be a number, in which case the untranslated events from
-the last key sequence entered are used.
-UP-EVENT is the up-event that was discarded by reading KEY, or nil.
+pass KEY-LIST as a list of elements (SEQ . RAW-SEQ) where SEQ is
+a key-sequence and RAW-SEQ is its untranslated form.
+
+While reading KEY-LIST interactively, this command temporarily enables
+menu items or tool-bar buttons that are disabled to allow getting help
+on them."
+  (interactive (list (help-read-key-sequence)))
+  (let ((buf (current-buffer))
+        (info-list
+         (mapcar (lambda (x)
+                   (pcase-let* ((`(,seq . ,raw-seq) x)
+                                (`(,brief-desc ,defn ,event ,_mouse-msg)
+                                 (help--analyze-key seq raw-seq))
+                                (locus
+                                 (help--binding-locus seq (event-start event))))
+                     `(,seq ,brief-desc ,defn ,locus)))
+                 key-list)))
+    (help-setup-xref (list (lambda (key-list)
+                             (with-current-buffer (if (buffer-live-p buf)
+                                                      buf (current-buffer))
+                               (describe-key key-list)))
+                           key-list)
+		     (called-interactively-p 'interactive))
+    (with-help-window (help-buffer)
+      (when (> (length info-list) 1)
+        ;; FIXME: Make this into clickable hyperlinks.
+        (princ "There were several key-sequences:\n\n")
+        (princ (mapconcat (lambda (info)
+                             (pcase-let ((`(,_seq ,brief-desc ,_defn ,_locus)
+                                          info))
+                               (concat "  " brief-desc)))
+                           info-list
+                           "\n"))
+        (princ "\n\nThey're all described below."))
+      (pcase-dolist (`(,seq ,brief-desc ,defn ,locus)
+                     info-list)
+        (when (> (length info-list) 1)
+          (princ (format "\n\n----------------- event `%s' ----------------\n\n"
+                          (key-description seq))))
 
-If KEY is a menu item or a tool-bar button that is disabled, this command
-temporarily enables it to allow getting help on disabled items and buttons."
-  (interactive
-   (pcase-let ((`(,key ,up-event) (help-read-key-sequence)))
-     `(,key ,(prefix-numeric-value current-prefix-arg) ,up-event)))
-  (pcase-let ((`(,brief-desc ,defn ,event ,mouse-msg)
-               (help--analyze-key key untranslated))
-              (defn-up nil) (defn-up-tricky nil)
-              (key-locus-up nil) (key-locus-up-tricky nil)
-              (mouse-1-remapped nil) (mouse-1-tricky nil)
-              (ev-type nil))
-    (if (or (null defn)
-            (integerp defn)
-            (equal defn 'undefined))
-        (message "%s" brief-desc)
-      (help-setup-xref (list #'describe-function defn)
-		       (called-interactively-p 'interactive))
-      ;; Need to do this before erasing *Help* buffer in case event
-      ;; is a mouse click in an existing *Help* buffer.
-      (when up-event
-	(setq ev-type (event-basic-type up-event))
-	(let ((sequence (vector up-event)))
-	  (when (and (eq ev-type 'mouse-1)
-		     mouse-1-click-follows-link
-		     (not (eq mouse-1-click-follows-link 'double))
-		     (setq mouse-1-remapped
-			   (mouse-on-link-p (event-start up-event))))
-	    (setq mouse-1-tricky (and (integerp mouse-1-click-follows-link)
-				      (> mouse-1-click-follows-link 0)))
-	    (cond ((stringp mouse-1-remapped)
-		   (setq sequence mouse-1-remapped))
-		  ((vectorp mouse-1-remapped)
-		   (setcar up-event (elt mouse-1-remapped 0)))
-		  (t (setcar up-event 'mouse-2))))
-	  (setq defn-up (key-binding sequence nil nil (event-start up-event)))
-          (setq key-locus-up (help--binding-locus sequence (event-start up-event)))
-	  (when mouse-1-tricky
-	    (setq sequence (vector up-event))
-	    (aset sequence 0 'mouse-1)
-	    (setq defn-up-tricky (key-binding sequence nil nil (event-start up-event)))
-            (setq key-locus-up-tricky (help--binding-locus sequence (event-start up-event))))))
-      (with-help-window (help-buffer)
         (princ brief-desc)
-        (let ((key-locus (help--binding-locus key (event-start event))))
-          (when key-locus
-            (princ (format " (found in %s)" key-locus))))
+        (when locus
+          (princ (format " (found in %s)" locus)))
         (princ ", which is ")
-	(describe-function-1 defn)
-        (when (vectorp key)
-          (let* ((last (1- (length key)))
-                 (elt (aref key last))
-                 (elt-1 (if (listp elt) (copy-sequence elt) elt))
-                 key-1 down-event-type)
-            (when (and (listp elt-1)
-                       (symbolp (car elt-1))
-                       (setq down-event-type (help-downify-mouse-event-type
-                                              (car elt-1))))
-              (setcar elt-1 down-event-type)
-              (setq key-1 (vector elt-1))
-              (when (key-binding key-1)
-                (princ (format "
-
-For documentation of the corresponding mouse down event <%s>,
-click and hold the mouse button longer than %s second(s)."
-                               down-event-type (if (numberp double-click-time)
-                                                   (/ double-click-time 1000.0)
-                                                 3)))))))
-	(when up-event
-	  (unless (or (null defn-up)
-		      (integerp defn-up)
-		      (equal defn-up 'undefined))
-	    (princ (format "
-
------------------ up-event %s----------------
-
-%s%s%s runs the command %S%s, which is "
-			   (if mouse-1-tricky "(short click) " "")
-			   (key-description (vector up-event))
-			   mouse-msg
-			   (if mouse-1-remapped
-                               " is remapped to <mouse-2>, which" "")
-			   defn-up (if key-locus-up
-                                       (format " (found in %s)" key-locus-up)
-                                     "")))
-	    (describe-function-1 defn-up))
-	  (unless (or (null defn-up-tricky)
-		      (integerp defn-up-tricky)
-		      (eq defn-up-tricky 'undefined))
-	    (princ (format "
-
------------------ up-event (long click) ----------------
-
-Pressing <%S>%s for longer than %d milli-seconds
-runs the command %S%s, which is "
-			   ev-type mouse-msg
-			   mouse-1-click-follows-link
-			   defn-up-tricky (if key-locus-up-tricky
-                                              (format " (found in %s)" key-locus-up-tricky)
-                                            "")))
-	    (describe-function-1 defn-up-tricky)))))))
+	(describe-function-1 defn)))))
 
 (defun describe-mode (&optional buffer)
   "Display documentation of current major mode and minor modes.




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

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


Received: (at 29478) by debbugs.gnu.org; 30 Dec 2017 12:49:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 30 07:49:58 2017
Received: from localhost ([127.0.0.1]:57265 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eVGaM-0002Tr-KH
	for submit <at> debbugs.gnu.org; Sat, 30 Dec 2017 07:49:58 -0500
Received: from eggs.gnu.org ([208.118.235.92]:41943)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eVGaH-0002TZ-Sm
 for 29478 <at> debbugs.gnu.org; Sat, 30 Dec 2017 07:49:54 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eVGa9-0007VC-JJ
 for 29478 <at> debbugs.gnu.org; Sat, 30 Dec 2017 07:49:48 -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.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40771)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eVGZz-0007J8-Eg; Sat, 30 Dec 2017 07:49:35 -0500
Received: from [176.228.60.248] (port=1057 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 1eVGZy-0000by-Si; Sat, 30 Dec 2017 07:49:35 -0500
Date: Sat, 30 Dec 2017 14:49:21 +0200
Message-Id: <83vagoe5ym.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
In-reply-to: <20171230113229.GC10623@ACM> (message from Alan Mackenzie on Sat, 
 30 Dec 2017 11:32:29 +0000)
Subject: Re: [Patch] bug#29478: 26.0.90;`C-h k' followed by mouse clicks no
 longer shows down event
References: <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
 <20171222220549.GC8072@ACM> <833741lr0t.fsf@HIDDEN>
 <20171223111726.GA6618@ACM>
 <jwv4lohjv1e.fsf-monnier+emacsbugs@HIDDEN>
 <20171223210407.GC6618@ACM> <83zi60ebfg.fsf@HIDDEN>
 <20171230113229.GC10623@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: -5.0 (-----)
X-Debbugs-Envelope-To: 29478
Cc: 29478 <at> debbugs.gnu.org, monnier@HIDDEN,
 npostavs@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>
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 (-----)

> Date: Sat, 30 Dec 2017 11:32:29 +0000
> Cc: monnier@HIDDEN, 29478 <at> debbugs.gnu.org,
>   npostavs@HIDDEN
> From: Alan Mackenzie <acm@HIDDEN>
> 
> > Alan, any news on this one [the amendments to C-h k/c]?  I'm waiting
> > for this to go in before asking Nicolas to produce the next pretest of
> > Emacs 26.1.
> 
> Apologies.  I committed the two changes to C-h k/c last Saturday and
> Sunday.  I should have said so to you directly.  Still, the delay has
> allowed Zhang to find a bug in the new C-h k (fixed yesterday), that C-h
> k <C-up> threw an error.
> 
> So, as far as C-h k and C-h c are concerned, I believe the emacs-26 is
> ready for the pretest.

Great, thanks.




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

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


Received: (at 29478) by debbugs.gnu.org; 30 Dec 2017 11:35:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 30 06:35:57 2017
Received: from localhost ([127.0.0.1]:57246 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eVFQi-00072X-UQ
	for submit <at> debbugs.gnu.org; Sat, 30 Dec 2017 06:35:57 -0500
Received: from colin.muc.de ([193.149.48.1]:12983 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1eVFQg-00072N-PE
 for 29478 <at> debbugs.gnu.org; Sat, 30 Dec 2017 06:35:55 -0500
Received: (qmail 1748 invoked by uid 3782); 30 Dec 2017 11:35:53 -0000
Received: from acm.muc.de (p548C69B7.dip0.t-ipconnect.de [84.140.105.183]) by
 colin.muc.de (tmda-ofmipd) with ESMTP;
 Sat, 30 Dec 2017 12:35:47 +0100
Received: (qmail 11416 invoked by uid 1000); 30 Dec 2017 11:32:29 -0000
Date: Sat, 30 Dec 2017 11:32:29 +0000
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: [Patch] bug#29478: 26.0.90;`C-h k' followed by mouse clicks no
 longer shows down event
Message-ID: <20171230113229.GC10623@ACM>
References: <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
 <20171222220549.GC8072@ACM> <833741lr0t.fsf@HIDDEN>
 <20171223111726.GA6618@ACM>
 <jwv4lohjv1e.fsf-monnier+emacsbugs@HIDDEN>
 <20171223210407.GC6618@ACM> <83zi60ebfg.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <83zi60ebfg.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: -0.0 (/)
X-Debbugs-Envelope-To: 29478
Cc: 29478 <at> debbugs.gnu.org, monnier@HIDDEN,
 npostavs@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: -0.0 (/)

Hello, Eli.

On Sat, Dec 30, 2017 at 12:51:15 +0200, Eli Zaretskii wrote:
> > Date: Sat, 23 Dec 2017 21:04:07 +0000
> > Cc: Eli Zaretskii <eliz@HIDDEN>, 29478 <at> debbugs.gnu.org,
> >   npostavs@HIDDEN
> > From: Alan Mackenzie <acm@HIDDEN>

[ .... ]

> Alan, any news on this one [the amendments to C-h k/c]?  I'm waiting
> for this to go in before asking Nicolas to produce the next pretest of
> Emacs 26.1.

Apologies.  I committed the two changes to C-h k/c last Saturday and
Sunday.  I should have said so to you directly.  Still, the delay has
allowed Zhang to find a bug in the new C-h k (fixed yesterday), that C-h
k <C-up> threw an error.

So, as far as C-h k and C-h c are concerned, I believe the emacs-26 is
ready for the pretest.

> Thanks.

-- 
Alan Mackenzie (Nuremberg, Germany).




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

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


Received: (at 29478) by debbugs.gnu.org; 30 Dec 2017 10:51:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 30 05:51:44 2017
Received: from localhost ([127.0.0.1]:57227 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eVEjw-0005hJ-EE
	for submit <at> debbugs.gnu.org; Sat, 30 Dec 2017 05:51:44 -0500
Received: from eggs.gnu.org ([208.118.235.92]:55376)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eVEju-0005h4-MU
 for 29478 <at> debbugs.gnu.org; Sat, 30 Dec 2017 05:51:42 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eVEjo-00027T-ID
 for 29478 <at> debbugs.gnu.org; Sat, 30 Dec 2017 05:51:37 -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.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40037)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eVEjg-0001zT-Pn; Sat, 30 Dec 2017 05:51:28 -0500
Received: from [176.228.60.248] (port=4703 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 1eVEjg-0007QY-77; Sat, 30 Dec 2017 05:51:28 -0500
Date: Sat, 30 Dec 2017 12:51:15 +0200
Message-Id: <83zi60ebfg.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
In-reply-to: <20171223210407.GC6618@ACM> (message from Alan Mackenzie on Sat, 
 23 Dec 2017 21:04:07 +0000)
Subject: Re: [Patch] bug#29478: 26.0.90;`C-h k' followed by mouse clicks no
 longer shows down event
References: <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
 <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
 <20171222220549.GC8072@ACM> <833741lr0t.fsf@HIDDEN>
 <20171223111726.GA6618@ACM>
 <jwv4lohjv1e.fsf-monnier+emacsbugs@HIDDEN> <20171223210407.GC6618@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: -5.0 (-----)
X-Debbugs-Envelope-To: 29478
Cc: 29478 <at> debbugs.gnu.org, monnier@HIDDEN,
 npostavs@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>
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 (-----)

> Date: Sat, 23 Dec 2017 21:04:07 +0000
> Cc: Eli Zaretskii <eliz@HIDDEN>, 29478 <at> debbugs.gnu.org,
>   npostavs@HIDDEN
> From: Alan Mackenzie <acm@HIDDEN>
> 
> > I must say after reading the whole thread and looking at the code,
> > I still don't really understand what's the idea behind this patch (nor
> > exactly which problems we're trying to solve).
> 
> To make C-h c/k <shift><mouse-1> display "mouse-appearance-menu" rather
> than "key sequence unbound".  The idea behind the code is to return the
> last key sequence which is bound, rather than the very last one, which
> may not be.
> 
> > The way I understand the problem (which may be naive because I haven't
> > tried to play with the code yet, so I'm probably missing some subtlety),
> > the code should "simply" read events until the event read is not a down
> > event (and skipping pseudo events like mouse-movements and help-echo).
> > And then return all those events (it's probably not going to be more
> > than 2, but I don't see any benefit in hard-coding the fact that we
> > return either 1 or 2 events, we could just say "returns a list of
> > events").
> 
> Out of all these key sequences, some code somewhere has to select the
> one for which the help message will be displayed.  Perhaps arbitrarily,
> this is now in help-read-key-sequence.
> 
> > BTW, here are some comments about the current code:
> 
> > >                    (and no-mouse-movement
> > >                         (string-match "mouse-movement" keyname))
> > > +                  (progn (push key keys) nil)
> > >                    (and (string-match "\\(mouse\\|down\\|click\\|drag\\)"
> > >                                       keyname)
> 
> > Why string-match on event names rather than use things like
> > event-basic-type, and event-modifiers?
> 
> Lack of knowledge on the part of the person who wrote it (me).
> 
> > >                         (progn
> > > @@ -739,13 +740,31 @@ help-read-key-sequence
> > >                           (sleep-for 0.01)
> > >                           (while (read-event nil nil 0.01))
> 
> > We're blindly throwing away events here, right?  Isn't that a problem?
> 
> No, it's a filter.  Things like <help-echo>, which otherwise triggered
> the sit-for are now discarded, so that only user events are processed.
> I know of nobody who can press mouse buttons as fast as 100 times a
> second.  All this was diagnosed in the early stages of another bug
> report, bug #29272.

Alan, any news on this one?  I'm waiting for this to go in before
asking Nicolas to produce the next pretest of Emacs 26.1.

Thanks.




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

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


Received: (at 29478) by debbugs.gnu.org; 30 Dec 2017 10:50:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 30 05:50:38 2017
Received: from localhost ([127.0.0.1]:57223 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eVEis-0005fE-2M
	for submit <at> debbugs.gnu.org; Sat, 30 Dec 2017 05:50:38 -0500
Received: from eggs.gnu.org ([208.118.235.92]:54450)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eVEir-0005ez-0G
 for 29478 <at> debbugs.gnu.org; Sat, 30 Dec 2017 05:50:37 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eVEii-00014I-Jg
 for 29478 <at> debbugs.gnu.org; Sat, 30 Dec 2017 05:50:31 -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.5 required=5.0 tests=BAYES_05,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40028)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eVEiY-0000xM-Ji; Sat, 30 Dec 2017 05:50:18 -0500
Received: from [176.228.60.248] (port=4702 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 1eVEiX-0007M8-Tp; Sat, 30 Dec 2017 05:50:18 -0500
Date: Sat, 30 Dec 2017 12:50:04 +0200
Message-Id: <831sjcfq1v.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
In-reply-to: <jwvbmioipxp.fsf-monnier+emacsbugs@HIDDEN> (message from Stefan
 Monnier on Sun, 24 Dec 2017 01:52:26 -0500)
Subject: Re: [Patch] bug#29478: 26.0.90;
 `C-h k' followed by mouse clicks no longer shows down event
References: <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
 <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
 <20171222220549.GC8072@ACM> <833741lr0t.fsf@HIDDEN>
 <20171223111726.GA6618@ACM>
 <jwv4lohjv1e.fsf-monnier+emacsbugs@HIDDEN>
 <20171223210407.GC6618@ACM> <jwvbmioipxp.fsf-monnier+emacsbugs@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: 29478
Cc: acm@HIDDEN, 29478 <at> debbugs.gnu.org, npostavs@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>
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: Stefan Monnier <monnier@HIDDEN>
> Cc: Eli Zaretskii <eliz@HIDDEN>, 29478 <at> debbugs.gnu.org,
>         npostavs@HIDDEN
> Date: Sun, 24 Dec 2017 01:52:26 -0500
> 
> Here's another take on this problem (clearly not intended for emacs-26).
> 
> This is also able to provide help on double/triple mouse clicks
> (tho I had to resort to ztree to test it because such bindings are very
> rare).
> 
> What do you guys think?

This patch doesn't apply to the master branch, so I couldn't test it.

Thanks.




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

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


Received: (at 29478) by debbugs.gnu.org; 24 Dec 2017 15:42:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 24 10:42:04 2017
Received: from localhost ([127.0.0.1]:50793 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eT8Pa-0000yr-GS
	for submit <at> debbugs.gnu.org; Sun, 24 Dec 2017 10:42:02 -0500
Received: from chene.dit.umontreal.ca ([132.204.246.20]:58899)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1eT8PW-0000yO-BS
 for 29478 <at> debbugs.gnu.org; Sun, 24 Dec 2017 10:42:00 -0500
Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242])
 by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id vBOFftZL018680;
 Sun, 24 Dec 2017 10:41:55 -0500
Received: by ceviche.home (Postfix, from userid 20848)
 id 209356630A; Sun, 24 Dec 2017 10:41:55 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
Subject: Re: [Patch] bug#29478: 26.0.90;
 `C-h k' followed by mouse clicks no longer shows down event
Message-ID: <jwv608wi1di.fsf-monnier+emacsbugs@HIDDEN>
References: <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
 <20171222220549.GC8072@ACM> <833741lr0t.fsf@HIDDEN>
 <20171223111726.GA6618@ACM>
 <jwv4lohjv1e.fsf-monnier+emacsbugs@HIDDEN>
 <20171223210407.GC6618@ACM>
 <jwvbmioipxp.fsf-monnier+emacsbugs@HIDDEN>
 <20171224114836.GB8145@ACM>
Date: Sun, 24 Dec 2017 10:41:55 -0500
In-Reply-To: <20171224114836.GB8145@ACM> (Alan Mackenzie's message of "Sun, 24
 Dec 2017 11:48:36 +0000")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-NAI-Spam-Flag: NO
X-NAI-Spam-Threshold: 5
X-NAI-Spam-Score: 0
X-NAI-Spam-Rules: 2 Rules triggered
	EDT_SA_DN_PASS=0, RV6186=0
X-NAI-Spam-Version: 2.3.0.9418 : core <6186> : inlines <6282> : streams
 <1774047> : uri <2556623>
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: 29478
Cc: Eli Zaretskii <eliz@HIDDEN>, 29478 <at> debbugs.gnu.org,
 npostavs@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: -1.3 (-)

>> What do you guys think?
> It's a long patch.  Any chance of you giving a brief summary of what it
> does and what it's for, how it differs from what's already there, and so
> on?

The core part is `help-read-key-sequence` which is changed to:

    Return a list of elements of the form (SEQ . RAW-SEQ), where SEQ is a key
    sequence, and RAW-SEQ is its untranslated form.
    If NO-MOUSE-MOVEMENT is non-nil, ignore key sequences starting
    with `mouse-movement' events."

and which just keeps calling read-key-sequence as long as:

              ;; Read at least one key-sequence.
              (or (null key-list)
                  ;; After a down event, also read the (presumably) following
                  ;; up-event.
                  (memq 'down last-modifiers)
                  ;; After a click, see if a double click is on the way.
                  (and (memq 'click last-modifiers)
                       (not (sit-for (/ double-click-time 1000.0) t))))

So when you do `C-h k` followed by a triple click,
help-read-key-sequence will can return a list of 6 elements (3 down
events and 3 up events).

describe-key(-briefly) are changed to just loop over all the key
sequences returned.

> It's also refreshing to see a context diff every now and then.  :-)

The new code share too little with the old code, so I found the unified
diff unreadable.


        Stefan




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

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


Received: (at 29478) by debbugs.gnu.org; 24 Dec 2017 11:50:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 24 06:50:45 2017
Received: from localhost ([127.0.0.1]:50129 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eT4nl-0001PB-EY
	for submit <at> debbugs.gnu.org; Sun, 24 Dec 2017 06:50:45 -0500
Received: from colin.muc.de ([193.149.48.1]:36468 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1eT4nj-0001Oz-3w
 for 29478 <at> debbugs.gnu.org; Sun, 24 Dec 2017 06:50:43 -0500
Received: (qmail 77280 invoked by uid 3782); 24 Dec 2017 11:50:41 -0000
Received: from acm.muc.de (p548C62B1.dip0.t-ipconnect.de [84.140.98.177]) by
 colin.muc.de (tmda-ofmipd) with ESMTP;
 Sun, 24 Dec 2017 12:50:40 +0100
Received: (qmail 10163 invoked by uid 1000); 24 Dec 2017 11:48:36 -0000
Date: Sun, 24 Dec 2017 11:48:36 +0000
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: [Patch] bug#29478: 26.0.90;`C-h k' followed by mouse clicks no
 longer shows down event
Message-ID: <20171224114836.GB8145@ACM>
References: <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
 <20171222220549.GC8072@ACM> <833741lr0t.fsf@HIDDEN>
 <20171223111726.GA6618@ACM>
 <jwv4lohjv1e.fsf-monnier+emacsbugs@HIDDEN>
 <20171223210407.GC6618@ACM>
 <jwvbmioipxp.fsf-monnier+emacsbugs@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <jwvbmioipxp.fsf-monnier+emacsbugs@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: -0.0 (/)
X-Debbugs-Envelope-To: 29478
Cc: Eli Zaretskii <eliz@HIDDEN>, 29478 <at> debbugs.gnu.org,
 npostavs@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: -0.0 (/)

Hello, Stefan.

On Sun, Dec 24, 2017 at 01:52:26 -0500, Stefan Monnier wrote:
> Here's another take on this problem (clearly not intended for emacs-26).

> This is also able to provide help on double/triple mouse clicks
> (tho I had to resort to ztree to test it because such bindings are very
> rare).

> What do you guys think?

It's a long patch.  Any chance of you giving a brief summary of what it
does and what it's for, how it differs from what's already there, and so
on?

It's also refreshing to see a context diff every now and then.  :-)

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).




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

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


Received: (at 29478) by debbugs.gnu.org; 24 Dec 2017 08:45:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 24 03:45:57 2017
Received: from localhost ([127.0.0.1]:49902 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eT1uv-0005FM-5L
	for submit <at> debbugs.gnu.org; Sun, 24 Dec 2017 03:45:57 -0500
Received: from colin.muc.de ([193.149.48.1]:60314 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1eT1ut-0005FC-0P
 for 29478 <at> debbugs.gnu.org; Sun, 24 Dec 2017 03:45:55 -0500
Received: (qmail 15934 invoked by uid 3782); 24 Dec 2017 08:45:53 -0000
Received: from acm.muc.de (p548C62B1.dip0.t-ipconnect.de [84.140.98.177]) by
 colin.muc.de (tmda-ofmipd) with ESMTP;
 Sun, 24 Dec 2017 09:45:52 +0100
Received: (qmail 8501 invoked by uid 1000); 24 Dec 2017 08:43:48 -0000
Date: Sun, 24 Dec 2017 08:43:48 +0000
To: Andreas Schwab <schwab@HIDDEN>
Subject: Re: bug#29478: [Patch 2]: bug#29478: 26.0.90; `C-h k' followed by
 mouse clicks no longer shows down event
Message-ID: <20171224084348.GA8145@ACM>
References: <1b3879d6-f14e-47b0-970f-baf09598fcfd@default>
 <871skjnpd8.fsf@HIDDEN> <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
 <83o9ni3l3i.fsf@HIDDEN> <20171223142809.GB6618@ACM>
 <m21sjlijp5.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <m21sjlijp5.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: -0.0 (/)
X-Debbugs-Envelope-To: 29478
Cc: Eli Zaretskii <eliz@HIDDEN>, 29478 <at> debbugs.gnu.org,
 npostavs@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: -0.0 (/)

Hello, Andreas.

On Sat, Dec 23, 2017 at 15:48:38 +0100, Andreas Schwab wrote:
> On Dez 23 2017, Alan Mackenzie <acm@HIDDEN> wrote:

> > @@ -769,6 +773,28 @@ help-read-key-sequence
> >          (setq yank-menu (copy-sequence saved-yank-menu))
> >          (fset 'yank-menu (cons 'keymap yank-menu))))))
> >  
> > +(defun help-downify-mouse-event-type (base)
> > +  "Add \"down-\" to BASE if it is not already there.
> > +BASE is a symbol, a mouse event type.  If the modification is done,
> > +return the new symbol.  Otherwise return nil."
> > +  (let ((base-s (symbol-name base)))
> > +    ;; Note: the order of the components in the following string is
> > +    ;; determined by `apply_modifiers_uncached' in src/keyboard.c.
> > +    (string-match "\\(A-\\)?\
> > +\\(C-\\)?\
> > +\\(H-\\)?\
> > +\\(M-\\)?\
> > +\\(S-\\)?\
> > +\\(s-\\)?\
> > +\\(double-\\)?\
> > +\\(triple-\\)?\
> > +\\(up-\\)?\
> > +\\(\\(down-\\)?\\)\
> > +\\(\\(drag-\\)?\\)" base-s)
> > +    (when (and (zerop (length (match-string 10 base-s)))  ; "down-"
> > +               (zerop (length (match-string 12 base-s)))) ; "drag-"

> A group that didn't match can be detected by match-string (or
> match-beginning) returning nil.

Yes, it can.  Thanks!  I've amended the function accordingly.

> Andreas.

> -- 
> Andreas Schwab, schwab@HIDDEN
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> "And now for something completely different."

-- 
Alan Mackenzie (Nuremberg, Germany).




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

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


Received: (at 29478) by debbugs.gnu.org; 24 Dec 2017 06:52:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 24 01:52:32 2017
Received: from localhost ([127.0.0.1]:49877 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eT09A-0002TG-0o
	for submit <at> debbugs.gnu.org; Sun, 24 Dec 2017 01:52:32 -0500
Received: from pruche.dit.umontreal.ca ([132.204.246.22]:44293)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1eT097-0002T7-A2
 for 29478 <at> debbugs.gnu.org; Sun, 24 Dec 2017 01:52:31 -0500
Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242])
 by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id vBO6qQid019920;
 Sun, 24 Dec 2017 01:52:27 -0500
Received: by ceviche.home (Postfix, from userid 20848)
 id 66A14662FC; Sun, 24 Dec 2017 01:52:26 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
Subject: Re: [Patch] bug#29478: 26.0.90;
 `C-h k' followed by mouse clicks no longer shows down event
Message-ID: <jwvbmioipxp.fsf-monnier+emacsbugs@HIDDEN>
References: <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
 <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
 <20171222220549.GC8072@ACM> <833741lr0t.fsf@HIDDEN>
 <20171223111726.GA6618@ACM>
 <jwv4lohjv1e.fsf-monnier+emacsbugs@HIDDEN>
 <20171223210407.GC6618@ACM>
Date: Sun, 24 Dec 2017 01:52:26 -0500
In-Reply-To: <20171223210407.GC6618@ACM> (Alan Mackenzie's message of "Sat, 23
 Dec 2017 21:04:07 +0000")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-NAI-Spam-Flag: NO
X-NAI-Spam-Threshold: 5
X-NAI-Spam-Score: 0
X-NAI-Spam-Rules: 2 Rules triggered
	EDT_SA_DN_PASS=0, RV6186=0
X-NAI-Spam-Version: 2.3.0.9418 : core <6186> : inlines <6281> : streams
 <1774012> : uri <2556446>
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: 29478
Cc: Eli Zaretskii <eliz@HIDDEN>, 29478 <at> debbugs.gnu.org,
 npostavs@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: -1.3 (-)

Here's another take on this problem (clearly not intended for emacs-26).

This is also able to provide help on double/triple mouse clicks
(tho I had to resort to ztree to test it because such bindings are very
rare).

What do you guys think?


        Stefan


diff --git a/lisp/help.el b/lisp/help.el
index ac7cf91801..1a38042a51 100644
*** a/lisp/help.el
--- b/lisp/help.el
***************
*** 593,611 ****
  	    string
  	  (format "%s (translated from %s)" string otherstring))))))
  
  (defun help--analyze-key (key untranslated)
    "Get information about KEY its corresponding UNTRANSLATED events.
  Returns a list of the form (BRIEF-DESC DEFN EVENT MOUSE-MSG)."
    (if (numberp untranslated)
!       (setq untranslated (this-single-command-raw-keys)))
!   (let* ((event (aref key (if (and (symbolp (aref key 0))
! 				   (> (length key) 1)
! 				   (consp (aref key 1)))
! 			      1
! 			    0)))
  	 (modifiers (event-modifiers event))
  	 (mouse-msg (if (or (memq 'click modifiers) (memq 'down modifiers)
! 			    (memq 'drag modifiers)) " at that spot" ""))
  	 (defn (key-binding key t)))
      ;; Handle the case where we faked an entry in "Select and Paste" menu.
      (when (and (eq defn nil)
--- 593,618 ----
  	    string
  	  (format "%s (translated from %s)" string otherstring))))))
  
+ (defun help--first-event (keyseq)
+   (when (> (length keyseq) 0)
+     (aref key (if (and (symbolp (aref keyseq 0))
+ 		       (> (length keyseq) 1)
+ 		       (consp (aref keyseq 1)))
+                   ;; Look at the second event when the first
+                   ;; is a pseudo-event like `mode-line' of `left-fringe'.
+ 		  1
+ 	        0))))
+ 
  (defun help--analyze-key (key untranslated)
    "Get information about KEY its corresponding UNTRANSLATED events.
  Returns a list of the form (BRIEF-DESC DEFN EVENT MOUSE-MSG)."
    (if (numberp untranslated)
!       (error "Missing `untranslated'!"))
!   (let* ((event (help--first-event key))
  	 (modifiers (event-modifiers event))
  	 (mouse-msg (if (or (memq 'click modifiers) (memq 'down modifiers)
! 			    (memq 'drag modifiers))
!                         " at that spot" ""))
  	 (defn (key-binding key t)))
      ;; Handle the case where we faked an entry in "Select and Paste" menu.
      (when (and (eq defn nil)
***************
*** 626,647 ****
           (format "%s%s runs the command %S" key-desc mouse-msg defn)))
       defn event mouse-msg)))
  
! (defun describe-key-briefly (&optional key insert untranslated)
!   "Print the name of the function KEY invokes.  KEY is a string.
  If INSERT (the prefix arg) is non-nil, insert the message in the buffer.
- If non-nil, UNTRANSLATED is a vector of the untranslated events.
- It can also be a number in which case the untranslated events from
- the last key hit are used.
  
! If KEY is a menu item or a tool-bar button that is disabled, this command
! temporarily enables it to allow getting help on disabled items and buttons."
    (interactive
     ;; Ignore mouse movement events because it's too easy to miss the
     ;; message while moving the mouse.
!    (pcase-let ((`(,key ,_up-event) (help-read-key-sequence 'no-mouse-movement)))
!      `(,key ,current-prefix-arg 1)))
!   (princ (car (help--analyze-key key untranslated))
!          (if insert (current-buffer) standard-output)))
  
  (defun help--key-binding-keymap (key &optional accept-default no-remap position)
    "Return a keymap holding a binding for KEY within current keymaps.
--- 633,658 ----
           (format "%s%s runs the command %S" key-desc mouse-msg defn)))
       defn event mouse-msg)))
  
! (defun describe-key-briefly (key-list &optional insert)
!   "Print the name of the functions KEY-LIST invokes.
! KEY-LIST is a list of pairs (SEQ . RAW-SEQ) of key sequences, where
! RAW-SEQ is the untranslated form of the key sequence SEQ.
  If INSERT (the prefix arg) is non-nil, insert the message in the buffer.
  
! While reading KEY-LIST interactively, this command temporarily enables
! menu items or tool-bar buttons that are disabled to allow getting help
! on them."
    (interactive
     ;; Ignore mouse movement events because it's too easy to miss the
     ;; message while moving the mouse.
!    (let ((key-list (help-read-key-sequence 'no-mouse-movement)))
!      `(,key-list ,current-prefix-arg)))
!   (let ((msg (mapconcat (lambda (x)
!                           (pcase-let ((`(,seq . ,raw-seq) (pop key-list)))
!                             (car (help--analyze-key seq raw-seq))))
!                         key-list
!                         "\n")))
!     (if insert (insert msg) (message "%s" msg))))
  
  (defun help--key-binding-keymap (key &optional accept-default no-remap position)
    "Return a keymap holding a binding for KEY within current keymaps.
***************
*** 706,865 ****
            nil)))))
  
  (defun help-read-key-sequence (&optional no-mouse-movement)
!   "Reads a key sequence from the user.
! Returns a list of the form (KEY UP-EVENT), where KEY is the key
! sequence, and UP-EVENT is the up-event that was discarded by
! reading KEY, or nil.
  If NO-MOUSE-MOVEMENT is non-nil, ignore key sequences starting
  with `mouse-movement' events."
    (let ((enable-disabled-menus-and-buttons t)
          (cursor-in-echo-area t)
          saved-yank-menu)
      (unwind-protect
!         (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))
              (setq saved-yank-menu (copy-sequence yank-menu))
              (menu-bar-update-yank-menu "(any string)" nil))
            (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)))
!                  (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.01)
!                          (while (read-event nil nil 0.01))
!                          (not (sit-for (/ double-click-time 1000.0) t))))))))
!           (list
!            key
!            ;; If KEY is a down-event, read and include the
!            ;; corresponding up-event.  Note that there are also
!            ;; down-events on scroll bars and mode lines: the actual
!            ;; event then is in the second element of the vector.
!            (and (vectorp key)
!                 (let ((last-idx (1- (length key))))
!                   (and (eventp (aref key last-idx))
!                        (memq 'down (event-modifiers (aref key last-idx)))))
!                 (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 (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))
          (fset 'yank-menu (cons 'keymap yank-menu))))))
  
! (defun describe-key (&optional key untranslated up-event)
!   "Display documentation of the function invoked by KEY.
! KEY can be any kind of a key sequence; it can include keyboard events,
  mouse events, and/or menu events.  When calling from a program,
! pass KEY as a string or a vector.
! 
! If non-nil, UNTRANSLATED is a vector of the corresponding untranslated events.
! It can also be a number, in which case the untranslated events from
! the last key sequence entered are used.
! UP-EVENT is the up-event that was discarded by reading KEY, or nil.
  
- If KEY is a menu item or a tool-bar button that is disabled, this command
- temporarily enables it to allow getting help on disabled items and buttons."
-   (interactive
-    (pcase-let ((`(,key ,up-event) (help-read-key-sequence)))
-      `(,key ,(prefix-numeric-value current-prefix-arg) ,up-event)))
-   (pcase-let ((`(,brief-desc ,defn ,event ,mouse-msg)
-                (help--analyze-key key untranslated))
-               (defn-up nil) (defn-up-tricky nil)
-               (key-locus-up nil) (key-locus-up-tricky nil)
-               (mouse-1-remapped nil) (mouse-1-tricky nil)
-               (ev-type nil))
-     (if (or (null defn)
-             (integerp defn)
-             (equal defn 'undefined))
-         (message "%s" brief-desc)
-       (help-setup-xref (list #'describe-function defn)
- 		       (called-interactively-p 'interactive))
-       ;; Need to do this before erasing *Help* buffer in case event
-       ;; is a mouse click in an existing *Help* buffer.
-       (when up-event
- 	(setq ev-type (event-basic-type up-event))
- 	(let ((sequence (vector up-event)))
- 	  (when (and (eq ev-type 'mouse-1)
- 		     mouse-1-click-follows-link
- 		     (not (eq mouse-1-click-follows-link 'double))
- 		     (setq mouse-1-remapped
- 			   (mouse-on-link-p (event-start up-event))))
- 	    (setq mouse-1-tricky (and (integerp mouse-1-click-follows-link)
- 				      (> mouse-1-click-follows-link 0)))
- 	    (cond ((stringp mouse-1-remapped)
- 		   (setq sequence mouse-1-remapped))
- 		  ((vectorp mouse-1-remapped)
- 		   (setcar up-event (elt mouse-1-remapped 0)))
- 		  (t (setcar up-event 'mouse-2))))
- 	  (setq defn-up (key-binding sequence nil nil (event-start up-event)))
-           (setq key-locus-up (help--binding-locus sequence (event-start up-event)))
- 	  (when mouse-1-tricky
- 	    (setq sequence (vector up-event))
- 	    (aset sequence 0 'mouse-1)
- 	    (setq defn-up-tricky (key-binding sequence nil nil (event-start up-event)))
-             (setq key-locus-up-tricky (help--binding-locus sequence (event-start up-event))))))
-       (with-help-window (help-buffer)
          (princ brief-desc)
!         (let ((key-locus (help--binding-locus key (event-start event))))
!           (when key-locus
!             (princ (format " (found in %s)" key-locus))))
          (princ ", which is ")
! 	(describe-function-1 defn)
! 	(when up-event
! 	  (unless (or (null defn-up)
! 		      (integerp defn-up)
! 		      (equal defn-up 'undefined))
! 	    (princ (format "
! 
! ----------------- up-event %s----------------
! 
! %s%s%s runs the command %S%s, which is "
! 			   (if mouse-1-tricky "(short click) " "")
! 			   (key-description (vector up-event))
! 			   mouse-msg
! 			   (if mouse-1-remapped
!                                " is remapped to <mouse-2>, which" "")
! 			   defn-up (if key-locus-up
!                                        (format " (found in %s)" key-locus-up)
!                                      "")))
! 	    (describe-function-1 defn-up))
! 	  (unless (or (null defn-up-tricky)
! 		      (integerp defn-up-tricky)
! 		      (eq defn-up-tricky 'undefined))
! 	    (princ (format "
! 
! ----------------- up-event (long click) ----------------
! 
! Pressing <%S>%s for longer than %d milli-seconds
! runs the command %S%s, which is "
! 			   ev-type mouse-msg
! 			   mouse-1-click-follows-link
! 			   defn-up-tricky (if key-locus-up-tricky
!                                               (format " (found in %s)" key-locus-up-tricky)
!                                             "")))
! 	    (describe-function-1 defn-up-tricky)))))))
  
  (defun describe-mode (&optional buffer)
    "Display documentation of current major mode and minor modes.
--- 717,815 ----
            nil)))))
  
  (defun help-read-key-sequence (&optional no-mouse-movement)
!   "Read \"a\" key sequence from the user.
! Return a list of elements of the form (SEQ . RAW-SEQ), where SEQ is a key
! sequence, and RAW-SEQ is its untranslated form.
  If NO-MOUSE-MOVEMENT is non-nil, ignore key sequences starting
  with `mouse-movement' events."
    (let ((enable-disabled-menus-and-buttons t)
          (cursor-in-echo-area t)
          saved-yank-menu)
      (unwind-protect
!         (let (last-modifiers key-list)
            ;; If yank-menu is empty, populate it temporarily, so that
            ;; "Select and Paste" menu can generate a complete event.
            (when (null (cdr yank-menu))
              (setq saved-yank-menu (copy-sequence yank-menu))
              (menu-bar-update-yank-menu "(any string)" nil))
            (while
!               ;; Read at least one key-sequence.
!               (or (null key-list)
!                   ;; After a down event, also read the (presumably) following
!                   ;; up-event.
!                   (memq 'down last-modifiers)
!                   ;; After a click, see if a double click is on the way.
!                   (and (memq 'click last-modifiers)
!                        (not (sit-for (/ double-click-time 1000.0) t))))
!             (let* ((seq (read-key-sequence "\
  Describe the following key, mouse click, or menu item: "))
!                    (raw-seq (this-single-command-raw-keys))
!                    (key0 (when (> (length seq) 0)
!                            (aref seq 0)))
!                    (base (event-basic-type key0))
!                    (modifiers (event-modifiers key0)))
!               (cond
!                ((and no-mouse-movement (eq base 'mouse-movement)) nil)
!                ((eq base 'help-echo) nil)
!                (t
!                 (setq last-modifiers modifiers)
!                 (push (cons seq raw-seq) key-list)))))
!           (nreverse key-list))
        ;; Put yank-menu back as it was, if we changed it.
        (when saved-yank-menu
          (setq yank-menu (copy-sequence saved-yank-menu))
          (fset 'yank-menu (cons 'keymap yank-menu))))))
  
! (defun describe-key (key-list)
!   "Display documentation of the function invoked by KEY-LIST.
! KEY-LIST can be any kind of a key sequence; it can include keyboard events,
  mouse events, and/or menu events.  When calling from a program,
! pass KEY-LIST as a list of elements (SEQ . RAW-SEQ) where SEQ is
! a key-sequence and RAW-SEQ is its untranslated form.
! 
! While reading KEY-LIST interactively, this command temporarily enables
! menu items or tool-bar buttons that are disabled to allow getting help
! on them."
!   (interactive (list (help-read-key-sequence)))
!   (let ((buf (current-buffer))
!         (info-list
!          (mapcar (lambda (x)
!                    (pcase-let* ((`(,seq . ,raw-seq) x)
!                                 (`(,brief-desc ,defn ,event ,_mouse-msg)
!                                  (help--analyze-key seq raw-seq))
!                                 (locus
!                                  (help--binding-locus seq (event-start event))))
!                      `(,seq ,raw-seq ,brief-desc ,defn ,event ,locus)))
!                  key-list)))
!     (help-setup-xref (list (lambda (key-list)
!                              (with-current-buffer (if (buffer-live-p buf)
!                                                       buf (current-buffer))
!                                (describe-key key-list)))
!                            key-list)
! 		     (called-interactively-p 'interactive))
!     (with-help-window (help-buffer)
!       (when (> (length info-list) 1)
!         ;; FIXME: Make this into clickable hyperlinks.
!         (princ "There were several key-sequences:\n\n")
!         (princ (mapconcat (lambda (info)
!                              (pcase-let ((`(,seq ,raw-seq
!                                             ,brief-desc ,defn ,event ,locus)
!                                           info))
!                                (concat "  " brief-desc)))
!                            info-list
!                            "\n"))
!         (princ "\n\nThey're all described below."))
!       (pcase-dolist (`(,seq ,raw-seq ,brief-desc ,defn ,event ,locus)
!                      info-list)
!         (when (> (length info-list) 1)
!           (princ (format "\n\n----------------- event `%s' ----------------\n\n"
!                           (key-description seq))))
  
          (princ brief-desc)
!         (when locus
!           (princ (format " (found in %s)" locus)))
          (princ ", which is ")
! 	(describe-function-1 defn)))))
  
  (defun describe-mode (&optional buffer)
    "Display documentation of current major mode and minor modes.




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

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


Received: (at 29478) by debbugs.gnu.org; 24 Dec 2017 05:41:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 24 00:41:37 2017
Received: from localhost ([127.0.0.1]:49862 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eSz2X-0000XX-3U
	for submit <at> debbugs.gnu.org; Sun, 24 Dec 2017 00:41:37 -0500
Received: from eggs.gnu.org ([208.118.235.92]:52860)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eSz2V-0000XN-Kf
 for 29478 <at> debbugs.gnu.org; Sun, 24 Dec 2017 00:41:36 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eSz2N-0007u7-76
 for 29478 <at> debbugs.gnu.org; Sun, 24 Dec 2017 00:41:30 -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.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52488)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eSz2A-0007mG-MM; Sun, 24 Dec 2017 00:41:14 -0500
Received: from [176.12.140.168] (port=57216 helo=[10.164.85.87])
 by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1eSz29-0006bS-Of; Sun, 24 Dec 2017 00:41:14 -0500
Date: Sun, 24 Dec 2017 07:41:08 +0200
User-Agent: K-9 Mail for Android
In-Reply-To: <jwvh8sgivhh.fsf-monnier+emacsbugs@HIDDEN>
References: <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default> <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default> <83bmji2xye.fsf@HIDDEN>
 <83tvwzubez.fsf@HIDDEN> <20171222220549.GC8072@ACM> <833741lr0t.fsf@HIDDEN>
 <20171223111726.GA6618@ACM> <jwv4lohjv1e.fsf-monnier+emacsbugs@HIDDEN>
 <20171223210407.GC6618@ACM> <jwvh8sgivhh.fsf-monnier+emacsbugs@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable
Subject: Re: [Patch] bug#29478: 26.0.90;
 `C-h k' followed by mouse clicks no longer shows down event
To: Stefan Monnier <monnier@HIDDEN>,Alan Mackenzie <acm@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
Message-ID: <B6948BC1-157E-42D8-BF85-9A92CCCF846D@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: 29478
Cc: 29478 <at> debbugs.gnu.org, npostavs@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: -5.0 (-----)

On December 24, 2017 6:55:52 AM GMT+02:00, Stefan Monnier <monnier@IRO=2EUM=
ontreal=2ECA> wrote:
> > Out of all these key sequences, some code somewhere has to select
> the
> > one for which the help message will be displayed=2E
>=20
> I think this is a mistake=2E  We should give the answer for all the
> events
> we've seen=2E  E=2Eg=2E it may be important for the user to know that
> mouse-1
> is not bound or that down-mouse-1 is not bound=2E


First, giving an answer for more than one event is impossible for "C-h c";=
 not without a complete redesign of how we present the results=2E  Until ve=
ry recently, we would show only the first event, which is useless for 90% o=
f mouse clicks, since very few commands are bound to down-events=2E  This h=
as been a source of constant annoyance for me for years, and now is finally=
 solved=2E  So this is some progress=2E

For "C-h k", we probably should indeed show all the events, but the previo=
us solution to show the down-event first was problematic here as well, as i=
t showed the much less important event first, and a user who is in a hurry =
might not pay attention to the rest=2E

In most cases, there are 2 or less events to show, so Alan's patch that te=
lls users how to get help on the down-event is a good stopgap, IMO=2E  In g=
eneral, we should probably redesign how these multiple events are described=
, but that's a job for master, not for the release branch=2E




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

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


Received: (at 29478) by debbugs.gnu.org; 24 Dec 2017 04:55:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 23 23:55:57 2017
Received: from localhost ([127.0.0.1]:49822 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eSyKL-0007oH-1k
	for submit <at> debbugs.gnu.org; Sat, 23 Dec 2017 23:55:57 -0500
Received: from pruche.dit.umontreal.ca ([132.204.246.22]:40690)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1eSyKI-0007o8-K0
 for 29478 <at> debbugs.gnu.org; Sat, 23 Dec 2017 23:55:55 -0500
Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242])
 by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id vBO4tq9a014682;
 Sat, 23 Dec 2017 23:55:53 -0500
Received: by ceviche.home (Postfix, from userid 20848)
 id 3FE73662FC; Sat, 23 Dec 2017 23:55:52 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
Subject: Re: [Patch] bug#29478: 26.0.90;
 `C-h k' followed by mouse clicks no longer shows down event
Message-ID: <jwvh8sgivhh.fsf-monnier+emacsbugs@HIDDEN>
References: <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
 <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
 <20171222220549.GC8072@ACM> <833741lr0t.fsf@HIDDEN>
 <20171223111726.GA6618@ACM>
 <jwv4lohjv1e.fsf-monnier+emacsbugs@HIDDEN>
 <20171223210407.GC6618@ACM>
Date: Sat, 23 Dec 2017 23:55:52 -0500
In-Reply-To: <20171223210407.GC6618@ACM> (Alan Mackenzie's message of "Sat, 23
 Dec 2017 21:04:07 +0000")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-NAI-Spam-Flag: NO
X-NAI-Spam-Threshold: 5
X-NAI-Spam-Score: 0
X-NAI-Spam-Rules: 2 Rules triggered
	EDT_SA_DN_PASS=0, RV6186=0
X-NAI-Spam-Version: 2.3.0.9418 : core <6186> : inlines <6281> : streams
 <1774005> : uri <2556408>
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: 29478
Cc: Eli Zaretskii <eliz@HIDDEN>, 29478 <at> debbugs.gnu.org,
 npostavs@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: -1.3 (-)

> Out of all these key sequences, some code somewhere has to select the
> one for which the help message will be displayed.

I think this is a mistake.  We should give the answer for all the events
we've seen.  E.g. it may be important for the user to know that mouse-1
is not bound or that down-mouse-1 is not bound.

>> Why string-match on event names rather than use things like
>> event-basic-type, and event-modifiers?
> Lack of knowledge on the part of the person who wrote it (me).

Ah, good, I thought the author had bumped into some odd problem with the
other constructs.

>> >                         (progn
>> > @@ -739,13 +740,31 @@ help-read-key-sequence
>> >                           (sleep-for 0.01)
>> >                           (while (read-event nil nil 0.01))
>
>> We're blindly throwing away events here, right?  Isn't that a problem?
>
> No, it's a filter.  Things like <help-echo>, which otherwise triggered
> the sit-for are now discarded, so that only user events are processed.

But how can we know that we'll only drop help-echo events there?

> I know of nobody who can press mouse buttons as fast as 100 times a
> second.

Yeah, I guess in practice it's not too bad (it can still suffer in cases
where the events don't come from separate user motions but via input
devices which send combined sequences, but it's not too common).

But why not just go around the loop again, and skip the help-echo events
like we do for mouse-movement?  Hmm... oh I guess it's because the
read-key-sequence used here has a timeout whereas the other doesn't...
I'm beginning to understand.
Thanks,


        Stefan




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

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


Received: (at 29478) by debbugs.gnu.org; 23 Dec 2017 21:06:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 23 16:06:13 2017
Received: from localhost ([127.0.0.1]:49604 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eSqzk-0003Rt-Ti
	for submit <at> debbugs.gnu.org; Sat, 23 Dec 2017 16:06:13 -0500
Received: from colin.muc.de ([193.149.48.1]:50879 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1eSqzi-0003Rk-V8
 for 29478 <at> debbugs.gnu.org; Sat, 23 Dec 2017 16:06:11 -0500
Received: (qmail 35367 invoked by uid 3782); 23 Dec 2017 21:06:06 -0000
Received: from acm.muc.de (p548C7AB5.dip0.t-ipconnect.de [84.140.122.181]) by
 colin.muc.de (tmda-ofmipd) with ESMTP;
 Sat, 23 Dec 2017 22:06:04 +0100
Received: (qmail 7492 invoked by uid 1000); 23 Dec 2017 21:04:07 -0000
Date: Sat, 23 Dec 2017 21:04:07 +0000
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: [Patch] bug#29478: 26.0.90;`C-h k' followed by mouse clicks no
 longer shows down event
Message-ID: <20171223210407.GC6618@ACM>
References: <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
 <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
 <20171222220549.GC8072@ACM> <833741lr0t.fsf@HIDDEN>
 <20171223111726.GA6618@ACM>
 <jwv4lohjv1e.fsf-monnier+emacsbugs@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <jwv4lohjv1e.fsf-monnier+emacsbugs@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: -0.0 (/)
X-Debbugs-Envelope-To: 29478
Cc: Eli Zaretskii <eliz@HIDDEN>, 29478 <at> debbugs.gnu.org,
 npostavs@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: -0.0 (/)

Hello, Stefan.

On Sat, Dec 23, 2017 at 11:33:11 -0500, Stefan Monnier wrote:
[ .... ]

> > OK, I have a provisional fix.  The problem was that the double-click-time
> > loop in help-read-key-sequence was discarding all events but the last
> > one.  I have amended the loop so that _all_ these events are stored in a
> > list, and we then discard the most recent events till we find one with a
> > binding.

> I must say after reading the whole thread and looking at the code,
> I still don't really understand what's the idea behind this patch (nor
> exactly which problems we're trying to solve).

To make C-h c/k <shift><mouse-1> display "mouse-appearance-menu" rather
than "key sequence unbound".  The idea behind the code is to return the
last key sequence which is bound, rather than the very last one, which
may not be.

> The way I understand the problem (which may be naive because I haven't
> tried to play with the code yet, so I'm probably missing some subtlety),
> the code should "simply" read events until the event read is not a down
> event (and skipping pseudo events like mouse-movements and help-echo).
> And then return all those events (it's probably not going to be more
> than 2, but I don't see any benefit in hard-coding the fact that we
> return either 1 or 2 events, we could just say "returns a list of
> events").

Out of all these key sequences, some code somewhere has to select the
one for which the help message will be displayed.  Perhaps arbitrarily,
this is now in help-read-key-sequence.

> BTW, here are some comments about the current code:

> >                    (and no-mouse-movement
> >                         (string-match "mouse-movement" keyname))
> > +                  (progn (push key keys) nil)
> >                    (and (string-match "\\(mouse\\|down\\|click\\|drag\\)"
> >                                       keyname)

> Why string-match on event names rather than use things like
> event-basic-type, and event-modifiers?

Lack of knowledge on the part of the person who wrote it (me).

> >                         (progn
> > @@ -739,13 +740,31 @@ help-read-key-sequence
> >                           (sleep-for 0.01)
> >                           (while (read-event nil nil 0.01))

> We're blindly throwing away events here, right?  Isn't that a problem?

No, it's a filter.  Things like <help-echo>, which otherwise triggered
the sit-for are now discarded, so that only user events are processed.
I know of nobody who can press mouse buttons as fast as 100 times a
second.  All this was diagnosed in the early stages of another bug
report, bug #29272.

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).




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

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


Received: (at 29478) by debbugs.gnu.org; 23 Dec 2017 16:33:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 23 11:33:16 2017
Received: from localhost ([127.0.0.1]:49527 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eSmjc-0004xC-NS
	for submit <at> debbugs.gnu.org; Sat, 23 Dec 2017 11:33:16 -0500
Received: from pruche.dit.umontreal.ca ([132.204.246.22]:53438)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1eSmjb-0004x3-27
 for 29478 <at> debbugs.gnu.org; Sat, 23 Dec 2017 11:33:15 -0500
Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242])
 by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id vBNGXCZY021870;
 Sat, 23 Dec 2017 11:33:13 -0500
Received: by ceviche.home (Postfix, from userid 20848)
 id C4C746634E; Sat, 23 Dec 2017 11:33:11 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
Subject: Re: [Patch] bug#29478: 26.0.90;
 `C-h k' followed by mouse clicks no longer shows down event
Message-ID: <jwv4lohjv1e.fsf-monnier+emacsbugs@HIDDEN>
References: <1b3879d6-f14e-47b0-970f-baf09598fcfd@default>
 <871skjnpd8.fsf@HIDDEN> <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
 <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
 <20171222220549.GC8072@ACM> <833741lr0t.fsf@HIDDEN>
 <20171223111726.GA6618@ACM>
Date: Sat, 23 Dec 2017 11:33:11 -0500
In-Reply-To: <20171223111726.GA6618@ACM> (Alan Mackenzie's message of "Sat, 23
 Dec 2017 11:17:26 +0000")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-NAI-Spam-Flag: NO
X-NAI-Spam-Threshold: 5
X-NAI-Spam-Score: 0
X-NAI-Spam-Rules: 2 Rules triggered
	EDT_SA_DN_PASS=0, RV6186=0
X-NAI-Spam-Version: 2.3.0.9418 : core <6186> : inlines <6281> : streams
 <1773956> : uri <2556144>
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: 29478
Cc: Eli Zaretskii <eliz@HIDDEN>, 29478 <at> debbugs.gnu.org,
 npostavs@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: -1.3 (-)

> Of course!  read-key-sequence consumes all the events up to the
> S-down-mouse-1, leaving the following S-mouse-1 in the event buffer.
> This is read at the next iteration of the command loop.

Exactly.

>> CC'ing Stefan in the hope that he could have some insights.
>
> OK, I have a provisional fix.  The problem was that the double-click-time
> loop in help-read-key-sequence was discarding all events but the last
> one.  I have amended the loop so that _all_ these events are stored in a
> list, and we then discard the most recent events till we find one with a
> binding.

I must say after reading the whole thread and looking at the code,
I still don't really understand what's the idea behind this patch (nor
exactly which problems we're trying to solve).

The way I understand the problem (which may be naive because I haven't
tried to play with the code yet, so I'm probably missing some subtlety),
the code should "simply" read events until the event read is not a down
event (and skipping pseudo events like mouse-movements and help-echo).
And then return all those events (it's probably not going to be more
than 2, but I don't see any benefit in hard-coding the fact that we
return either 1 or 2 events, we could just say "returns a list of
events").

BTW, here are some comments about the current code:

>                    (and no-mouse-movement
>                         (string-match "mouse-movement" keyname))
> +                  (progn (push key keys) nil)
>                    (and (string-match "\\(mouse\\|down\\|click\\|drag\\)"
>                                       keyname)

Why string-match on event names rather than use things like
event-basic-type, and event-modifiers?

>                         (progn
> @@ -739,13 +740,31 @@ help-read-key-sequence
>                           (sleep-for 0.01)
>                           (while (read-event nil nil 0.01))

We're blindly throwing away events here, right?  Isn't that a problem?


        Stefan




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

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


Received: (at 29478) by debbugs.gnu.org; 23 Dec 2017 16:19:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 23 11:19:11 2017
Received: from localhost ([127.0.0.1]:49522 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eSmVy-0004cS-25
	for submit <at> debbugs.gnu.org; Sat, 23 Dec 2017 11:19:11 -0500
Received: from pruche.dit.umontreal.ca ([132.204.246.22]:52611)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1eSmVv-0004cK-OF
 for 29478 <at> debbugs.gnu.org; Sat, 23 Dec 2017 11:19:09 -0500
Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242])
 by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id vBNGJ3qd021020;
 Sat, 23 Dec 2017 11:19:04 -0500
Received: by ceviche.home (Postfix, from userid 20848)
 id D813F6634E; Sat, 23 Dec 2017 11:19:02 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#29478: `C-h k' followed by mouse clicks no longer shows down
 event
Message-ID: <jwvzi69ifs2.fsf-monnier+bug#29478@HIDDEN>
References: <1b3879d6-f14e-47b0-970f-baf09598fcfd@default>
 <871skjnpd8.fsf@HIDDEN>> <20171128221036.GC14868@ACM>>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>>
 <83o9ni3l3i.fsf@HIDDEN>>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN>
Date: Sat, 23 Dec 2017 11:19:02 -0500
In-Reply-To: <83bmji2xye.fsf@HIDDEN> (Eli Zaretskii's message of "Fri, 01 Dec
 2017 18:51:37 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-NAI-Spam-Flag: NO
X-NAI-Spam-Threshold: 5
X-NAI-Spam-Score: 0
X-NAI-Spam-Rules: 2 Rules triggered
	EDT_SA_DN_PASS=0, RV6186=0
X-NAI-Spam-Version: 2.3.0.9418 : core <6186> : inlines <6281> : streams
 <1773955> : uri <2556138>
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: 29478
Cc: acm@HIDDEN, 29478 <at> debbugs.gnu.org, Drew Adams <drew.adams@HIDDEN>,
 npostavs@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: -1.3 (-)

>> >   For documentation of the corresponding mouse-down event,
>> >   click and hold the mouse button longer than %s sec.
>> > (where %s gets replaced by double-click-time)?
>> That's a hack/workaround

Agreed.

> The previous way, where down-event was described before the up-event,
> was also a hack.

Maybe its implementation was hackish, but as far as the UI goes I don't
think it was a hack.

> The fundamental problem here is that Emacs doesn't
> know what the user wants/needs, and the semi-kludgey way we intuit
> that when processing mouse gestures is part of the reason.

The way to solve this is to add a menu/index at the beginning indicating
that there were *several* events, such that the user is made aware that
he may have to skip some info to find the one of interest (and
presumably this menu is made clickable so the user can easily jump to
the part he wants).

The same kind of situation shows up with `C-h o` for symbols that
combine various roles (function, variable, type, face, ...), BTW.


        Stefan




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

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


Received: (at 29478) by debbugs.gnu.org; 23 Dec 2017 14:48:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 23 09:48:49 2017
Received: from localhost ([127.0.0.1]:48839 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eSl6X-0002Oo-Nc
	for submit <at> debbugs.gnu.org; Sat, 23 Dec 2017 09:48:49 -0500
Received: from mail-out.m-online.net ([212.18.0.10]:44511)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <whitebox@HIDDEN>) id 1eSl6T-0002Od-As
 for 29478 <at> debbugs.gnu.org; Sat, 23 Dec 2017 09:48:46 -0500
Received: from frontend01.mail.m-online.net (unknown [192.168.8.182])
 by mail-out.m-online.net (Postfix) with ESMTP id 3z3pCw17Z6z1qtXF;
 Sat, 23 Dec 2017 15:48:43 +0100 (CET)
Received: from localhost (dynscan1.mnet-online.de [192.168.6.70])
 by mail.m-online.net (Postfix) with ESMTP id 3z3pCv1xKVz1qsvR;
 Sat, 23 Dec 2017 15:48:43 +0100 (CET)
X-Virus-Scanned: amavisd-new at mnet-online.de
Received: from mail.mnet-online.de ([192.168.8.182])
 by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new,
 port 10024)
 with ESMTP id caXq7vvaYNGu; Sat, 23 Dec 2017 15:48:42 +0100 (CET)
X-Auth-Info: fWjGTK/uunv3jr+ylFuSEd4Gq3inwy063Brfosb2ElXT9JMOoyPUiOgIZBBKc4SZ
Received: from linux.local (p4FE4D439.dip0.t-ipconnect.de [79.228.212.57])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mail.mnet-online.de (Postfix) with ESMTPSA;
 Sat, 23 Dec 2017 15:48:42 +0100 (CET)
Received: by linux.local (Postfix, from userid 501)
 id 6B85D1E580A; Sat, 23 Dec 2017 15:48:38 +0100 (CET)
From: Andreas Schwab <schwab@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
Subject: Re: bug#29478: [Patch 2]: bug#29478: 26.0.90;
 `C-h k' followed by mouse clicks no longer shows down event
References: <1b3879d6-f14e-47b0-970f-baf09598fcfd@default>
 <871skjnpd8.fsf@HIDDEN> <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
 <83o9ni3l3i.fsf@HIDDEN> <20171223142809.GB6618@ACM>
X-Yow: ..  Do you like ``TENDER VITTLES?''?
Date: Sat, 23 Dec 2017 15:48:38 +0100
In-Reply-To: <20171223142809.GB6618@ACM> (Alan Mackenzie's message of "Sat, 23
 Dec 2017 14:28:09 +0000")
Message-ID: <m21sjlijp5.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: -0.5 (/)
X-Debbugs-Envelope-To: 29478
Cc: Eli Zaretskii <eliz@HIDDEN>, 29478 <at> debbugs.gnu.org,
 npostavs@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: -0.5 (/)

On Dez 23 2017, Alan Mackenzie <acm@HIDDEN> wrote:

> @@ -769,6 +773,28 @@ help-read-key-sequence
>          (setq yank-menu (copy-sequence saved-yank-menu))
>          (fset 'yank-menu (cons 'keymap yank-menu))))))
>  
> +(defun help-downify-mouse-event-type (base)
> +  "Add \"down-\" to BASE if it is not already there.
> +BASE is a symbol, a mouse event type.  If the modification is done,
> +return the new symbol.  Otherwise return nil."
> +  (let ((base-s (symbol-name base)))
> +    ;; Note: the order of the components in the following string is
> +    ;; determined by `apply_modifiers_uncached' in src/keyboard.c.
> +    (string-match "\\(A-\\)?\
> +\\(C-\\)?\
> +\\(H-\\)?\
> +\\(M-\\)?\
> +\\(S-\\)?\
> +\\(s-\\)?\
> +\\(double-\\)?\
> +\\(triple-\\)?\
> +\\(up-\\)?\
> +\\(\\(down-\\)?\\)\
> +\\(\\(drag-\\)?\\)" base-s)
> +    (when (and (zerop (length (match-string 10 base-s)))  ; "down-"
> +               (zerop (length (match-string 12 base-s)))) ; "drag-"

A group that didn't match can be detected by match-string (or
match-beginning) returning nil.

Andreas.

-- 
Andreas Schwab, schwab@HIDDEN
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




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

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


Received: (at 29478) by debbugs.gnu.org; 23 Dec 2017 14:30:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 23 09:30:13 2017
Received: from localhost ([127.0.0.1]:48835 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eSkoW-0001yR-Pn
	for submit <at> debbugs.gnu.org; Sat, 23 Dec 2017 09:30:13 -0500
Received: from colin.muc.de ([193.149.48.1]:43541 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1eSkoU-0001xQ-Ol
 for 29478 <at> debbugs.gnu.org; Sat, 23 Dec 2017 09:30:11 -0500
Received: (qmail 89290 invoked by uid 3782); 23 Dec 2017 14:30:07 -0000
Received: from acm.muc.de (p548C7AB5.dip0.t-ipconnect.de [84.140.122.181]) by
 colin.muc.de (tmda-ofmipd) with ESMTP;
 Sat, 23 Dec 2017 15:30:06 +0100
Received: (qmail 21804 invoked by uid 1000); 23 Dec 2017 14:28:09 -0000
Date: Sat, 23 Dec 2017 14:28:09 +0000
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: [Patch 2]: bug#29478: 26.0.90; `C-h k' followed by mouse clicks
 no longer shows down event
Message-ID: <20171223142809.GB6618@ACM>
References: <1b3879d6-f14e-47b0-970f-baf09598fcfd@default>
 <871skjnpd8.fsf@HIDDEN> <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
 <83o9ni3l3i.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <83o9ni3l3i.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: -0.0 (/)
X-Debbugs-Envelope-To: 29478
Cc: 29478 <at> debbugs.gnu.org, Drew Adams <drew.adams@HIDDEN>,
 npostavs@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: -0.0 (/)

Hello, Eli.

On Fri, Dec 01, 2017 at 10:31:45 +0200, Eli Zaretskii wrote:
> > Date: Tue, 28 Nov 2017 20:33:00 -0800 (PST)
> > From: Drew Adams <drew.adams@HIDDEN>
> > Cc: 29478 <at> debbugs.gnu.org

> > > > > The down mouse-button event is no longer listed along with the up
> > > > > event when you use `C-h k' with a click event.  Dunno whether this
> > > > > was by design or is an oversight.

> > > I think if you press and hold the mouse button for (default) half a
> > > second, when you finally release it, C-h k will report the down mouse
> > > event.  At least this is how GPM behaves for me on a Linux tty.

> > Ah yes, thanks.  I see that now on MS Windows too.

> > > This seems to make sense, because anything bound to a down mouse
> > > event is going to be something like a drag event, where the mouse
> > > button is held for an extended period of time.

> > Sorry, no, I don't buy that.  I mean it's probably true that
> > most such bindings involve dragging.  But (1) a user who wants
> > to check what `mouse-N' does won't necessarily use it the same
> > way when checking with `C-h k' as when using it for its real
> > purpose.  And (2) the problem with this is that it is not
> > easily discoverable.

> > I've used Emacs for quite a while.  OK, I expected both up and
> > down to be documented.  But even I would likely never have
> > thought to hold the button pressed for a long time before
> > releasing, just to see what `C-h k' had to tell me.

> Alan, can we arrange for the doc string of mouse-N clicks (with or
> without all the possible modifiers) to say something like

>   For documentation of the corresponding mouse-down event, click and
>   hold the mouse button longer than %s sec.

> (where %s gets replaced by double-click-time)?

Yes, we can indeed.  The following patch is intended to achieve this.
It's based on the emacs-26 branch.  I've also corrected the bug where the
possibility of double-click-time being nil or t wasn't taken into
account.

Should I commit this one to emacs-26, too?



diff --git a/lisp/help.el b/lisp/help.el
index 212e3679da..3f013e8170 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -738,7 +738,11 @@ help-read-key-sequence
                          ;; spuriously trigger the `sit-for'.
                          (sleep-for 0.01)
                          (while (read-event nil nil 0.01))
-                         (not (sit-for (/ double-click-time 1000.0) t))))))))
+                         (not (sit-for
+                               (if (numberp double-click-time)
+                                   (/ double-click-time 1000.0)
+                                 3.0)
+                               t))))))))
           (list
            key
            ;; If KEY is a down-event, read and include the
@@ -769,6 +773,28 @@ help-read-key-sequence
         (setq yank-menu (copy-sequence saved-yank-menu))
         (fset 'yank-menu (cons 'keymap yank-menu))))))
 
+(defun help-downify-mouse-event-type (base)
+  "Add \"down-\" to BASE if it is not already there.
+BASE is a symbol, a mouse event type.  If the modification is done,
+return the new symbol.  Otherwise return nil."
+  (let ((base-s (symbol-name base)))
+    ;; Note: the order of the components in the following string is
+    ;; determined by `apply_modifiers_uncached' in src/keyboard.c.
+    (string-match "\\(A-\\)?\
+\\(C-\\)?\
+\\(H-\\)?\
+\\(M-\\)?\
+\\(S-\\)?\
+\\(s-\\)?\
+\\(double-\\)?\
+\\(triple-\\)?\
+\\(up-\\)?\
+\\(\\(down-\\)?\\)\
+\\(\\(drag-\\)?\\)" base-s)
+    (when (and (zerop (length (match-string 10 base-s)))  ; "down-"
+               (zerop (length (match-string 12 base-s)))) ; "drag-"
+      (intern (replace-match "down-" t t base-s 10)) )))
+
 (defun describe-key (&optional key untranslated up-event)
   "Display documentation of the function invoked by KEY.
 KEY can be any kind of a key sequence; it can include keyboard events,
@@ -828,6 +854,24 @@ describe-key
             (princ (format " (found in %s)" key-locus))))
         (princ ", which is ")
 	(describe-function-1 defn)
+        (when (vectorp key)
+          (let* ((last (1- (length key)))
+                 (elt (aref key last))
+                 (elt-1 (copy-sequence elt))
+                 key-1 down-event-type)
+            (when (and (eventp elt)
+                       (setq down-event-type (help-downify-mouse-event-type
+                                              (car elt))))
+              (setcar elt-1 down-event-type)
+              (setq key-1 (vector elt-1))
+              (when (key-binding key-1)
+                (princ (format "
+
+For documentation of the corresponding mouse down event <%s>,
+click and hold the mouse button longer than %s second(s)."
+                               down-event-type (if (numberp double-click-time)
+                                                   (/ double-click-time 1000.0)
+                                                 3)))))))
 	(when up-event
 	  (unless (or (null defn-up)
 		      (integerp defn-up)


-- 
Alan Mackenzie (Nuremberg, Germany).




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

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


Received: (at 29478) by debbugs.gnu.org; 23 Dec 2017 12:42:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 23 07:42:08 2017
Received: from localhost ([127.0.0.1]:48786 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eSj7w-0007pz-7w
	for submit <at> debbugs.gnu.org; Sat, 23 Dec 2017 07:42:08 -0500
Received: from eggs.gnu.org ([208.118.235.92]:34158)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eSj7u-0007pc-Nc
 for 29478 <at> debbugs.gnu.org; Sat, 23 Dec 2017 07:42:07 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eSj7m-0004Rr-Ce
 for 29478 <at> debbugs.gnu.org; Sat, 23 Dec 2017 07:42: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=-0.0 required=5.0 tests=BAYES_40,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42570)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eSj7W-00044U-Hl; Sat, 23 Dec 2017 07:41:42 -0500
Received: from [176.228.60.248] (port=3750 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 1eSj7V-0008Fb-Lm; Sat, 23 Dec 2017 07:41:42 -0500
Date: Sat, 23 Dec 2017 14:41:42 +0200
Message-Id: <83zi69k455.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
In-reply-to: <20171223111726.GA6618@ACM> (message from Alan Mackenzie on Sat, 
 23 Dec 2017 11:17:26 +0000)
Subject: Re: [Patch] bug#29478: 26.0.90;`C-h k' followed by mouse clicks no
 longer shows down event
References: <1b3879d6-f14e-47b0-970f-baf09598fcfd@default>
 <871skjnpd8.fsf@HIDDEN> <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
 <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
 <20171222220549.GC8072@ACM> <833741lr0t.fsf@HIDDEN>
 <20171223111726.GA6618@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: -5.0 (-----)
X-Debbugs-Envelope-To: 29478
Cc: 29478 <at> debbugs.gnu.org, monnier@HIDDEN,
 npostavs@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>
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 (-----)

> Date: Sat, 23 Dec 2017 11:17:26 +0000
> Cc: Stefan Monnier <monnier@HIDDEN>, 29478 <at> debbugs.gnu.org,
>   npostavs@HIDDEN
> From: Alan Mackenzie <acm@HIDDEN>
> 
> Of course!  read-key-sequence consumes all the events up to the
> S-down-mouse-1, leaving the following S-mouse-1 in the event buffer.
> This is read at the next iteration of the command loop.
> 
> > CC'ing Stefan in the hope that he could have some insights.
> 
> OK, I have a provisional fix.  The problem was that the double-click-time
> loop in help-read-key-sequence was discarding all events but the last
> one.  I have amended the loop so that _all_ these events are stored in a
> list, and we then discard the most recent events till we find one with a
> binding.
> 
> This patch seems to work with GPM in a Linux tty, and also in X-Windows
> (I think).  (It is based on the emacs-26 branch, of course.)

LGTM, thanks.  The problem I reported is gone with this patch.




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

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


Received: (at 29478) by debbugs.gnu.org; 23 Dec 2017 11:19:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 23 06:19:32 2017
Received: from localhost ([127.0.0.1]:48737 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eShpz-0003uo-QL
	for submit <at> debbugs.gnu.org; Sat, 23 Dec 2017 06:19:32 -0500
Received: from colin.muc.de ([193.149.48.1]:20704 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1eShpy-0003uf-0d
 for 29478 <at> debbugs.gnu.org; Sat, 23 Dec 2017 06:19:30 -0500
Received: (qmail 10883 invoked by uid 3782); 23 Dec 2017 11:19:28 -0000
Received: from acm.muc.de (p548C7AB5.dip0.t-ipconnect.de [84.140.122.181]) by
 colin.muc.de (tmda-ofmipd) with ESMTP;
 Sat, 23 Dec 2017 12:19:23 +0100
Received: (qmail 6689 invoked by uid 1000); 23 Dec 2017 11:17:26 -0000
Date: Sat, 23 Dec 2017 11:17:26 +0000
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: [Patch] bug#29478: 26.0.90;`C-h k' followed by mouse clicks no
 longer shows down event
Message-ID: <20171223111726.GA6618@ACM>
References: <1b3879d6-f14e-47b0-970f-baf09598fcfd@default>
 <871skjnpd8.fsf@HIDDEN> <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
 <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
 <20171222220549.GC8072@ACM> <833741lr0t.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <833741lr0t.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: -0.0 (/)
X-Debbugs-Envelope-To: 29478
Cc: 29478 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>,
 npostavs@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: -0.0 (/)

Hello, Eli.

On Sat, Dec 23, 2017 at 11:42:10 +0200, Eli Zaretskii wrote:
> > Date: Fri, 22 Dec 2017 22:05:49 +0000
> > Cc: drew.adams@HIDDEN, 29478 <at> debbugs.gnu.org,
> >   npostavs@HIDDEN
> > From: Alan Mackenzie <acm@HIDDEN>

> > (i) emacs-26 -Q
> > (ii) M-: (read-key-sequence "prompt: ") <CR>
> > (iii) <shift>-mouse-1

> > What happens now is the key sequence is displayed, a S-down-mouse-1
> > event, but immediately overwritten in the message area by 

> >     <S-mouse-1> is undefined

> > .  Why?  I merely asked for the key sequence.  I didn't ask for it to be
> > looked up in any key maps.  What is doing the translation from a
> > shift-down-mouse event to a S-click event?  What is looking up this
> > down-mouse event in a key map?

> read-key-sequence itself examines the possible remapping of the
> sequence.  And it seems reasonable, since how can it otherwise know
> when the sequence is complete?

> What is perhaps unexpected here (or might be a bug) is that for some
> reason the sequence is left in unread-command-events (or somewhere
> similar, perhaps in read_key_sequence_remapped?), because if I set a
> breakpoint in Fding, the backtrace from the "is undefined" message
> clearly shows it was the command loop that invoked 'undefined':

[ .... ]

Of course!  read-key-sequence consumes all the events up to the
S-down-mouse-1, leaving the following S-mouse-1 in the event buffer.
This is read at the next iteration of the command loop.

> CC'ing Stefan in the hope that he could have some insights.

OK, I have a provisional fix.  The problem was that the double-click-time
loop in help-read-key-sequence was discarding all events but the last
one.  I have amended the loop so that _all_ these events are stored in a
list, and we then discard the most recent events till we find one with a
binding.

This patch seems to work with GPM in a Linux tty, and also in X-Windows
(I think).  (It is based on the emacs-26 branch, of course.)



diff --git a/lisp/help.el b/lisp/help.el
index 212e3679da..dd1676adb0 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 down-ev)
+        (let (key keys down-ev discarded-up)
           ;; If yank-menu is empty, populate it temporarily, so that
           ;; "Select and Paste" menu can generate a complete event.
           (when (null (cdr yank-menu))
@@ -731,6 +731,7 @@ help-read-key-sequence
                  (or
                   (and no-mouse-movement
                        (string-match "mouse-movement" keyname))
+                  (progn (push key keys) nil)
                   (and (string-match "\\(mouse\\|down\\|click\\|drag\\)"
                                      keyname)
                        (progn
@@ -739,13 +740,31 @@ help-read-key-sequence
                          (sleep-for 0.01)
                          (while (read-event nil nil 0.01))
                          (not (sit-for (/ double-click-time 1000.0) t))))))))
+          ;; When we have a sequence of mouse events, discard the most
+          ;; recent ones till we find one with a binding.
+          (let ((keys-1 keys))
+            (while (and keys-1
+                        (not (key-binding (car keys-1))))
+              ;; If we discard the last event, and this was a mouse
+              ;; up, remember this.
+              (if (and (eq keys-1 keys)
+                       (vectorp (car keys-1))
+                       (let* ((last-idx (1- (length (car keys-1))))
+                              (last (aref (car keys-1) last-idx)))
+                         (and (eventp last)
+                              (memq 'click (event-modifiers last)))))
+                  (setq discarded-up t))
+              (setq keys-1 (cdr keys-1)))
+            (if keys-1
+                (setq key (car keys-1))))
           (list
            key
            ;; If KEY is a down-event, read and include the
            ;; corresponding up-event.  Note that there are also
            ;; down-events on scroll bars and mode lines: the actual
            ;; event then is in the second element of the vector.
-           (and (vectorp key)
+           (and (not discarded-up) ; Don't attempt to ignore the up-event twice.
+                (vectorp key)
                 (let ((last-idx (1- (length key))))
                   (and (eventp (aref key last-idx))
                        (memq 'down (event-modifiers (aref key last-idx)))))


-- 
Alan Mackenzie (Nuremberg, Germany).




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

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


Received: (at 29478) by debbugs.gnu.org; 23 Dec 2017 09:42:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 23 04:42:36 2017
Received: from localhost ([127.0.0.1]:48713 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eSgKC-0001iD-Cu
	for submit <at> debbugs.gnu.org; Sat, 23 Dec 2017 04:42:36 -0500
Received: from eggs.gnu.org ([208.118.235.92]:57177)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eSgKB-0001i2-2T
 for 29478 <at> debbugs.gnu.org; Sat, 23 Dec 2017 04:42:35 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eSgK1-000276-SJ
 for 29478 <at> debbugs.gnu.org; Sat, 23 Dec 2017 04:42:29 -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.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41174)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eSgJm-0001xQ-Ar; Sat, 23 Dec 2017 04:42:10 -0500
Received: from [176.228.60.248] (port=3634 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 1eSgJl-0004Yp-QP; Sat, 23 Dec 2017 04:42:10 -0500
Date: Sat, 23 Dec 2017 11:42:10 +0200
Message-Id: <833741lr0t.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>, Stefan Monnier <monnier@HIDDEN>
In-reply-to: <20171222220549.GC8072@ACM> (message from Alan Mackenzie on Fri, 
 22 Dec 2017 22:05:49 +0000)
Subject: Re: bug#29478: 26.0.90;`C-h k' followed by mouse clicks no longer
 shows down event
References: <1b3879d6-f14e-47b0-970f-baf09598fcfd@default>
 <871skjnpd8.fsf@HIDDEN> <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
 <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
 <20171222220549.GC8072@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: -5.0 (-----)
X-Debbugs-Envelope-To: 29478
Cc: 29478 <at> debbugs.gnu.org, npostavs@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>
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 (-----)

> Date: Fri, 22 Dec 2017 22:05:49 +0000
> Cc: drew.adams@HIDDEN, 29478 <at> debbugs.gnu.org,
>   npostavs@HIDDEN
> From: Alan Mackenzie <acm@HIDDEN>
> 
> (i) emacs-26 -Q
> (ii) M-: (read-key-sequence "prompt: ") <CR>
> (iii) <shift>-mouse-1
> 
> What happens now is the key sequence is displayed, a S-down-mouse-1
> event, but immediately overwritten in the message area by 
> 
>     <S-mouse-1> is undefined
> 
> .  Why?  I merely asked for the key sequence.  I didn't ask for it to be
> looked up in any key maps.  What is doing the translation from a
> shift-down-mouse event to a S-click event?  What is looking up this
> down-mouse event in a key map?

read-key-sequence itself examines the possible remapping of the
sequence.  And it seems reasonable, since how can it otherwise know
when the sequence is complete?

What is perhaps unexpected here (or might be a bug) is that for some
reason the sequence is left in unread-command-events (or somewhere
similar, perhaps in read_key_sequence_remapped?), because if I set a
breakpoint in Fding, the backtrace from the "is undefined" message
clearly shows it was the command loop that invoked 'undefined':

  Thread 1 hit Breakpoint 3, Fding (arg=XIL(0)) at dispnew.c:5666
  5666      if (!NILP (arg))
  (gdb) bt
  #0  Fding (arg=XIL(0)) at dispnew.c:5666
  #1  0x012269c1 in funcall_subr (subr=0x1383100 <Sding>, numargs=0,
      args=0x82f2e0) at eval.c:2841
  #2  0x01226412 in Ffuncall (nargs=1, args=0x82f2d8) at eval.c:2766
  #3  0x0128cef7 in exec_byte_code (bytestr=XIL(0x8000000001397478),
      vector=XIL(0xa000000001397488), maxdepth=make_number(4),
      args_template=make_number(0), nargs=0, args=0x82f750) at bytecode.c:62
  #4  0x01227510 in funcall_lambda (fun=XIL(0xa000000001397440), nargs=0,
      arg_vector=0x40000000) at eval.c:2967
  #5  0x0122646c in Ffuncall (nargs=1, args=0x82f748) at eval.c:2768
  #6  0x01225913 in call0 (fn=XIL(0xfca8)) at eval.c:2609
  #7  0x0114fd0d in command_loop_1 () at keyboard.c:1457
  #8  0x01220de9 in internal_condition_case (bfun=0x114f33f <command_loop_1>
      handlers=XIL(0x5b70), hfun=0x114e5bf <cmd_error>) at eval.c:1332
  #9  0x0114edd3 in command_loop_2 (ignore=XIL(0)) at keyboard.c:1110
  #10 0x0121ff1b in internal_catch (tag=XIL(0xf570),
      func=0x114ed97 <command_loop_2>, arg=XIL(0)) at eval.c:1097
  #11 0x0114ed52 in command_loop () at keyboard.c:1089
  #12 0x0114dfe7 in recursive_edit_1 () at keyboard.c:695
  #13 0x0114e289 in Frecursive_edit () at keyboard.c:766
  #14 0x0114b990 in main (argc=2, argv=0xa428d8) at emacs.c:1713

  Lisp Backtrace:
  "ding" (0x82f2e0)
  "undefined" (0x82f750)

CC'ing Stefan in the hope that he could have some insights.




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

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


Received: (at 29478) by debbugs.gnu.org; 22 Dec 2017 22:07:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 22 17:07:45 2017
Received: from localhost ([127.0.0.1]:48397 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eSVTl-0001YW-Bm
	for submit <at> debbugs.gnu.org; Fri, 22 Dec 2017 17:07:45 -0500
Received: from colin.muc.de ([193.149.48.1]:23991 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1eSVTi-0001YN-U4
 for 29478 <at> debbugs.gnu.org; Fri, 22 Dec 2017 17:07:43 -0500
Received: (qmail 43758 invoked by uid 3782); 22 Dec 2017 22:07:41 -0000
Received: from acm.muc.de (p548C743A.dip0.t-ipconnect.de [84.140.116.58]) by
 colin.muc.de (tmda-ofmipd) with ESMTP;
 Fri, 22 Dec 2017 23:07:40 +0100
Received: (qmail 25050 invoked by uid 1000); 22 Dec 2017 22:05:49 -0000
Date: Fri, 22 Dec 2017 22:05:49 +0000
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#29478: 26.0.90;`C-h k' followed by mouse clicks no longer
 shows down event
Message-ID: <20171222220549.GC8072@ACM>
References: <1b3879d6-f14e-47b0-970f-baf09598fcfd@default>
 <871skjnpd8.fsf@HIDDEN> <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
 <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <83tvwzubez.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: -0.0 (/)
X-Debbugs-Envelope-To: 29478
Cc: 29478 <at> debbugs.gnu.org, drew.adams@HIDDEN,
 npostavs@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: -0.0 (/)

Hello, Eli.

On Sat, Dec 09, 2017 at 18:13:40 +0200, Eli Zaretskii wrote:
> I think I found one more problem with Help functions on mouse clicks.
> Try this in "emacs -Q":

>   C-h c S-mouse-1
>   C-h k S-mouse-1

> In Emacs 25.2 these produce the description of mouse-appearance-menu,
> as expected, saying it's the binding of S-down-mouse-1.  Emacs
> 26.0.90 does the same for "C-h c", but claims S-mouse-1 is undefined
> if you invoke "C-h k".  The current emacs-26 branch claims S-mouse-1
> is undefined for both "C-h c" and "C-h k".

> I think this means that we have similar problems with any explicit
> bindings to S-down-mouse-N clicks.

> This is a regression that I think we must fix before releasing Emacs
> 26.1.

OK, I'm looking at this now.  It's not as easy as I was hoping.

One phenomenon is puzzling me - it feels like a bug:

(i) emacs-26 -Q
(ii) M-: (read-key-sequence "prompt: ") <CR>
(iii) <shift>-mouse-1

What happens now is the key sequence is displayed, a S-down-mouse-1
event, but immediately overwritten in the message area by 

    <S-mouse-1> is undefined

.  Why?  I merely asked for the key sequence.  I didn't ask for it to be
looked up in any key maps.  What is doing the translation from a
shift-down-mouse event to a S-click event?  What is looking up this
down-mouse event in a key map?

-- 
Alan Mackenzie (Nuremberg, Germany).




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

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


Received: (at 29478) by debbugs.gnu.org; 9 Dec 2017 17:30:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 09 12:30:22 2017
Received: from localhost ([127.0.0.1]:54062 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eNixC-0005Lz-Lw
	for submit <at> debbugs.gnu.org; Sat, 09 Dec 2017 12:30:22 -0500
Received: from colin.muc.de ([193.149.48.1]:33443 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1eNixB-0005Lr-EX
 for 29478 <at> debbugs.gnu.org; Sat, 09 Dec 2017 12:30:21 -0500
Received: (qmail 38255 invoked by uid 3782); 9 Dec 2017 17:30:20 -0000
Received: from acm.muc.de (p548C7E8D.dip0.t-ipconnect.de [84.140.126.141]) by
 colin.muc.de (tmda-ofmipd) with ESMTP;
 Sat, 09 Dec 2017 18:30:19 +0100
Received: (qmail 15768 invoked by uid 1000); 9 Dec 2017 17:23:14 -0000
Date: Sat, 9 Dec 2017 17:23:14 +0000
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#29478: 26.0.90;`C-h k' followed by mouse clicks no longer
 shows down event
Message-ID: <20171209172314.GB15719@ACM>
References: <1b3879d6-f14e-47b0-970f-baf09598fcfd@default>
 <871skjnpd8.fsf@HIDDEN> <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
 <83o9ni3l3i.fsf@HIDDEN>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
 <83bmji2xye.fsf@HIDDEN> <83tvwzubez.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <83tvwzubez.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: -0.0 (/)
X-Debbugs-Envelope-To: 29478
Cc: 29478 <at> debbugs.gnu.org, drew.adams@HIDDEN,
 npostavs@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: -0.0 (/)

Hello, Eli.

On Sat, Dec 09, 2017 at 18:13:40 +0200, Eli Zaretskii wrote:
> I think I found one more problem with Help functions on mouse clicks.
> Try this in "emacs -Q":

>   C-h c S-mouse-1
>   C-h k S-mouse-1

> In Emacs 25.2 these produce the description of mouse-appearance-menu,
> as expected, saying it's the binding of S-down-mouse-1.  Emacs
> 26.0.90 does the same for "C-h c", but claims S-mouse-1 is undefined
> if you invoke "C-h k".  The current emacs-26 branch claims S-mouse-1
> is undefined for both "C-h c" and "C-h k".

> I think this means that we have similar problems with any explicit
> bindings to S-down-mouse-N clicks.

> This is a regression that I think we must fix before releasing Emacs
> 26.1.

Yes.  I'm sorry I've had next to no time for Emacs this last week.  That
should change on Monday.  Then I'll have a look at this bug.

-- 
Alan Mackenzie (Nuremberg, Germany).




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

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


Received: (at 29478) by debbugs.gnu.org; 9 Dec 2017 17:25:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 09 12:25:29 2017
Received: from localhost ([127.0.0.1]:54053 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eNisT-0005DS-GM
	for submit <at> debbugs.gnu.org; Sat, 09 Dec 2017 12:25:29 -0500
Received: from colin.muc.de ([193.149.48.1]:29929 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1eNisR-0005DK-CZ
 for 29478 <at> debbugs.gnu.org; Sat, 09 Dec 2017 12:25:27 -0500
Received: (qmail 36542 invoked by uid 3782); 9 Dec 2017 17:25:23 -0000
Received: from acm.muc.de (p548C7E8D.dip0.t-ipconnect.de [84.140.126.141]) by
 colin.muc.de (tmda-ofmipd) with ESMTP;
 Sat, 09 Dec 2017 18:25:21 +0100
Received: (qmail 15730 invoked by uid 1000); 9 Dec 2017 17:18:16 -0000
Date: Sat, 9 Dec 2017 17:18:16 +0000
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#29478: 26.0.90; `C-h k' followed by mouse clicks no longer
 shows down event
Message-ID: <20171209171816.GA15719@ACM>
References: <1b3879d6-f14e-47b0-970f-baf09598fcfd@default>
 <871skjnpd8.fsf@HIDDEN> <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
 <83o9ni3l3i.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <83o9ni3l3i.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: -0.0 (/)
X-Debbugs-Envelope-To: 29478
Cc: 29478 <at> debbugs.gnu.org, Drew Adams <drew.adams@HIDDEN>,
 npostavs@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: -0.0 (/)

Hello, Eli.

On Fri, Dec 01, 2017 at 10:31:45 +0200, Eli Zaretskii wrote:
> > Date: Tue, 28 Nov 2017 20:33:00 -0800 (PST)
> > From: Drew Adams <drew.adams@HIDDEN>
> > Cc: 29478 <at> debbugs.gnu.org

> > > > > The down mouse-button event is no longer listed along with the up
> > > > > event when you use `C-h k' with a click event.  Dunno whether this
> > > was
> > > > > by design or is an oversight.

> > > I think if you press and hold the mouse button for (default) half a
> > > second, when you finally release it, C-h k will report the down mouse
> > > event.  At least this is how GPM behaves for me on a Linux tty.

> > Ah yes, thanks.  I see that now on MS Windows too.

> > > This seems to make sense, because anything bound to a down mouse
> > > event is going to be something like a drag event, where the mouse
> > > button is held for an extended period of time.

> > Sorry, no, I don't buy that.  I mean it's probably true that
> > most such bindings involve dragging.  But (1) a user who wants
> > to check what `mouse-N' does won't necessarily use it the same
> > way when checking with `C-h k' as when using it for its real
> > purpose.  And (2) the problem with this is that it is not
> > easily discoverable.

> > I've used Emacs for quite a while.  OK, I expected both up and
> > down to be documented.  But even I would likely never have
> > thought to hold the button pressed for a long time before
> > releasing, just to see what `C-h k' had to tell me.

> Alan, can we arrange for the doc string of mouse-N clicks (with or
> without all the possible modifiers) to say something like

>   For documentation of the corresponding mouse-down event, click and
>   hold the mouse button longer than %s sec.

> (where %s gets replaced by double-click-time)?

Yes, I'm sure I can manage that, hopefully in the coming week.

-- 
Alan Mackenzie (Nuremberg, Germany).




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

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


Received: (at 29478) by debbugs.gnu.org; 9 Dec 2017 16:14:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 09 11:14:35 2017
Received: from localhost ([127.0.0.1]:54026 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eNhlr-0003bZ-9J
	for submit <at> debbugs.gnu.org; Sat, 09 Dec 2017 11:14:35 -0500
Received: from eggs.gnu.org ([208.118.235.92]:45335)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eNhlp-0003bM-KL
 for 29478 <at> debbugs.gnu.org; Sat, 09 Dec 2017 11:14:33 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eNhlg-0001rx-BD
 for 29478 <at> debbugs.gnu.org; Sat, 09 Dec 2017 11:14:28 -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,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34140)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eNhlQ-0001hN-FD; Sat, 09 Dec 2017 11:14:08 -0500
Received: from [176.228.60.248] (port=1335 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 1eNhlO-0000cN-Hj; Sat, 09 Dec 2017 11:14:08 -0500
Date: Sat, 09 Dec 2017 18:13:40 +0200
Message-Id: <83tvwzubez.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: acm@HIDDEN
In-reply-to: <83bmji2xye.fsf@HIDDEN> (message from Eli Zaretskii on Fri, 01
 Dec 2017 18:51:37 +0200)
Subject: Re: bug#29478: 26.0.90;
 `C-h k' followed by mouse clicks no longer shows down event
References: <<1b3879d6-f14e-47b0-970f-baf09598fcfd@default>
 <871skjnpd8.fsf@HIDDEN>> <<20171128221036.GC14868@ACM>>
 <<bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>> <<83o9ni3l3i.fsf@HIDDEN>>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default> <83bmji2xye.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: 29478
Cc: 29478 <at> debbugs.gnu.org, drew.adams@HIDDEN,
 npostavs@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>
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 (-----)

I think I found one more problem with Help functions on mouse clicks.
Try this in "emacs -Q":

  C-h c S-mouse-1
  C-h k S-mouse-1

In Emacs 25.2 these produce the description of mouse-appearance-menu,
as expected, saying it's the binding of S-down-mouse-1.  Emacs
26.0.90 does the same for "C-h c", but claims S-mouse-1 is undefined
if you invoke "C-h k".  The current emacs-26 branch claims S-mouse-1
is undefined for both "C-h c" and "C-h k".

I think this means that we have similar problems with any explicit
bindings to S-down-mouse-N clicks.

This is a regression that I think we must fix before releasing Emacs
26.1.




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

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


Received: (at 29478) by debbugs.gnu.org; 1 Dec 2017 16:52:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 01 11:52:11 2017
Received: from localhost ([127.0.0.1]:40310 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eKoXr-0003N0-1j
	for submit <at> debbugs.gnu.org; Fri, 01 Dec 2017 11:52:11 -0500
Received: from eggs.gnu.org ([208.118.235.92]:52184)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eKoXp-0003Mn-69
 for 29478 <at> debbugs.gnu.org; Fri, 01 Dec 2017 11:52:09 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eKoXg-0002TK-3J
 for 29478 <at> debbugs.gnu.org; Fri, 01 Dec 2017 11:52:04 -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.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57962)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eKoXf-0002TG-Vu; Fri, 01 Dec 2017 11:52:00 -0500
Received: from [176.228.60.248] (port=3051 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 1eKoXf-0004qn-4L; Fri, 01 Dec 2017 11:51:59 -0500
Date: Fri, 01 Dec 2017 18:51:37 +0200
Message-Id: <83bmji2xye.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
In-reply-to: <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default> (message from Drew
 Adams on Fri, 1 Dec 2017 07:35:08 -0800 (PST))
Subject: Re: bug#29478: 26.0.90;	`C-h k' followed by mouse clicks no longer
 shows down event
References: <<1b3879d6-f14e-47b0-970f-baf09598fcfd@default>
 <871skjnpd8.fsf@HIDDEN>> <<20171128221036.GC14868@ACM>>
 <<bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>> <<83o9ni3l3i.fsf@HIDDEN>>
 <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
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: 29478
Cc: acm@HIDDEN, 29478 <at> debbugs.gnu.org, npostavs@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>
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 (-----)

> Date: Fri, 1 Dec 2017 07:35:08 -0800 (PST)
> From: Drew Adams <drew.adams@HIDDEN>
> Cc: acm@HIDDEN, npostavs@HIDDEN, 29478 <at> debbugs.gnu.org
> 
> > > I would likely never have
> > > thought to hold the button pressed for a long time before
> > > releasing, just to see what `C-h k' had to tell me.
> > 
> > Alan, can we arrange for the doc string of mouse-N clicks (with or
> > without all the possible modifiers) to say something like
> > 
> >   For documentation of the corresponding mouse-down event,
> >   click and hold the mouse button longer than %s sec.
> > 
> > (where %s gets replaced by double-click-time)?
> 
> That's a hack/workaround

The previous way, where down-event was described before the up-event,
was also a hack.  The fundamental problem here is that Emacs doesn't
know what the user wants/needs, and the semi-kludgey way we intuit
that when processing mouse gestures is part of the reason.

> If that's at the end of the doc for the up event
> then I suspect some users looking for info about
> the down event might never notice it.

Well, at least they will now see the documentation of mouse-1, not
down-mouse-1, first.  And in "C-h c", we were previously showing
_only_ down-mouse-1, something that made me mad for years, because in
90% of cases you want to know about mouse-1.  So this is some
progress, even in this area (although it was not the main drive for
the change).

> Previously we had two headings for the two events.

For "C-h k", yes (and a user who wasn't expecting to see 2 doc strings
could easily miss the second one).  For "C-h c", no: we only was
showing the binding for the down-event.




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

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


Received: (at 29478) by debbugs.gnu.org; 1 Dec 2017 15:35:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 01 10:35:22 2017
Received: from localhost ([127.0.0.1]:40142 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eKnLW-0001OC-Ch
	for submit <at> debbugs.gnu.org; Fri, 01 Dec 2017 10:35:22 -0500
Received: from aserp1040.oracle.com ([141.146.126.69]:44821)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1eKnLU-0001Nx-Ip
 for 29478 <at> debbugs.gnu.org; Fri, 01 Dec 2017 10:35:21 -0500
Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71])
 by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id
 vB1FZCFc007941
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Fri, 1 Dec 2017 15:35:12 GMT
Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72])
 by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id vB1FZB2D021296
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Fri, 1 Dec 2017 15:35:12 GMT
Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16])
 by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id vB1FZANK029714;
 Fri, 1 Dec 2017 15:35:11 GMT
MIME-Version: 1.0
Message-ID: <fbb17da4-a4cf-4088-894d-5d2516fa4ba4@default>
Date: Fri, 1 Dec 2017 07:35:08 -0800 (PST)
From: Drew Adams <drew.adams@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>, Drew Adams <drew.adams@HIDDEN>
Subject: RE: bug#29478: 26.0.90;	`C-h k' followed by mouse clicks no longer
 shows down event
References: <<1b3879d6-f14e-47b0-970f-baf09598fcfd@default>
 <871skjnpd8.fsf@HIDDEN>> <<20171128221036.GC14868@ACM>>
 <<bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>> <<83o9ni3l3i.fsf@HIDDEN>>
In-Reply-To: <<83o9ni3l3i.fsf@HIDDEN>>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1  (1003210) [OL
 16.0.4615.0 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Source-IP: userv0021.oracle.com [156.151.31.71]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 29478
Cc: acm@HIDDEN, 29478 <at> debbugs.gnu.org, npostavs@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 (--)

> > I would likely never have
> > thought to hold the button pressed for a long time before
> > releasing, just to see what `C-h k' had to tell me.
>=20
> Alan, can we arrange for the doc string of mouse-N clicks (with or
> without all the possible modifiers) to say something like
>=20
>   For documentation of the corresponding mouse-down event,
>   click and hold the mouse button longer than %s sec.
>=20
> (where %s gets replaced by double-click-time)?

That's a hack/workaround, but yes, if we can't do better
then that would definitely help.

If that's at the end of the doc for the up event
then I suspect some users looking for info about
the down event might never notice it.

It should perhaps be made very prominent - ideally
just as prominent as before.  Previously we had two
headings for the two events.  That prominent, whether
done using headings or some other way - that would be
my suggestion.




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

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


Received: (at 29478) by debbugs.gnu.org; 1 Dec 2017 08:32:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 01 03:32:22 2017
Received: from localhost ([127.0.0.1]:38946 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eKgk6-0004Av-Oe
	for submit <at> debbugs.gnu.org; Fri, 01 Dec 2017 03:32:20 -0500
Received: from eggs.gnu.org ([208.118.235.92]:46139)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eKgk3-0004Ah-Db
 for 29478 <at> debbugs.gnu.org; Fri, 01 Dec 2017 03:32:16 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eKgjt-0005wB-RW
 for 29478 <at> debbugs.gnu.org; Fri, 01 Dec 2017 03:32:10 -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.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40187)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eKgjt-0005w6-NU; Fri, 01 Dec 2017 03:32:05 -0500
Received: from [176.228.60.248] (port=1812 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 1eKgjs-0000sR-Vn; Fri, 01 Dec 2017 03:32:05 -0500
Date: Fri, 01 Dec 2017 10:31:45 +0200
Message-Id: <83o9ni3l3i.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
In-reply-to: <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default> (message from Drew
 Adams on Tue, 28 Nov 2017 20:33:00 -0800 (PST))
Subject: Re: bug#29478: 26.0.90;
 `C-h k' followed by mouse clicks no longer shows down event
References: <1b3879d6-f14e-47b0-970f-baf09598fcfd@default>
 <871skjnpd8.fsf@HIDDEN> <20171128221036.GC14868@ACM>
 <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
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: 29478
Cc: acm@HIDDEN, 29478 <at> debbugs.gnu.org, npostavs@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>
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 (-----)

> Date: Tue, 28 Nov 2017 20:33:00 -0800 (PST)
> From: Drew Adams <drew.adams@HIDDEN>
> Cc: 29478 <at> debbugs.gnu.org
> 
> > > > The down mouse-button event is no longer listed along with the up
> > > > event when you use `C-h k' with a click event.  Dunno whether this
> > was
> > > > by design or is an oversight.
> > 
> > I think if you press and hold the mouse button for (default) half a
> > second, when you finally release it, C-h k will report the down mouse
> > event.  At least this is how GPM behaves for me on a Linux tty.
> 
> Ah yes, thanks.  I see that now on MS Windows too.
> 
> > This seems to make sense, because anything bound to a down mouse
> > event is going to be something like a drag event, where the mouse
> > button is held for an extended period of time.
> 
> Sorry, no, I don't buy that.  I mean it's probably true that
> most such bindings involve dragging.  But (1) a user who wants
> to check what `mouse-N' does won't necessarily use it the same
> way when checking with `C-h k' as when using it for its real
> purpose.  And (2) the problem with this is that it is not
> easily discoverable.
> 
> I've used Emacs for quite a while.  OK, I expected both up and
> down to be documented.  But even I would likely never have
> thought to hold the button pressed for a long time before
> releasing, just to see what `C-h k' had to tell me.

Alan, can we arrange for the doc string of mouse-N clicks (with or
without all the possible modifiers) to say something like

  For documentation of the corresponding mouse-down event, click and
  hold the mouse button longer than %s sec.

(where %s gets replaced by double-click-time)?




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

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


Received: (at 29478) by debbugs.gnu.org; 29 Nov 2017 04:33:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 28 23:33:14 2017
Received: from localhost ([127.0.0.1]:35535 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eJu3e-0008Uf-KO
	for submit <at> debbugs.gnu.org; Tue, 28 Nov 2017 23:33:14 -0500
Received: from userp1040.oracle.com ([156.151.31.81]:30045)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1eJu3b-0008US-WE
 for 29478 <at> debbugs.gnu.org; Tue, 28 Nov 2017 23:33:13 -0500
Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74])
 by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id
 vAT4X3oR019723
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Wed, 29 Nov 2017 04:33:03 GMT
Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236])
 by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id vAT4X2ra023170
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Wed, 29 Nov 2017 04:33:02 GMT
Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25])
 by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id vAT4X1Hq015826;
 Wed, 29 Nov 2017 04:33:01 GMT
MIME-Version: 1.0
Message-ID: <bbcb1d00-a728-4b5e-b65f-bd2b168c4a51@default>
Date: Tue, 28 Nov 2017 20:33:00 -0800 (PST)
From: Drew Adams <drew.adams@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>, Noam Postavsky
 <npostavs@HIDDEN>
Subject: RE: bug#29478: 26.0.90; `C-h k' followed by mouse clicks no longer
 shows down event
References: <1b3879d6-f14e-47b0-970f-baf09598fcfd@default>
 <871skjnpd8.fsf@HIDDEN> <20171128221036.GC14868@ACM>
In-Reply-To: <20171128221036.GC14868@ACM>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1  (1003210) [OL
 16.0.4615.0 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Source-IP: userv0022.oracle.com [156.151.31.74]
X-Spam-Score: -2.4 (--)
X-Debbugs-Envelope-To: 29478
Cc: 29478 <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.4 (--)

> > > The down mouse-button event is no longer listed along with the up
> > > event when you use `C-h k' with a click event.  Dunno whether this
> was
> > > by design or is an oversight.
>=20
> I think if you press and hold the mouse button for (default) half a
> second, when you finally release it, C-h k will report the down mouse
> event.  At least this is how GPM behaves for me on a Linux tty.

Ah yes, thanks.  I see that now on MS Windows too.

> This seems to make sense, because anything bound to a down mouse
> event is going to be something like a drag event, where the mouse
> button is held for an extended period of time.

Sorry, no, I don't buy that.  I mean it's probably true that
most such bindings involve dragging.  But (1) a user who wants
to check what `mouse-N' does won't necessarily use it the same
way when checking with `C-h k' as when using it for its real
purpose.  And (2) the problem with this is that it is not
easily discoverable.

I've used Emacs for quite a while.  OK, I expected both up and
down to be documented.  But even I would likely never have
thought to hold the button pressed for a long time before
releasing, just to see what `C-h k' had to tell me.

If there is no other solution, then I suppose we could live
with this.  But in that case it should be called out in NEWS,
I think.  And if there is a possibility of restoring the
longstanding behavior then I think we should first try for that.

> > Looks like oversight.  Possibly related to Bug#29272.  The following
> > seems to fix it for me, but I'm having trouble convincing myself that
> > it's the right thing...
>=20
> > Alan, I believe you've been working on this code recently, any
> thoughts?
>=20
> That I'm redoing some of the underlying C code after a suboptimal patch
> some days ago, and this seems to have some effect on the mouse events
> reported for C-h c and C-h k.
>=20
> Eli has already reported that the proposed negation of that condition
> would break the patch and lead to annoying infinite loops with mouse
> events.
>=20
> I think this code still may have some way to go before reaching its
> final state.

Thanks for still taking a look and trying to work this out.




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

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


Received: (at 29478) by debbugs.gnu.org; 29 Nov 2017 03:37:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 28 22:37:17 2017
Received: from localhost ([127.0.0.1]:35520 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eJtBU-000799-QD
	for submit <at> debbugs.gnu.org; Tue, 28 Nov 2017 22:37:16 -0500
Received: from eggs.gnu.org ([208.118.235.92]:33321)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eJtBT-00078x-D3
 for 29478 <at> debbugs.gnu.org; Tue, 28 Nov 2017 22:37:15 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eJtBJ-00028Y-BO
 for 29478 <at> debbugs.gnu.org; Tue, 28 Nov 2017 22:37:10 -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,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59843)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eJtBJ-00028Q-8D; Tue, 28 Nov 2017 22:37:05 -0500
Received: from [176.228.60.248] (port=3622 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 1eJtBI-0000TV-8Q; Tue, 28 Nov 2017 22:37:05 -0500
Date: Wed, 29 Nov 2017 05:36:56 +0200
Message-Id: <83indt4uxz.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Noam Postavsky <npostavs@HIDDEN>
In-reply-to: <87lgipncby.fsf@HIDDEN> (message from Noam
 Postavsky on Tue, 28 Nov 2017 19:44:01 -0500)
Subject: Re: bug#29478: 26.0.90;
 `C-h k' followed by mouse clicks no longer shows down event
References: <1b3879d6-f14e-47b0-970f-baf09598fcfd@default>
 <871skjnpd8.fsf@HIDDEN> <20171128221036.GC14868@ACM>
 <87lgipncby.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: 29478
Cc: acm@HIDDEN, 29478 <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: Noam Postavsky <npostavs@HIDDEN>
> Date: Tue, 28 Nov 2017 19:44:01 -0500
> Cc: 29478 <at> debbugs.gnu.org
> 
> > Eli has already reported that the proposed negation of that condition
> > would break the patch and lead to annoying infinite loops with mouse
> > events.
> 
> Oh, hmm.  I was testing in a lucid build where your fix for that doesn't
> quite seem to work

That's bad (and strange).  What exactly happens on Lucid when you try
that recipe?




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

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


Received: (at 29478) by debbugs.gnu.org; 29 Nov 2017 00:44:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 28 19:44:11 2017
Received: from localhost ([127.0.0.1]:35345 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eJqTz-0001il-DD
	for submit <at> debbugs.gnu.org; Tue, 28 Nov 2017 19:44:11 -0500
Received: from mail-it0-f52.google.com ([209.85.214.52]:44335)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <npostavs@HIDDEN>) id 1eJqTw-0001iX-QJ
 for 29478 <at> debbugs.gnu.org; Tue, 28 Nov 2017 19:44:10 -0500
Received: by mail-it0-f52.google.com with SMTP id b5so2030565itc.3
 for <29478 <at> debbugs.gnu.org>; Tue, 28 Nov 2017 16:44:08 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=5/12jXTXKkokUsDUnvx2oOA0n6adgBvghg/9TwH4npQ=;
 b=mskwVkxG4d9f46LGpMJlu0D5xEXfxyJcc4fAHVZqM4rnX/B/+Fic4X/KusmprIQPXo
 0mbr+H1vfXIiJ/1YmFeFqpomvWjPXHs2XBBbPryEN2Qyu+NegvaF1gE9Fbum7nGKiubk
 UiPvpfYTdX8m6ulfCe4qi/Jc2bu9SL3QEvH9sxt3b2EbK2SXOj4ksHHDjDV8F4STfigt
 4c0ATotC5GprVwn3HtMNXFUqvr9GBoMzsiRTQYOlEj5Z4SigwMulj4n4bfUBDd8FKdEg
 NHzZOaUlUoeshn+skhltQZS4qSBKsAdA/HFA0PdEAczGaE/gNVt1qq0YPf6NAlHV/lsH
 WCew==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:from:to:cc:subject:references:date
 :in-reply-to:message-id:user-agent:mime-version;
 bh=5/12jXTXKkokUsDUnvx2oOA0n6adgBvghg/9TwH4npQ=;
 b=psa4s9G482qQz73zZkh8adanuIHKvtrsPpII/IgJQe4SiKwhoi/iVfuAIrq/vv/LH2
 FHLxO5oR3m8SRSSmFSwqHADRLtjzKNBTO+ryScMPO1jE9U7NzmJzqrzts+/qubA/AGnQ
 tXwQLnlQisjIQpO7+itvE+U9Q9Pa1Tto5ZiTGpRley3oBlkP1cFujgAJCDMXEzwAjfnK
 ox1l2ZXiHXou8nunZ3N6hGUKn1GOakIjxUj2xtt/VCLZQhKCfQJ8htoWteNBHXfAqr9B
 vIk2bnU3li8d0qp5ePggWtmGYv8MyJycbwPHPTUdojnzourG75voOBuutzy3XJR2kufv
 k7dg==
X-Gm-Message-State: AJaThX7HSi2/jF+v5uTjTDlGU99+yOgLcVtUeysPheyKGSdfV6a1MdLB
 tTw61k579EEz1T/Tn/FJPdh2fw==
X-Google-Smtp-Source: AGs4zMYbOYrRdF+hqdJyL29cZ1zanCkEWjejt5eMpCdTPsbEnUj9rCRF48HqTejJY1H3EdLZBiw6ow==
X-Received: by 10.36.77.143 with SMTP id l137mr5120849itb.50.1511916243105;
 Tue, 28 Nov 2017 16:44:03 -0800 (PST)
Received: from zebian ([45.2.119.34])
 by smtp.googlemail.com with ESMTPSA id m141sm417722itm.12.2017.11.28.16.44.01
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Tue, 28 Nov 2017 16:44:02 -0800 (PST)
From: Noam Postavsky <npostavs@HIDDEN>
To: Alan Mackenzie <acm@HIDDEN>
Subject: Re: bug#29478: 26.0.90;
 `C-h k' followed by mouse clicks no longer shows down event
References: <1b3879d6-f14e-47b0-970f-baf09598fcfd@default>
 <871skjnpd8.fsf@HIDDEN> <20171128221036.GC14868@ACM>
Date: Tue, 28 Nov 2017 19:44:01 -0500
In-Reply-To: <20171128221036.GC14868@ACM> (Alan Mackenzie's message of "Tue,
 28 Nov 2017 22:10:36 +0000")
Message-ID: <87lgipncby.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: -0.0 (/)
X-Debbugs-Envelope-To: 29478
Cc: 29478 <at> debbugs.gnu.org, Drew Adams <drew.adams@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: -0.0 (/)

Alan Mackenzie <acm@HIDDEN> writes:

> I think if you press and hold the mouse button for (default) half a
> second, when you finally release it, C-h k will report the down mouse
> event.  At least this is how GPM behaves for me on a Linux tty.  This
> seems to make sense, because anything bound to a down mouse event is
> going to be something like a drag event, where the mouse button is held
> for an extended period of time.

This works for me in both lucid and gtk builds.

> Eli has already reported that the proposed negation of that condition
> would break the patch and lead to annoying infinite loops with mouse
> events.

Oh, hmm.  I was testing in a lucid build where your fix for that doesn't
quite seem to work, so I didn't realize that this change breaks things.






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

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


Received: (at 29478) by debbugs.gnu.org; 28 Nov 2017 22:15:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 28 17:15:41 2017
Received: from localhost ([127.0.0.1]:35239 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eJoAG-0006as-NJ
	for submit <at> debbugs.gnu.org; Tue, 28 Nov 2017 17:15:40 -0500
Received: from colin.muc.de ([193.149.48.1]:26038 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1eJoAE-0006ai-9w
 for 29478 <at> debbugs.gnu.org; Tue, 28 Nov 2017 17:15:39 -0500
Received: (qmail 864 invoked by uid 3782); 28 Nov 2017 22:15:36 -0000
Received: from acm.muc.de (p548C73AE.dip0.t-ipconnect.de [84.140.115.174]) by
 colin.muc.de (tmda-ofmipd) with ESMTP;
 Tue, 28 Nov 2017 23:15:36 +0100
Received: (qmail 22145 invoked by uid 1000); 28 Nov 2017 22:10:36 -0000
Date: Tue, 28 Nov 2017 22:10:36 +0000
To: Noam Postavsky <npostavs@HIDDEN>,
 Drew Adams <drew.adams@HIDDEN>
Subject: Re: bug#29478: 26.0.90; `C-h k' followed by mouse clicks no longer
 shows down event
Message-ID: <20171128221036.GC14868@ACM>
References: <1b3879d6-f14e-47b0-970f-baf09598fcfd@default>
 <871skjnpd8.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <871skjnpd8.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: -0.0 (/)
X-Debbugs-Envelope-To: 29478
Cc: 29478 <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: -0.0 (/)

Hello, Noam and Drew.

On Mon, Nov 27, 2017 at 20:50:11 -0500, Noam Postavsky wrote:
> tags 29272 + confirmed
> quit

> Drew Adams <drew.adams@HIDDEN> writes:

> > The down mouse-button event is no longer listed along with the up
> > event when you use `C-h k' with a click event.  Dunno whether this was
> > by design or is an oversight.

I think if you press and hold the mouse button for (default) half a
second, when you finally release it, C-h k will report the down mouse
event.  At least this is how GPM behaves for me on a Linux tty.  This
seems to make sense, because anything bound to a down mouse event is
going to be something like a drag event, where the mouse button is held
for an extended period of time.

> Looks like oversight.  Possibly related to Bug#29272.  The following
> seems to fix it for me, but I'm having trouble convincing myself that
> it's the right thing.

> --- c/lisp/help.el
> +++ i/lisp/help.el
> @@ -738,7 +738,7 @@ help-read-key-sequence
>                           ;; spuriously trigger the `sit-for'.
>                           (sleep-for 0.01)
>                           (while (read-event nil nil 0.01))
> -                         (not (sit-for (/ double-click-time 1000.0) t))))))))
> +                         (sit-for (/ double-click-time 1000.0) t)))))))
>            (list
>             key
>             ;; If KEY is a down-event, read and include the


> Alan, I believe you've been working on this code recently, any thoughts?

That I'm redoing some of the underlying C code after a suboptimal patch
some days ago, and this seems to have some effect on the mouse events
reported for C-h c and C-h k.

Eli has already reported that the proposed negation of that condition
would break the patch and lead to annoying infinite loops with mouse
events.

I think this code still may have some way to go before reaching its
final state.

-- 
Alan Mackenzie (Nuremberg, Germany).




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

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


Received: (at 29478) by debbugs.gnu.org; 28 Nov 2017 17:11:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 28 12:11:59 2017
Received: from localhost ([127.0.0.1]:34924 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eJjQM-0001tL-OO
	for submit <at> debbugs.gnu.org; Tue, 28 Nov 2017 12:11:59 -0500
Received: from eggs.gnu.org ([208.118.235.92]:47159)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eJjQI-0001t5-Km
 for 29478 <at> debbugs.gnu.org; Tue, 28 Nov 2017 12:11:54 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eJjQA-0004Ro-Cx
 for 29478 <at> debbugs.gnu.org; Tue, 28 Nov 2017 12:11:49 -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.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48962)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eJjQA-0004Rk-9d; Tue, 28 Nov 2017 12:11:46 -0500
Received: from [176.228.60.248] (port=3172 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 1eJjQ9-00063m-NH; Tue, 28 Nov 2017 12:11:46 -0500
Date: Tue, 28 Nov 2017 19:11:38 +0200
Message-Id: <83zi7649bp.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Noam Postavsky <npostavs@HIDDEN>
In-reply-to: <871skjnpd8.fsf@HIDDEN> (message from Noam
 Postavsky on Mon, 27 Nov 2017 20:50:11 -0500)
Subject: Re: bug#29478: 26.0.90;
 `C-h k' followed by mouse clicks no longer shows down event
References: <1b3879d6-f14e-47b0-970f-baf09598fcfd@default>
 <871skjnpd8.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: 29478
Cc: acm@HIDDEN, 29478 <at> debbugs.gnu.org, drew.adams@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>
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: Noam Postavsky <npostavs@HIDDEN>
> Date: Mon, 27 Nov 2017 20:50:11 -0500
> Cc: Alan Mackenzie <acm@HIDDEN>, 29478 <at> debbugs.gnu.org
> 
> Drew Adams <drew.adams@HIDDEN> writes:
> 
> > The down mouse-button event is no longer listed along with the up
> > event when you use `C-h k' with a click event.  Dunno whether this was
> > by design or is an oversight.
> 
> Looks like oversight.  Possibly related to Bug#29272.  The following
> seems to fix it for me, but I'm having trouble convincing myself that
> it's the right thing.
> 
> --- c/lisp/help.el
> +++ i/lisp/help.el
> @@ -738,7 +738,7 @@ help-read-key-sequence
>                           ;; spuriously trigger the `sit-for'.
>                           (sleep-for 0.01)
>                           (while (read-event nil nil 0.01))
> -                         (not (sit-for (/ double-click-time 1000.0) t))))))))
> +                         (sit-for (/ double-click-time 1000.0) t)))))))
>            (list
>             key
>             ;; If KEY is a down-event, read and include the
> 

Not an oversight: the above patch brings back bug#29272.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#29478; Package emacs. Full text available.
Added tag(s) confirmed. Request was from Noam Postavsky <npostavs@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 29478) by debbugs.gnu.org; 28 Nov 2017 01:50:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 27 20:50:21 2017
Received: from localhost ([127.0.0.1]:33254 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eJV2T-0007bb-9s
	for submit <at> debbugs.gnu.org; Mon, 27 Nov 2017 20:50:21 -0500
Received: from mail-io0-f170.google.com ([209.85.223.170]:34915)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <npostavs@HIDDEN>)
 id 1eJV2R-0007bI-Eq; Mon, 27 Nov 2017 20:50:19 -0500
Received: by mail-io0-f170.google.com with SMTP id i38so38581580iod.2;
 Mon, 27 Nov 2017 17:50:19 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=bRdloU3VHU+EdqWboL6r8SU91oEHNAFCUUueyfVu3kY=;
 b=PvkZrGK34Z/nYhgXVOUz6Vkwtp8uSwZydaMycytkFtMv8Vp1Os59Km/Sn16nWvekrz
 +LaNdocxX7bqylbULSfhZMNae9VEBb2rtpIeFqK6+Jen4jdEPYJ5kxY/bFPXTVg2BQtN
 6s3PYYxeUelUstM5kBZpE7rP51jlysfRZSb+5eGNq9y8YqIL1XElJEXjkCp1dPFFz1Iq
 CUNG4kwTSGY4esye4zmeNtYKHnkGayt/s9kvCSweyfWlM0ClTXxeMk5I0dZDLThphkSE
 Lc6WMtTgaNSt1VA2ACo8k58i2DPpmbA5U0xB2MlZIiIoxOxTbbJKKZQTKyIXqlmzXUfb
 kl/Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:from:to:cc:subject:references:date
 :in-reply-to:message-id:user-agent:mime-version;
 bh=bRdloU3VHU+EdqWboL6r8SU91oEHNAFCUUueyfVu3kY=;
 b=ppgX9WAfgX3GcKMVomuDZaL4OXOSeuz4tmNZhmevrQVdtyB/gSLQpDS0oTdKoqCEfz
 wIYKSCPfXuKXG/3F5PKxkU6lrvKDJ+w5OZtJUDk0FZFO+alBdjewfIvc5OSN5eQhRKGi
 awuW/u0SyBBxdVQFz7WcTvYrvxw2X4FYfwaOljqAPuyx5Y2MjcYkUk+xu88mSlIom75E
 EGG1z2vucvTQZvX7D4RnTmrjYd/cL4/lfvRK5F3azW+0UV5OvwvivqivK1EEUZdimXmx
 Fr8xhBix8f7BN0LoLuF/YQ2QbQ6574SoK+zV/Viau0ocRSqNiq4orESNWTstDImm2gJN
 CiRg==
X-Gm-Message-State: AJaThX7MzGn533JsxX0L/XykkxF48chgrPmNTVSde5+38H5cGLoE6t3E
 Pup/R/TXE7Yif4B3nQkHqEimUQ==
X-Google-Smtp-Source: AGs4zMaBmKzIytGWy+drnAH/iwF3AwYr2MSyBZ+Xutu/5goqdw/Zrr9ZmU694XOvbRJN0gXBBc1HsQ==
X-Received: by 10.107.184.212 with SMTP id i203mr9876023iof.17.1511833813592; 
 Mon, 27 Nov 2017 17:50:13 -0800 (PST)
Received: from zebian ([45.2.119.34])
 by smtp.googlemail.com with ESMTPSA id w68sm11835010iow.18.2017.11.27.17.50.12
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Mon, 27 Nov 2017 17:50:12 -0800 (PST)
From: Noam Postavsky <npostavs@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
Subject: Re: bug#29478: 26.0.90;
 `C-h k' followed by mouse clicks no longer shows down event
References: <1b3879d6-f14e-47b0-970f-baf09598fcfd@default>
Date: Mon, 27 Nov 2017 20:50:11 -0500
In-Reply-To: <1b3879d6-f14e-47b0-970f-baf09598fcfd@default> (Drew Adams's
 message of "Mon, 27 Nov 2017 15:21:43 -0800 (PST)")
Message-ID: <871skjnpd8.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: 0.1 (/)
X-Debbugs-Envelope-To: 29478
Cc: Alan Mackenzie <acm@HIDDEN>, 29478 <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: 0.1 (/)

tags 29272 + confirmed
quit

Drew Adams <drew.adams@HIDDEN> writes:

> The down mouse-button event is no longer listed along with the up
> event when you use `C-h k' with a click event.  Dunno whether this was
> by design or is an oversight.

Looks like oversight.  Possibly related to Bug#29272.  The following
seems to fix it for me, but I'm having trouble convincing myself that
it's the right thing.

--- c/lisp/help.el
+++ i/lisp/help.el
@@ -738,7 +738,7 @@ help-read-key-sequence
                          ;; spuriously trigger the `sit-for'.
                          (sleep-for 0.01)
                          (while (read-event nil nil 0.01))
-                         (not (sit-for (/ double-click-time 1000.0) t))))))))
+                         (sit-for (/ double-click-time 1000.0) t)))))))
           (list
            key
            ;; If KEY is a down-event, read and include the


Alan, I believe you've been working on this code recently, any thoughts?




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

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


Received: (at submit) by debbugs.gnu.org; 27 Nov 2017 23:22:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 27 18:22:03 2017
Received: from localhost ([127.0.0.1]:33199 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eJSix-00044L-25
	for submit <at> debbugs.gnu.org; Mon, 27 Nov 2017 18:22:03 -0500
Received: from eggs.gnu.org ([208.118.235.92]:52460)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1eJSiv-00043r-Eg
 for submit <at> debbugs.gnu.org; Mon, 27 Nov 2017 18:22:01 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <drew.adams@HIDDEN>) id 1eJSip-0005ZG-Du
 for submit <at> debbugs.gnu.org; Mon, 27 Nov 2017 18:21:56 -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.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:56982)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <drew.adams@HIDDEN>)
 id 1eJSip-0005ZC-Af
 for submit <at> debbugs.gnu.org; Mon, 27 Nov 2017 18:21:55 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43418)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <drew.adams@HIDDEN>) id 1eJSio-0007NO-8x
 for bug-gnu-emacs@HIDDEN; Mon, 27 Nov 2017 18:21:55 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <drew.adams@HIDDEN>) id 1eJSij-0005X3-As
 for bug-gnu-emacs@HIDDEN; Mon, 27 Nov 2017 18:21:54 -0500
Received: from aserp1040.oracle.com ([141.146.126.69]:50132)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <drew.adams@HIDDEN>)
 id 1eJSij-0005WW-44
 for bug-gnu-emacs@HIDDEN; Mon, 27 Nov 2017 18:21:49 -0500
Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233])
 by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id
 vARNLjR8022077
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK)
 for <bug-gnu-emacs@HIDDEN>; Mon, 27 Nov 2017 23:21:47 GMT
Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236])
 by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id vARNLiIR026718
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK)
 for <bug-gnu-emacs@HIDDEN>; Mon, 27 Nov 2017 23:21:45 GMT
Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25])
 by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id vARNLi0B028474
 for <bug-gnu-emacs@HIDDEN>; Mon, 27 Nov 2017 23:21:44 GMT
MIME-Version: 1.0
Message-ID: <1b3879d6-f14e-47b0-970f-baf09598fcfd@default>
Date: Mon, 27 Nov 2017 15:21:43 -0800 (PST)
From: Drew Adams <drew.adams@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 26.0.90; `C-h k' followed by mouse clicks no longer shows down event
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1  (1003210) [OL
 16.0.4615.0 (x86)]
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Source-IP: aserv0021.oracle.com [141.146.126.233]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic]
 [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.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: -5.0 (-----)

The down mouse-button event is no longer listed along with the up
event when you use `C-h k' with a click event.  Dunno whether this was
by design or is an oversight.

Seems to me like it was better before.  When you click a mouse button
sometimes the action you're interested in is actually bound to the down
event, not the up event.  And sometimes you're interested in
descriptions of both events.

And how else can you get to see the help for the command bound to the
down-button event?  I don't see how to do that now.

Also, I don't see anything in NEWS about this.  I do see this, however,
for `describe-key-briefly' (which is not what `C-h k' does) - perhaps it
is related to this undocumented change?

** 'describe-key-briefly' now ignores mouse movement events.


In GNU Emacs 26.0.90 (build 3, x86_64-w64-mingw32)
 of 2017-10-13 built on LAPHROAIG
Repository revision: 906224eba147bdfc0514090064e8e8f53160f1d4
Windowing system distributor 'Microsoft Corp.', version 6.1.7601
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.




Acknowledgement sent to Drew Adams <drew.adams@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#29478; 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: Mon, 25 Nov 2019 12:00:02 UTC

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