dotfiles

🎜 Clone'em, tweak'em, stick'em in your $HOME 🎝
git clone https://git.kevinlegouguec.net/dotfiles
Log | Files | Refs | README

commit e8535fa55fbd75a796a9caec4ce14368ac174c3d
parent 5b4b6d2319fa8594d4c8dd3078a72b45ec0505b8
Author: KΓ©vin Le Gouguec <kevin.legouguec@gmail.com>
Date:   Sun,  3 Mar 2024 11:47:16 +0100

Fix HTML-detection "logic"

The previous code failed to detect some HTML emails, perhaps because
the text/html part was nested inside a multipart/alternative?

Lucked onto debbugs-gnu.el by asking xref for occurrences of
gnus-article-mime-handles in the Emacs tree; not sure if M-? showing
results from ~/.emacs.d/elpa was intended, but it sure helped here.

Diffstat:
M.gnus | 11++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/.gnus b/.gnus @@ -151,11 +151,16 @@ (setf (alist-get tag shr-external-rendering-functions) shr-function))) (defun my/gnus-article-has-html () + ;; Hard to tell the difference between + ;; * the variable `gnus-article-mime-handles', + ;; * the function `gnus-article-mime-handles', + ;; * the variable `gnus-article-mime-handle-alist'. + ;; + ;; Stealing debbugs.el's patch-finding logic. (seq-some (lambda (handle) - (and (listp handle) - (string= (mm-handle-media-type handle) "text/html"))) - gnus-article-mime-handles)) + (string= (mm-handle-media-type (cdr handle)) "text/html")) + (gnus-article-mime-handles))) (defun my/gnus-article-should-wrap () (save-excursion