reddit / emacs

Is it possible to sort elfeed entries by source? I.e. all entries from the same source come first

underconstructions · 2022-10-05 21:18
Danrobi1 · 2022-10-06 01:23
Press `s`.
organic-bookworm · 2022-10-06 09:00
There's no built-in *interactive* command to sort entries. You could filter interactively, as suggested by [/u/Danrobi1](https://www.reddit.com/r/emacs/comments/xwmnyv/comment/ir876nu). However, I occasionally want to sort by date, so I've implemented an interactive sorting in my config (defun my/elfeed-search-sort-set (comparator &optional reverse) (setq elfeed-sort-order (if reverse 'descending 'ascending) elfeed-search-sort-function comparator) (elfeed-search-update t)) (defun my/elfeed-search-sort--feed-url (a b) (string-lessp (elfeed-feed-url (elfeed-entry-feed a)) (elfeed-feed-url (elfeed-entry-feed b)))) (defun my/elfeed-search-sort-feed (&optional reverse) (interactive "P") (my/elfeed-search-sort-set #'my/elfeed-search-sort--feed-url reverse)) You can use `my/elfeed-search-sort-feed` command interactively. I wrap that further into a transient menu (require 'transient) (transient-define-prefix my/elfeed-search-sort-menu () [ ;; ... ("f" "Feed (a-z)" my/elfeed-search-sort-feed) ("F" "Feed (z-a)" ,(lambda () (interactive) (my/elfeed-search-sort-feed t))) ;; ... ] )