skeeto / elfeed

An Emacs web feeds client
The Unlicense
1.49k stars 116 forks source link

Non-contiguous selection? #243

Open alphapapa opened 6 years ago

alphapapa commented 6 years ago

Hi there,

I've been meaning to try elfeed for a long time, and I finally started trying it today. Thanks for making and sharing it! I just added support for it to pocket-reader.

Having recently put pocket-reader together, I was wondering if you had considered adding non-contiguous selection, i.e. not region-based. For example, in pocket-reader (and other tabulated-list-mode buffers), you can select or tag multiple items that are not next to each other. This makes it quick and easy to go through a list of items, pick the ones you are interested in, and perform an action on them, like marking as favorite, adding a tag, etc.

Thanks.

skeeto commented 6 years ago

I've viewed this as two different models, named after two different mail clients: the Mu4e model and the Notmuch model.

The Mu4e model is what you're describing as the traditional tag and execute model found all over Emacs (dired, tabulated-list-mode, etc.). There might be a way to select "everything matching X" but generally you tag items one by one.

The Notmuch model has this simpler, region-based selection, but it's complimented with a rich "filter" where the list of visible items is narrowed by an expression. Rather than manually picking each item, the filter is modified to narrow the list to the desired items, where they can be selected contiguously.

I deliberately chose the Notmuch model for Elfeed since I figured it didn't need the precision of non-contiguous selection. Better to operate on entries in bulk since there will be many of them.

There's not really anything technical preventing a non-contiguous selection in the Notmuch model. The way I might do it in Elfeed is to build on the existing tag infrastructure. Selecting an item means adding a special tag to it, and this can even get its own key binding. That tag can also be associated with a custom face (elfeed-search-face-alist), to make it look selected. The execute step would work by adjusting the filter to match this tag, then operate on a contiguous selection of the results.

alphapapa commented 6 years ago

Thanks, that sounds like a great idea.