From 763395814f2bff864850ae56dc1926b9e2c5c360 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 1 Jul 2021 18:01:24 -0700 Subject: [PATCH] =?UTF-8?q?[oni-elfeed]=20Enable=20=E2=80=98olivetti-mode?= =?UTF-8?q?=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- oni-elfeed.el | 12 ++++++++++-- 1 file 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 ;; 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