emacs-devel
[Top][All Lists]
Advanced

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

RE: Friendlier dired experience [CODE INCLUDED]


From: Drew Adams
Subject: RE: Friendlier dired experience [CODE INCLUDED]
Date: Thu, 5 Nov 2020 09:08:11 -0800 (PST)

> However, when I tried to write a bookmark-listing command to display
> only Burly's bookmarks, it wasn't as easy to re-use existing
> functionality.  I tried to re-use the list-bookmarks command by binding
> bookmarks-alist to a filtered alist, and that worked.
> 
> The problem is that re-displaying the bookmarks list (e.g. after
> deleting a bookmark) shows the non-filtered bookmarks list.  I then
> experimented with using buffer-local function advice in the
> list-bookmarks buffer to cause it to use the filtered bookmarks list
> when re-displaying, but it didn't seem to work.  And even if it had, it
> would have been very hacky, so it didn't seem like a good solution.
> 
> An idea I had was for the list-bookmarks command to use an optional
> filter function to filter the bookmarks-alist before displaying them, so
> the filter could persist after using commands to manipulate
> bookmarks.[2] (Note that the global value of bookmarks-alist would
> remain unchanged so that saving the bookmarks to disk still saves all
> bookmarks, not just the filtered ones.)

This all already done, in Bookmark+.

You can filter in any number of ways.  And by
default the filtering (and other state of the
bookmark-list display) persist, until you
change it.

And you can even bookmark the bookmark-list
display state.  Jumping to such a bookmark
restores the display.

> Frankly, I wonder if list-bookmarks ought to be rewritten to use,
> e.g. tabulated-list-mode instead of its bespoke code.

Absolutely not.  Tabulated-List mode is IMO a
rudimentary, fragile, brute hammer.  It takes
over a complete buffer (you can't even add a
heading or a paragraph, outside the table).
It offers little, and prevents much.

Dired, bookmark-list display, and most other
seemingly tabular lists should stay away from it.
Such UIs can be quite sophisticated, offering a
_lot_ more than just tabular display with only
simplistic sorting.  Don't go by what you see
at first sight ("Oh, hey, there's a tabular
list here...").

> (Although I'm guessing that would break much
> of Drew's Bookmarks+ library...)

Yes.  Vanilla Emacs has apparently gone this
route recently, against my requests/advice.
As a result I'll no doubt have to include some
of the previous vanilla bookmark.el code in
Bookmark+.  Alas.  (On n'arrete pas le progres...)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]