Re: [Patch] apps-menu filtering



Matthew Love <matth love gmail com> writes:

> OK, I'm not sure if it's exactly as you describe, but it seems to be
> working here.

I was hoping to be able to play with the categories, but this doesn't
work:

(setq apps-menu-filter
      (lambda (ent)
        (when ent
          (let ((cat (cdr (assoc "Categories" ent))))
            (if (string-match "Utility" cat)
                (rplacd (assoc "Categories" ent) "utility")))
          ent)))

Rather than renaming the "Utility" category, this seems to dump
everything in the "Utility" category into limbo -- i.e., those items no
longer show up in the menu.  Looking closer at apps-menu.jl you're
apparently doing some complicated stuff with categories, so this is
probably the wrong way to go about changing a category name.  But
dropping the entries is probably not the right thing to do.

In fact, this has a peculiar result for me:

(setq apps-menu-filter
      (lambda (ent)
        (when ent
          (let ((name (cdr (assoc "Name" ent))))
            (if (string-match "Emacs" name)
                (rplacd (assoc "Categories" ent) "System")))
          ent)))

In addition to moving emacs to the "System" category I noticed that
"File Browser" (i.e., nautilus-browser) shows up there as well.  Without
the above snippet it doesn't show up at all -- confirmed by searching
the contents of apps-menu.  I don't know why -- there's no "Emacs" in
the desktop file for nautilus-browser at all.  If I have a chance over
the next few days I'll see if I can trouble-shoot more on this one.

I have to admit, I don't really understand what all is going on with the
categories.  Desktop entries list several categories, not just one.
`determine-desktop-category' seems to arbitrarily choose only one -- if
there's no reason to choose one rather than another why not use them
all?  It seems reasonable for, e.g., emacs to show up under both
development and office.  Then the fix-cats and fix-sub-cats are (if I
understand them right, and I'm not sure I do) consolidating the category
structure according to desktop-cat-alist.  Is that right?

-- 
Jeremy Hankins <nowan nowan org>


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