From e8535fa55fbd75a796a9caec4ce14368ac174c3d Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Sun, 3 Mar 2024 11:47:16 +0100 Subject: 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. --- .gnus | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to '.gnus') diff --git a/.gnus b/.gnus index eb452bb..e078c91 100644 --- 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 -- cgit v1.2.3