GNU bug report logs - #69306
30.0.50; defining menu-items with :enable enables them unconditionally

Previous Next

Package: emacs;

Reported by: StrawberryTea <look <at> strawberrytea.xyz>

Date: Wed, 21 Feb 2024 23:31:01 UTC

Severity: normal

Found in version 30.0.50

Full log


Message #17 received at 69306 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 69306 <at> debbugs.gnu.org, StrawberryTea <look <at> strawberrytea.xyz>
Subject: Re: bug#69306: 30.0.50; defining menu-items with :enable enables
 them unconditionally
Date: Fri, 23 Feb 2024 07:23:19 -0500
> 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





This bug report was last modified 1 year and 114 days ago.

Previous Next


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