summaryrefslogtreecommitdiff
path: root/content/emacs/moving-my-rss-reading-to-emacs-with-elfeed.md
blob: a7f868760747d63c190059cf3948b77f5d8bce46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
---
title: "Moving My RSS Reading to Emacs With Elfeed"
category: emacs
abstract: It's even better now than it newsboat.
date: 2023-05-06T19:44:40+02:00
year: 2023
draft: false
tags:
- Emacs
- elfeed
- RSS
- newsboat
---
Since Emacs became my shell of choice[^1], I am abandoning more and more dedicated applications in favor of different packages. As it turns out, Emacs packages are very feature rich. This time: I moved my RSS reading from newsboat[^2] to elfeed[^3].

Elfeed has very simple keybindings:
- g will refresh the items list
- G will refresh the items list and fetch new items
- r will mark currently selected item is read (remove unread tag)[^4]
- b will open item in the browser


One huge upside of elfeed compared to newsboat is image support. Emacs is a GUI application, so all images are present in their glory!

{{<img-center "elfeed-details.png" "Images!">}}

My setup is near stock. I have a few dozen feeds that are auto-tagged. Three essential tags are "important", "news", and "company". I want to read each "important", then I want to see all normal, and finally I can just skim "news" and "company". Adding auto-tagging is very simple: just define the tag when defining the RSS feed list:

{{<highlight lisp>}}
("https://rubenerd.com/feed/" blog important)
("https://www.pine64.org/feed/" company)
{{</highlight>}}

Now, each new article will be tagged with matching tags. Elfeed allows to define of custom faces that will be applied to items matching tag[^6]:

{{<highlight lisp>}}
(defface important-elfeed-entry
  '((t :foreground "#f77"))
  "Marks an important Elfeed entry."
  :group 'elfeed)
  
(defface nonimportant-elfeed-entry
  '((t :foreground "#C0C0C0"))
  "Marks an nonimportant Elfeed entry."
  :group 'elfeed)

(push '(important important-elfeed-entry)
       elfeed-search-face-alist)
(push '(company nonimportant-elfeed-entry)
      elfeed-search-face-alist)
(push '(news nonimportant-elfeed-entry)
      elfeed-search-face-alist)
{{</highlight>}}

Now important items will be dark red, while company & news will be dark gray

{{<img-center "elfeed-list.png" "No important things to read at this moment.">}}

Elfeed has a few packages expanding its functionality, but I found the default behavior to be exactly right.

[^1]: [Emacs as a Shell](/2023/emacs-as-a-shell/)
[^2]: [Newsboat homepage](https://newsboat.org/)
[^3]: [Elfeed repository on Github](https://github.com/skeeto/elfeed)
[^4]: The "r" key messes with my muscle memory, as notmuch[^5] uses "ku" for the same action while "r" will start composing a reply.
[^5]: [Posts tagged about notmuch](https://d-s.sh/tags/notmuch)
[^6]: my elisp-fu not good