From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 69306@debbugs.gnu.org, StrawberryTea <look@strawberrytea.xyz>
Subject: bug#69306: 30.0.50; defining menu-items with :enable enables them unconditionally
Date: Fri, 23 Feb 2024 07:23:19 -0500 [thread overview]
Message-ID: <jwvr0h3nzj6.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <86le7b1w5a.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 23 Feb 2024 09:23:45 +0200")
> If you expect that the key binding will be disabled via :enable, then
> I don't think this is supported except in menus (and tool bars and tab
> bars): the value is evaluated by the menu-related code, when it
> actually displays the menu, and in your case there's no menu. The
> :filter attribute is interpreted differently, so it just happens to
> work. But that's sheer luck, I'd say.
Indeed, the `:enable` thingy controls only whether the entry is present
in the (a) menu, whereas the `:filter` is obeyed by the keymap lookup code.
We could treat this as a feature request to make the keymap lookup code
obey `:enable` as well. I remember thinking about doing it. I can't
remember whether that would be easy to do but I can't think of a good
reason why it wouldn't be.
Stefan
prev parent reply other threads:[~2024-02-23 12:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-21 23:26 bug#69306: 30.0.50; defining menu-items with :enable enables them unconditionally StrawberryTea
2024-02-22 6:41 ` Eli Zaretskii
2024-02-22 21:19 ` StrawberryTea
2024-02-23 7:23 ` Eli Zaretskii
2024-02-23 12:23 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvr0h3nzj6.fsf-monnier+emacs@gnu.org \
--to=bug-gnu-emacs@gnu.org \
--cc=69306@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=look@strawberrytea.xyz \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.