GNU bug report logs - #30870
Error opening HTML mail when mm-text-html-renderer is nil

Previous Next

Packages: gnus, emacs;

Reported by: "Basil L. Contovounesios" <contovob <at> tcd.ie>

Date: Tue, 20 Mar 2018 01:47:02 UTC

Severity: normal

Tags: fixed

Found in version 5.13

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: 30870 <at> debbugs.gnu.org
Subject: bug#30870: Error opening HTML mail when mm-text-html-renderer is nil
Date: Tue, 20 Mar 2018 01:46:22 +0000
[backtrace.txt (text/plain, attachment)]
[Message part 2 (text/plain, inline)]
(Hopefully someone else can reproduce this issue without my having to
 start an uncustomised Gnus.)

1. M-x toggle-debug-on-error RET
2. M-x set-variable RET mm-text-html-renderer RET nil RET
3. Open a HTML article in Gnus, e.g. by typing RET in a summary buffer

This results in the attached backtrace.

I'm quite unfamiliar with the relevant code, but the patch I am
currently using as a workaround follows my signature, as do listings of
my Gnus and Emacs versions.

Thanks,

-- 
Basil

Gnus v5.13
GNU Emacs 27.0.50 (build 16, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2018-03-19

[foo.diff (text/x-diff, inline)]
diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el
index c11af7060b..6cd93c91a4 100644
--- a/lisp/gnus/mm-view.el
+++ b/lisp/gnus/mm-view.el
@@ -311,17 +311,18 @@ mm-inline-render-with-function
 
 (defun mm-inline-text-html (handle)
   (if (stringp (car handle))
-      (mapcar 'mm-inline-text-html (cdr handle))
-    (let* ((func mm-text-html-renderer)
-	   (entry (assq func mm-text-html-renderer-alist))
-	   (inhibit-read-only t))
-      (if entry
-	  (setq func (cdr entry)))
+      (mapcar #'mm-inline-text-html (cdr handle))
+    (let ((func (alist-get mm-text-html-renderer
+                           mm-text-html-renderer-alist
+                           mm-text-html-renderer))
+          (inhibit-read-only t))
       (cond
        ((functionp func)
 	(funcall func handle))
+       ((functionp (car func))
+        (apply (car func) handle (cdr func)))
        (t
-	(apply (car func) handle (cdr func)))))))
+        (mm-interactively-view-part handle))))))
 
 (defun mm-inline-text-vcard (handle)
   (let ((inhibit-read-only t))
diff --git a/lisp/mh-e/mh-gnus.el b/lisp/mh-e/mh-gnus.el
index 3d202890b6..f1256bdef5 100644
--- a/lisp/mh-e/mh-gnus.el
+++ b/lisp/mh-e/mh-gnus.el
@@ -165,8 +165,8 @@ mh-mm-save-part
 
 (defun mh-mm-text-html-renderer ()
   "Find the renderer Gnus is using to display text/html MIME parts."
-  (or (and (boundp 'mm-inline-text-html-renderer) mm-inline-text-html-renderer)
-      (and (boundp 'mm-text-html-renderer) mm-text-html-renderer)))
+  (or (bound-and-true-p mm-inline-text-html-renderer)
+      (bound-and-true-p mm-text-html-renderer)))
 
 (provide 'mh-gnus)
 
diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el
index e2c682a399..8ad1877327 100644
--- a/lisp/mh-e/mh-mime.el
+++ b/lisp/mh-e/mh-mime.el
@@ -140,9 +140,7 @@ mh-mm-inline-media-tests
     ("text/html"
      ,(if (fboundp 'mm-inline-text-html) 'mm-inline-text-html 'mm-inline-text)
      (lambda (handle)
-       (or (and (boundp 'mm-inline-text-html-renderer)
-                mm-inline-text-html-renderer)
-           (and (boundp 'mm-text-html-renderer) mm-text-html-renderer))))
+       (mh-mm-text-html-renderer)))
     ("text/x-vcard"
      mh-mm-inline-text-vcard
      (lambda (handle)
@@ -781,9 +779,9 @@ mh-small-image-p
         (mm-inline-large-images t))
     (and media-test
          (equal (mm-handle-media-supertype handle) "image")
-         (funcall media-test handle) ; Since mm-inline-large-images is T,
-                                        ; this only tells us if the image is
-                                        ; something that emacs can display
+         (funcall media-test handle) ; Since `mm-inline-large-images' is t,
+                                     ; this only tells us if the image is
+                                     ; something that Emacs can display
          (let* ((image (mm-get-image handle)))
            (or (mh-do-in-xemacs
                  (and (mh-funcall-if-exists glyphp image)

This bug report was last modified 7 years and 35 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.