From: Drew Adams <drew.adams@oracle.com>
To: Eli Zaretskii <eliz@gnu.org>, Drew Adams <drew.adams@oracle.com>
Cc: larsi@gnus.org, 24237@debbugs.gnu.org, monnier@iro.umontreal.ca
Subject: bug#24237: 24.5; (elisp)`Extended Menu Items', :filter warning
Date: Sat, 19 Dec 2020 10:54:06 -0800 (PST) [thread overview]
Message-ID: <d15a8746-eb78-44b5-a4d6-af2285969b76@default> (raw)
In-Reply-To: <<83y2hut6m7.fsf@gnu.org>>
> > > > "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."
>
> 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.
next parent reply other threads:[~2020-12-19 18:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <<<<6c4f5089-43fa-4ca1-a656-1ec1684df960@default>
[not found] ` <<<<87v9d67ox6.fsf@gnus.org>
[not found] ` <<<<70cc884d-4f32-4a2e-b3f5-181709f2ca29@default>
[not found] ` <<<<83blexeod5.fsf@gnu.org>
[not found] ` <<<e70746fb-1e56-4115-9fb8-1896c4e8b8d3@default>
[not found] ` <<<83v9d5d1yd.fsf@gnu.org>
[not found] ` <<846fcdf8-9b51-4246-8200-b067e7006e24@default>
[not found] ` <<83y2hut6m7.fsf@gnu.org>
2020-12-19 18:54 ` Drew Adams [this message]
2020-12-19 19:17 ` bug#24237: 24.5; (elisp)`Extended Menu Items', :filter warning Eli Zaretskii
[not found] <<<<<6c4f5089-43fa-4ca1-a656-1ec1684df960@default>
[not found] ` <<<<<87v9d67ox6.fsf@gnus.org>
[not found] ` <<<<<70cc884d-4f32-4a2e-b3f5-181709f2ca29@default>
[not found] ` <<<<<83blexeod5.fsf@gnu.org>
[not found] ` <<<<e70746fb-1e56-4115-9fb8-1896c4e8b8d3@default>
[not found] ` <<<<83v9d5d1yd.fsf@gnu.org>
[not found] ` <<<846fcdf8-9b51-4246-8200-b067e7006e24@default>
[not found] ` <<<83y2hut6m7.fsf@gnu.org>
[not found] ` <<d15a8746-eb78-44b5-a4d6-af2285969b76@default>
[not found] ` <<838s9ttxkk.fsf@gnu.org>
2020-12-19 19:35 ` Drew Adams
2020-12-20 0:05 ` Stefan Kangas
2020-12-20 1:23 ` Drew Adams
[not found] <<<6c4f5089-43fa-4ca1-a656-1ec1684df960@default>
[not found] ` <<<87v9d67ox6.fsf@gnus.org>
[not found] ` <<<70cc884d-4f32-4a2e-b3f5-181709f2ca29@default>
[not found] ` <<<83blexeod5.fsf@gnu.org>
[not found] ` <<e70746fb-1e56-4115-9fb8-1896c4e8b8d3@default>
[not found] ` <<83v9d5d1yd.fsf@gnu.org>
2020-12-13 19:52 ` Drew Adams
2020-12-19 10:47 ` Eli Zaretskii
[not found] <<6c4f5089-43fa-4ca1-a656-1ec1684df960@default>
[not found] ` <<87v9d67ox6.fsf@gnus.org>
[not found] ` <<70cc884d-4f32-4a2e-b3f5-181709f2ca29@default>
[not found] ` <<83blexeod5.fsf@gnu.org>
2020-12-13 17:24 ` Drew Adams
2020-12-13 17:56 ` Eli Zaretskii
2016-08-15 18:06 Drew Adams
2020-12-12 20:24 ` Lars Ingebrigtsen
2020-12-12 20:45 ` Drew Adams
2020-12-13 15:07 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d15a8746-eb78-44b5-a4d6-af2285969b76@default \
--to=drew.adams@oracle.com \
--cc=24237@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=larsi@gnus.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).