Subject: bug#50383: 28.0.50; [PATCH] Feature suggestion, gnus-article-toggle-fonts to toggle fonts for HTML articles

From: Alex Bochannek <[email-masked]>
Date: Sat, 04 Sep 2021 18:18:25 -0700

Alex Bochannek <[email-masked]> writes:

> Hello!
>
> A while back I turned off `shr-use-fonts' for my HTML email but found
> that occasionally proportional fonts are useful when reading my
> messages.
>
> I am proposing the below `gnus-article-toggle-fonts' function with a
> keybinding of `W D F'.

The patch did not keep the fonts toggled when selecting the next message
or reloading the current one. I am proposing the below change. I am not
sure how you feel about buffer-local Gnus variables in `mm-decode.el',
so please let me know if an alternative approach would be better.

Thanks!
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index 82d1de25f3..5c5896446e 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -1843,6 +1843,9 @@ mm-shr
 				      (buffer-string))))))
 	(shr-inhibit-images mm-html-inhibit-images)
 	(shr-blocked-images mm-html-blocked-images)
+	(shr-use-fonts (if (local-variable-p 'gnus-article-shr-use-fonts)
+                           gnus-article-shr-use-fonts
+                         shr-use-fonts))
 	charset coding char document)
     (mm-with-part (or handle (setq handle (mm-dissect-buffer t)))
       (setq case-fold-search t)
-- 
Alex.