summaryrefslogtreecommitdiff
path: root/content/emacs/elfeed-literate-config.md
diff options
context:
space:
mode:
authormms <michal@sapka.me>2023-12-23 22:37:38 +0100
committermms <michal@sapka.me>2023-12-23 22:37:38 +0100
commitfdb420bd62a4ffe3fdc2ff4e3f5932fcddebc32b (patch)
tree3ada8248d6ce43468b230d85e0a45baf329072cb /content/emacs/elfeed-literate-config.md
parentda430dc2329b818bb9dd599d10446327a9ff75fc (diff)
feat: move files to emacs
Diffstat (limited to 'content/emacs/elfeed-literate-config.md')
-rw-r--r--content/emacs/elfeed-literate-config.md64
1 files changed, 64 insertions, 0 deletions
diff --git a/content/emacs/elfeed-literate-config.md b/content/emacs/elfeed-literate-config.md
new file mode 100644
index 0000000..4876c6e
--- /dev/null
+++ b/content/emacs/elfeed-literate-config.md
@@ -0,0 +1,64 @@
+---
+title: "Literate configuration of Elfeed"
+category: emacs
+abstract: Setting up config inside an org file
+date: 2023-06-02T22:26:24+02:00
+year: 2023
+draft: false
+tags:
+- elfeed
+- org-mode
+- literate-programming
+---
+Recently I've been toying with a literate configuration[^literate] of Emacs. My init.el took a straightforward form:
+[^literate]: https://en.wikipedia.org/wiki/Literate_programming
+
+{{<highlight lisp "linenos=table">}}
+(org-babel-load-file "~/.emacs.d/config.org")
+{{</highlight>}}
+
+And all of my configuration lives in an org-file. This alone gives me very little benefit for now, but in the future, it will make it easier to have it as a dedicated page on this site.
+
+However, one thing completely surprised me: the elfeed configuration. Until now, I used the standard way of configuring feeds with Elisp. It works, but what it is not is readable. A list of:
+
+{{<highlight lisp "linenos=true,linenostart=199">}}
+("https://gideonwolfe.com/index.xml" blog imporant)
+("https://fabiensanglard.net/rss.xml" blog important)
+("https://protesilaos.com/master.xml" emacs)
+{{</highlight>}}
+
+is far from being manageable and requires constant manual labor.
+
+### Elfeed-org
+
+One of the packages expanding capabilities of elfeed is elfeed-org[^elf-org]. It allows configuring the list of feeds with a standard org tree. Since my config is now also an org file, nothing stops me from adding the list as an org-tree inside my config org-file! I set it up via:
+[^elf-org]: https://github.com/remyhonig/elfeed-org
+
+{{<highlight lisp "linenos=table,linenostart=199,hl_lines=7">}}
+*** elfeed-org
+
+#+BEGIN_SRC emacs-lisp
+ (use-package elfeed-org
+ :ensure t
+ :config
+ (setq rmh-elfeed-org-files (list "~/.emacs.d/config.org"))
+ (elfeed-org))
+#+END_SRC
+{{</highlight>}}
+
+Therefore, I am now pointing at the same file to become the data source for elfeed-org as the rest of my config. Just a few lines down, I start to define my list of subscriptions:
+
+{{<highlight org "linenos=table,linenostart=207">}}
+*** Feeds :elfeed:
+
+**** Blogs
+
+***** https://gideonwolfe.com/index.xml :important:
+***** https://fabiensanglard.net/rss.xml. :important:
+
+**** Emacs
+
+***** https://protesilaos.com/master.xml :important:
+{{</highlight>}}
+
+Much more readable! Elfeed-org will ignore the entire outer tree and extract the feeds from leaves under the `:elfeed:` tag.