summary refs log tree commit diff
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-05-11 17:52:54 -0700
committerFranck Cuny <franck@fcuny.net>2022-05-11 17:52:54 -0700
commit768b0620479b2695388345293f773bc28b79d8ae (patch)
treee835dd1861a2a4a170f640a74616ff49ea71fbce
parentorg: add a capture template for elfeed (diff)
downloademacs.d-768b0620479b2695388345293f773bc28b79d8ae.tar.gz
elfeed: disable proportional fonts and use eww to render article
Diffstat (limited to '')
-rw-r--r--emacs/custom/my-elfeed.el20
1 files changed, 18 insertions, 2 deletions
diff --git a/emacs/custom/my-elfeed.el b/emacs/custom/my-elfeed.el
index 9d4125e..d1ace62 100644
--- a/emacs/custom/my-elfeed.el
+++ b/emacs/custom/my-elfeed.el
@@ -18,13 +18,29 @@
 (defalias 'elfeed-toggle-star
   (elfeed-expose #'elfeed-search-toggle-all 'star))
 
+;; set colors for some specific tags
 (defface elfeed-face-tag-mustread
   '((t :foreground "#f00"))
   "This is a custom font face for the `mustread' tag in Elfeed."
   :group 'elfeed)
 
-(push '(mustread elfeed-face-tag-mustread)
-      elfeed-search-face-alist)
+(with-eval-after-load 'elfeed
+  (setq elfeed-search-face-alist
+        '((mustread elfeed-face-tag-mustread))))
+
+(defun my/elfeed-show-visit-eww ()
+  "Visit the current entry in eww."
+  (interactive)
+  (let ((link (elfeed-entry-link elfeed-show-entry)))
+    (when link
+      (eww link))))
+
+;; disable proportional fonts when displaying HTML content.
+(advice-add #'elfeed-insert-html
+              :around
+              (lambda (fun &rest r)
+                (let ((shr-use-fonts nil))
+                  (apply fun r))))
 
 ;; (defun copy-elfeed-link-title-to-org (entry)
 ;;   "Copy the ENTRY title and URL as org link to the clipboard."