From f7baa0c089af23eb0288848b240353117246d35b Mon Sep 17 00:00:00 2001 From: coolneng Date: Mon, 15 May 2023 05:15:28 +0200 Subject: [PATCH] Simplify enhanced elfeed entry visualization --- config.el | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/config.el b/config.el index d979c3c..2df1cea 100644 --- a/config.el +++ b/config.el @@ -118,21 +118,20 @@ (elfeed-protocol-enable) (add-hook! 'elfeed-search-mode-hook 'elfeed-update) ;; Use different font and show article in fullscreen - (setq elfeed-show-mode-hook - (lambda () - (set-face-attribute 'variable-pitch (selected-frame) :font (font-spec :family "Bitter" :size 28)) - (setq fill-column 120) - (setq elfeed-show-entry-switch #'my-show-elfeed))) - (defun my-show-elfeed (buffer) - (with-current-buffer buffer - (setq buffer-read-only nil) - (goto-char (point-min)) - (re-search-forward "\n\n") - (fill-individual-paragraphs (point) (point-max)) - (setq buffer-read-only t) - (setq visual-fill-column-center-text t) - (visual-fill-column-mode 1)) - (switch-to-buffer buffer))) + (setq elfeed-show-entry-switch #'switch-to-buffer) + (defadvice! +rss-elfeed-wrap-h-nicer () + "Enhances an elfeed entry's readability by wrapping it to a width of +`fill-column' and centering it with `visual-fill-column-mode'." + :override #'+rss-elfeed-wrap-h + (setq-local truncate-lines nil + shr-width 160 + visual-fill-column-center-text t + default-text-properties '(line-height 1.1)) + (let ((inhibit-read-only t) + (inhibit-modification-hooks t)) + (visual-fill-column-mode) + (setq-local shr-current-font '(:family "Raleway" :height 1.1)) + (set-buffer-modified-p nil)))) ;; Set up the mail stack (after! mu4e (load! "+mail")) ;; HACK Enable AOT native compilation