|
From: | Jim Porter |
Subject: | Re: [PATCH] Use vtable for eww-bookmarks |
Date: | Sun, 1 Dec 2024 11:31:37 -0800 |
On 11/30/2024 10:39 PM, Adam Porter wrote:
So I'd suggest a reconsideration of the concept of sorting: There is no such thing as "clearing" the sorting, because the entries are always sorted by something, even if that's just the order in which the bookmarks are present in the list (which is probably the order in which they were created, or the inverse).
This is probably just a difference of semantics, but I see the default ordering as a non-sorted *ordering*; non-sorted because none of the cells' data contributes to the ordering. The sorted views then apply a sort function to *produce* an ordering. So in my mind you can clear the sorting to reveal the "natural ordering" of the list.
In this case, the vtable-map already binds vtable-sort-by-current-column. So it seems like what we need is a column by which to sort entries by default. That would seem to leave us with two options:a) Sort by bookmark name by defaultb) Add a column for the bookmarks' place in the list, and sort by that by default.
I agree that it makes sense to have some common way of handling this so that we don't proliferate many different implementations across Emacs. If we want to let users arbitrarily reorder the entries, then (a) won't work. However, I'm not sure I like (b). Except for providing a command to restore the natural ordering, the list-position column just seems like visual noise.
Maybe vtable would benefit from some special handling here? We could even go a step further and make a 'reorderable-vtable' (feel free to suggest a better name/interface) that includes the kill/yank commands from the EWW bookmarks code. Then we can also avoid proliferating many variations on how a user might reorder the data in a table.
That said, if everyone else prefers adding a list-position column, I won't fight too hard. I'm not the maintainer for EWW, just someone who's pushed a few commits to it recently.
Then the user could simply sort by one column or the other, without needing to add the additional concept of "clearing" the sorting (a concept that's not generally present in such views in other GUIs, anyway--usually a table view is always sorted by one column or another).
For what it's worth, the columns in the bookmarks Library in Firefox are tri-state buttons: sort ascending, sort descending, and no sort. You can only reorder the bookmarks if all the columns have the "no sort" state.
Columns in Emacs table modes *can* have any of these three states, but it's not easy to restore the initial ordering.
[Prev in Thread] | Current Thread | [Next in Thread] |