emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Use vtable for eww-bookmarks


From: Adam Porter
Subject: Re: [PATCH] Use vtable for eww-bookmarks
Date: Sun, 1 Dec 2024 00:39:33 -0600
User-agent: Mozilla Thunderbird

Jim Porter <jporterbugs@gmail.com> writes:
Given that, let's go with your implementation, though I do have one
last concern with the "undo sort": the keybinding ("u") is the same as
what other table-like modes (e.g. dired, list-packages) use for
"unmark". Currently we don't support marking/unmarking in the
bookmarks menu, but that seems like a useful thing we might add one
day: you could mark several bookmarks in order to open them all,
delete them all, add some kind of tag to them, etc.

This is a good idea.

I'm not sure what a better key would be though. Maybe "C" for "clear sort"?

Attached a patch that uses "c" ("c", not "C") and renames the function
to match.
Let me know what you think!

Given how many similar modes and buffers that are in Emacs (i.e. where some kind of objects are displayed in a list with metadata), I think it would be best if any new such feature followed existing paradigms as closely as possible. To have each vtable-like view (whether implemented with vtable or tabulated-list or anything else) have slightly different concepts and bindings is not helpful to the user.

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).

As an example, consider Dired: there is no "clearing" of sorting options in Dired, but there is dired-sort-toggle-or-edit: it toggles between sorting by date and sorting by the default (i.e. alphabetically).

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 default

b) Add a column for the bookmarks' place in the list, and sort by that by default.

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).

And with that, the existing binding of vtable-sort-by-current-column would suffice, eliminating the need for another sort-related binding.

What do you think?  :)

BTW, instead of doing:

+    (while (not (equal (vtable-current-object)
+                       bookmark-at-point))
+      (forward-line 1))))

Could you use vtable-goto-object? I realize that it currently uses EQ for comparison, but 1) we've talked about changing that, and 2) ISTM that EQ should work for this case anyway, because entries in the bookmark list are being compared, and they shouldn't be getting copied. Am I missing something?

Thanks,
Adam



reply via email to

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