Re: [Patch] apps-menu



Matthew Love <matth love gmail com> writes:

> Along these same lines I was thinking we could have a tunable option like
> 'apps-menu-filter
>
> which would have pre-defined filters 'default and 'maybe which would be
> the same as 'nil and 'maybe above, respectively.
>
> There would also be the option to make your own filter if you choose,
> i.e.
>
> (setq user-apps-menu-display-filter '(
>       ('no-games ;; filter-name
>         (var0 "Categories" "[Gg]ame") ;; (variable-name fdo-key regexp
>       &optional t) -- the optional 't will filter out the record if the
>       test is false, rather than the default of filtering out a record
>       if the test it true.
> 	(var2 "NoDisplay" "[Tt]")
> 	(var3 "Hidden" "[Tt]"))
>       ('xfce
>         (var4 "OnlyShowIn" "xfce" t)
> 	(var5 "NoDisplay" "[Tt]")
> 	(var6 "Hidden" "[Tt]"))))

Another way would be to be able to specify a predicate function to do
the filtering.  The function would be passed a record and would return
true or false to indicate whether or not to include it in the menu.  You
could define a couple of standard functions (which would be able to be
called from within user-provided functions) to do common things (e.g.,
to do the sort of filtering that t or nil would do).  That way the
apps-menu-display-all would be simple to use for novices (it could still
take options like t and nil) but if its value is a function (or even a
lisp form?) instead of t or nil that would be the predicate used.  If
you wanted, you could even get a bit fancier, and allow the function to
modify the record (i.e., the function would return the record, possibly
modified, or nil indicating not to include it).  That way a power user
could, e.g., rename certain entries or maybe even categories easily.

Just an idea; I don't know how easy it would be to work this into your
current system.

-- 
Jeremy Hankins <nowan nowan org>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]