Simplify enhanced elfeed entry visualization

This commit is contained in:
coolneng 2023-05-15 05:15:28 +02:00
parent d65a20323d
commit 3bb8310dfb
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 16 additions and 15 deletions

View File

@ -118,21 +118,20 @@
(elfeed-protocol-enable) (elfeed-protocol-enable)
(add-hook! 'elfeed-search-mode-hook 'elfeed-update) (add-hook! 'elfeed-search-mode-hook 'elfeed-update)
;; Use different font and show article in fullscreen ;; Use different font and show article in fullscreen
(setq elfeed-show-mode-hook (setq elfeed-show-entry-switch #'switch-to-buffer)
(lambda () (defadvice! +rss-elfeed-wrap-h-nicer ()
(set-face-attribute 'variable-pitch (selected-frame) :font (font-spec :family "Bitter" :size 28)) "Enhances an elfeed entry's readability by wrapping it to a width of
(setq fill-column 120) `fill-column' and centering it with `visual-fill-column-mode'."
(setq elfeed-show-entry-switch #'my-show-elfeed))) :override #'+rss-elfeed-wrap-h
(defun my-show-elfeed (buffer) (setq-local truncate-lines nil
(with-current-buffer buffer shr-width 160
(setq buffer-read-only nil) visual-fill-column-center-text t
(goto-char (point-min)) default-text-properties '(line-height 1.1))
(re-search-forward "\n\n") (let ((inhibit-read-only t)
(fill-individual-paragraphs (point) (point-max)) (inhibit-modification-hooks t))
(setq buffer-read-only t) (visual-fill-column-mode)
(setq visual-fill-column-center-text t) (setq-local shr-current-font '(:family "Bitter" :height 1.1))
(visual-fill-column-mode 1)) (set-buffer-modified-p nil))))
(switch-to-buffer buffer)))
;; Set up the mail stack ;; Set up the mail stack
(after! mu4e (load! "+mail")) (after! mu4e (load! "+mail"))
;; HACK Enable AOT native compilation ;; HACK Enable AOT native compilation
@ -149,3 +148,5 @@
(setq lsp-pyright-use-library-code-for-types nil)) (setq lsp-pyright-use-library-code-for-types nil))
;; Set indentation level to 2 ;; Set indentation level to 2
(setq tab-width 2) (setq tab-width 2)
;; Set up nix LSP support
(add-hook 'nix-mode-local-vars-hook #'lsp!)