Gnus development mailing list
 help / color / mirror / Atom feed
From: Mike Kupfer <m.kupfer@acm.org>
To: ding@gnus.org
Subject: mm-inline-text-html-with-images and shr
Date: Thu, 28 Jan 2016 19:35:33 -0800	[thread overview]
Message-ID: <16731.1454038533@allegro.localdomain> (raw)

Hi, as you might know, MH-E uses the Emacs MIME (mm) libraries to
display emails.  MH-E users have noticed that if mm-text-html-renderer
is set to 'shr and an HTML email refers to an external image, Emacs will
try to download the image, even when mm-inline-text-html-with-images is
nil.

With Gnus, shr does not have this problem.

AFAICT, this is because shr doesn't pay attention to
mm-inline-text-html-with-images.  Instead, it relies on
gnus-blocked-images to control whether an image gets downloaded.

I want to fix MH-E so that it doesn't download images unless the user
has said to.  But I'm not sure what would be a clean way to do that.
The best I've come up with so far is to temporarily rebind
gnus-blocked-images before calling mm-display-part.

diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el
--- a/lisp/mh-e/mh-mime.el
+++ b/lisp/mh-e/mh-mime.el
@@ -709,7 +709,9 @@
         region buffer-read-only)
     (save-excursion
       (unwind-protect
-          (let ((win (get-buffer-window (current-buffer) t)))
+          (let ((win (get-buffer-window (current-buffer) t))
+                (gnus-blocked-images
+                 (if mm-inline-text-html-with-images nil ".")))
             (when win
               (select-window win))
             (goto-char point)

Is there a better way?  Could shr be made to honor
mm-inline-text-html-with-images?

thanks,
mike



                 reply	other threads:[~2016-01-29  3:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16731.1454038533@allegro.localdomain \
    --to=m.kupfer@acm.org \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).