From 44a82900e4ee484f1e95e5a4ef4c97db30ccc98c Mon Sep 17 00:00:00 2001 From: jao Date: Sat, 10 Sep 2022 22:03:27 +0100 Subject: eww: auto-readable urls --- custom/jao-custom-eww.el | 10 ++++++++++ 1 file changed, 10 insertions(+) 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) -- cgit v1.2.3