aboutsummaryrefslogtreecommitdiffstats
path: root/oni-elfeed.el
diff options
context:
space:
mode:
authorGravatar Tom Willemse2021-07-01 18:01:24 -0700
committerGravatar Tom Willemse2021-07-01 18:01:24 -0700
commit763395814f2bff864850ae56dc1926b9e2c5c360 (patch)
tree28431ec9e0a347060b4813c85e7ebf47e19dc632 /oni-elfeed.el
parent7ac2b35a33f4e4015c9e8f67411ddc520500ab00 (diff)
downloademacs-config-763395814f2bff864850ae56dc1926b9e2c5c360.tar.gz
emacs-config-763395814f2bff864850ae56dc1926b9e2c5c360.zip
[oni-elfeed] Enable ‘olivetti-mode’
Diffstat (limited to 'oni-elfeed.el')
-rw-r--r--oni-elfeed.el12
1 files changed, 10 insertions, 2 deletions
diff --git a/oni-elfeed.el b/oni-elfeed.el
index 83a734f..bedb0c9 100644
--- a/oni-elfeed.el
+++ b/oni-elfeed.el
@@ -4,8 +4,8 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
-;; Version: 2021.0611.011733
-;; Package-Requires: (elfeed)
+;; Version: 2021.0701.175714
+;; Package-Requires: (elfeed olivetti)
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -27,6 +27,12 @@
;;; Code:
(require 'elfeed)
+(require 'shr)
+
+(defun oni-elfeed-enable-olivetti-mode ()
+ "Change ‘olivetti-body-width’ to match the ‘shr-max-width’."
+ (setq-local olivetti-body-width (1+ shr-max-width))
+ (olivetti-mode))
(setq elfeed-feeds
'("http://nullprogram.com/feed/"
@@ -70,5 +76,7 @@
(elfeed-make-tagger :before "2 weeks ago"
:remove 'unread))
+(add-hook 'elfeed-show-mode-hook #'oni-elfeed-enable-olivetti-mode)
+
(provide 'oni-elfeed)
;;; oni-elfeed.el ends here