summaryrefslogtreecommitdiffhomepage
path: root/custom
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-09-10 22:03:27 +0100
committerjao <jao@gnu.org>2022-09-10 22:03:27 +0100
commit44a82900e4ee484f1e95e5a4ef4c97db30ccc98c (patch)
treebdc120237d45669fd9261faad6020a59098b8509 /custom
parent8c6838311257cd90217801953ad8e4846384ef5e (diff)
downloadelibs-44a82900e4ee484f1e95e5a4ef4c97db30ccc98c.tar.gz
elibs-44a82900e4ee484f1e95e5a4ef4c97db30ccc98c.tar.bz2
eww: auto-readable urls
Diffstat (limited to 'custom')
-rw-r--r--custom/jao-custom-eww.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/custom/jao-custom-eww.el b/custom/jao-custom-eww.el
index efa0828..0e77feb 100644
--- a/custom/jao-custom-eww.el
+++ b/custom/jao-custom-eww.el
@@ -163,6 +163,16 @@
("C-c C-w" . jao-eww-close)
("M-i" . eww-toggle-images))))
+;;; auto-readable
+(defvar jao-eww-auto-readable-urls
+ (regexp-opt '("guardian.co.uk" "theguardian.com" "github.com")))
+
+(defun jao-eww-autoread ()
+ (when (string-match-p jao-eww-auto-readable-urls (or (eww-current-url)))
+ (eww-readable)))
+
+(add-hook 'eww-after-render-hook #'jao-eww-autoread)
+
;;; fixes for shr image rendering
(require 'shr)