GNU bug report logs -
#24237
24.5; (elisp)`Extended Menu Items', :filter warning
Previous Next
Reported by: Drew Adams <drew.adams <at> oracle.com>
Date: Mon, 15 Aug 2016 18:07:01 UTC
Severity: minor
Found in version 24.5
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 24237 <at> debbugs.gnu.org (full text, mbox):
Drew Adams <drew.adams <at> oracle.com> writes:
> The doc for :filter says this about the FILTER-FN:
>
> Emacs can call this function at any time that it does redisplay or
> operates on menu data structures, so you should write it so it can
> safely be called at any time.
>
> Is this true in general, or only when the extended menu item is put on a
> menu?
>
> A common idiom is to make 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.
>
> I'm guessing that in such a case this doc paragraph does not apply. If
> this guess is correct then please correct the paragraph, so that it says
> something like "If an extended menu item that uses :filter is placed on
> a menu then Emacs can call FILTER-FN when...".
I think making the documentation more specific here serves no purpose.
The statement as is should be true: You should always write these filter
functions as if they are called at any time.
> Also, is it really the case that FILTER-FN can be called anytime Emacs
> does redisplay? Shouldn't the doc say only that it can be called
> anytime Emacs "operates on menu data structures"? Does it get called by
> redisplay other than when redisplay operates on menu data structures?
> In the case mentioned above (binding to a keyboard key), would FILTER-FN
> ever be called during redisplay? I'm guessing that it would not.
I don't see why we should specify that at all.
Closing.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
This bug report was last modified 4 years and 155 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.