skeeto / elfeed

An Emacs web feeds client
The Unlicense
1.52k stars 120 forks source link

Chronological feed view, by elfeed-search #485

Open butter-radish opened 1 year ago

butter-radish commented 1 year ago

Is there a way to flip the feed into a reverse-chronological order (in the Elfeed-Search mode)? I can't find anything for this in §'Filter syntax' in the README.

If we could order entries reverse-chronologically in Elfeed-Search, pressing 'n' inside Elfeed-Show buffers could move to the next entry chronologically. Parsing feed entries chronologically can be useful, especially in social media feeds—Twitter, Mastodon, Instagram, et al.

sp1ff commented 1 year ago

butter-radish @.***> writes:

Is there a way to flip the feed into a reverse-chronological order (in the Elfeed-Search mode)? I can't find anything for this in §'Filter syntax' in the README.

If we could order entries reverse-chronologically in Elfeed-Search, pressing 'n' inside Elfeed-Show buffers could move to the next entry chronologically. Parsing feed entries chronologically can be useful, especially in social media feeds—Twitter, Mastodon, Instagram, et al.

Take a look at elfeed-search-sort-function?

-- Michael @.***>

user86940 commented 8 months ago

I had your same problem and this works (copy into the init file):

(defun my/elfeed-search-sort--feed-url (a b) (>= (elfeed-entry-date a) (elfeed-entry-date b)))

then customise elfeed-search-sort-function to be: my/elfeed-search-sort--feed-url

Close this issue?

butter-radish commented 7 months ago

Sorry, I’d mixed it up while writing the issue, I wanted the reverse of what Elfeed does by default—I suppose now that would be a chronological feed view.

Switching the function in your code gets me that, thank you @user86940! And you too @sp1ff, even though I didn’t understand what you meant back then.

(defun my/elfeed-search-sort--feed-url (a b)
  (<=
   (elfeed-entry-date a)
   (elfeed-entry-date b)))

But I don’t want to have it chronological all the time, the default reverse-chronological sorting works for most things; it’s only for a few things that I want the opposite. So I’d like to be able to easily toggle it, like with a ‘elfeed-search-live-filter’ (‘s’) search. “@​1-week” reverse-chronologically sorts all the entries from the past week, maybe some other operator instead of ‘@’ prefixing the duration could list all the entries from that period chronologically.