From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#24237: 24.5; (elisp)`Extended Menu Items', :filter warning Date: Sat, 19 Dec 2020 10:54:06 -0800 (PST) Message-ID: References: <<<<6c4f5089-43fa-4ca1-a656-1ec1684df960@default>>>> <<<<87v9d67ox6.fsf@gnus.org>>>> <<<<70cc884d-4f32-4a2e-b3f5-181709f2ca29@default>>>> <<<<83blexeod5.fsf@gnu.org>>>> <<>> <<<83v9d5d1yd.fsf@gnu.org>>> <<846fcdf8-9b51-4246-8200-b067e7006e24@default>> <<83y2hut6m7.fsf@gnu.org>> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39193"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 24237@debbugs.gnu.org, monnier@iro.umontreal.ca To: Eli Zaretskii , Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 19 19:57:39 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kqhQB-000A62-6Y for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Dec 2020 19:57:39 +0100 Original-Received: from localhost ([::1]:57568 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqhQA-0005uR-7s for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Dec 2020 13:57:38 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35132) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqhPa-0005t2-5Z for bug-gnu-emacs@gnu.org; Sat, 19 Dec 2020 13:57:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59845) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kqhPZ-00056r-T0 for bug-gnu-emacs@gnu.org; Sat, 19 Dec 2020 13:57:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kqhPZ-00023n-Ot for bug-gnu-emacs@gnu.org; Sat, 19 Dec 2020 13:57:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Dec 2020 18:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24237 X-GNU-PR-Package: emacs Original-Received: via spool by 24237-submit@debbugs.gnu.org id=B24237.16084041827874 (code B ref 24237); Sat, 19 Dec 2020 18:57:01 +0000 Original-Received: (at 24237) by debbugs.gnu.org; 19 Dec 2020 18:56:22 +0000 Original-Received: from localhost ([127.0.0.1]:43158 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqhOw-00022w-AT for submit@debbugs.gnu.org; Sat, 19 Dec 2020 13:56:22 -0500 Original-Received: from userp2130.oracle.com ([156.151.31.86]:40414) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqhOt-00022h-4u for 24237@debbugs.gnu.org; Sat, 19 Dec 2020 13:56:20 -0500 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0BJIpaxb019162; Sat, 19 Dec 2020 18:56:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=xEI2dYX5uz1LNjxC6iJs3f6EsvA3018t3GhqgB2L+b0=; b=q3N4/HJbdg96zGYi0lqO7qsXoNFSnW249Bsg3sQVrTxvilb7ltilhUUeJjgk3JYHXpMQ UwfO06/rJmQ0eeDTEQkYDZUjEMxLJEaNElYwjVrzLBgvnKRaB3nAkoEXMN5+eZneNFvr kPU2SaTHdSFaXuQsGqGxvWJZ1iQfpjiJZSNbzQVhljcUp65FybY30iGVWFPz2sAmbKDw 4IFKJhIjsaEKIaMzxD/OsZyJ1oNNBgNmbZ5XWRmT8XaQii1JMsxDaUaQXINfCJTnkaoS zJ7mHdz8+CKvXd3uqtaNUivCpdjyVHJNod2TYfZOAh/0xw4Up7U7i0lBxAKV5RA8q1lt GA== Original-Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 35h8xqs8t0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 19 Dec 2020 18:56:13 +0000 Original-Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0BJIpOir140304; Sat, 19 Dec 2020 18:54:12 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3030.oracle.com with ESMTP id 35h7j9eqme-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 19 Dec 2020 18:54:12 +0000 Original-Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 0BJIs7Ti004626; Sat, 19 Dec 2020 18:54:07 GMT In-Reply-To: <<83y2hut6m7.fsf@gnu.org>> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.5071.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9839 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 adultscore=0 spamscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012190140 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9839 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 clxscore=1015 priorityscore=1501 mlxscore=0 lowpriorityscore=0 adultscore=0 mlxlogscore=999 suspectscore=0 phishscore=0 impostorscore=0 bulkscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012190140 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:196415 Archived-At: > > > > "use of a `menu-item' construct with a :filter > > > > to create a conditional _keyboard_ key binding. > > > > In such a case, the `menu-item' construct is not > > > > a real menu item - it is not placed on any menu." >=20 > If this is never placed on the menu bar or on any pop-down menu, then > what the manual says is not relevant, because redisplay only considers > the menus that need to be displayed. 1. The manual's description of :filter is entirely relevant to this use case - _except_ for that last paragraph, which apparently erroneously assumes that the only possible use of an extended menu item with :filter is in a menu. Extended menu items are not just for menus (in spite of the name). 2. What you've added here is what needs to be added there: a qualification to that caveat, that _when used in a menu_, "Emacs can call ... redisplay ... You should write it so it can safely be called at any time". 3. And because this use case is important and not at all obvious, the doc there should explicitly point out this use case. a. You can bind an extended menu item that uses :filter to a keyboard key, to give it a dynamic binding (explaining what that means with an example). b. If the only bindings for that extended menu item are keyboard bindings then the admonition about redisplay (see #2) does not apply. Don't assume that readers will understand that if not placed on a menu then it doesn't apply. The admonition is currently too blanket. Wrt #3: An example for this use case should be presented somewhere in the Elisp manual. If you can think of a better place than in the description of :filter, fine. If not, then that's the place. 4. As I said in the bug report, having to use an extended menu item for this feature is a hack or workaround. There's no other possibility out of the box. Better than just documenting that you can use an extended menu item with :filter to get this behavior would be to provide the behavior in another way. IOW, ideally it wouldn't be "hidden" under the misleading notion of a menu. :filter itself is not about menus. More generally, `menu-item' is not just about menus and menu items. This is not obvious. And in particular, it's not obvious that you can make good use of :filter with a keyboard key.