Post by Bill WohlerI'd be reluctant to make the change in MH-E since it would be an ongoing
maintenance problem. Such an option should be renderer agnostic and the
documentation should list the renderers that support it. This would have
to be maintained.
In terms of design principles I agree.
The reason I went with this approach was that I couldn't see a cleaner
way to get the functionality that I want.
As for being renderer-agnostic, I'm not aware of any renderers besides
shr that display images. But that's sort of beside the point--you'll
notice that the patch doesn't set any shr variables, just gnus
variables.
The reason this is so inelegant is the way Gnus and shr are tied
together.
- mm-shr calls #'gnus-blocked-images to get the regexp for
images.
- This turns into a call to #'gnus-block-private-groups, which
returns nil if reading a newsgroup and "." for anything else.
- #'gnus-block-private-groups only works right if called from
Gnus: it calls #'gnus-news-group-p and #'gnus-member-of-valid to
determine what you're reading.
So, yes, the user could just set gnus-inhibit-images if they never want
images. I tried that, and I found that it blocked images that I wanted
to see. That means having to deal with gnus-blocked-images.
I suppose we could tell the user to write their own function to replace
gnus-block-private-groups. That doesn't strike me as user-friendly,
particularly if the user wants the function to work for both MH-E and
Gnus.
We could provide an family of functions to supplement
gnus-block-private-groups and add them to the choice list for
gnus-blocked-images. But that requires buy-in from the Gnus folks, it
is arguably less clean than my patch (because the Gnus code would know
who its callers are), and it still doesn't solve the technical hurdles
related to working correctly for both MH-E and Gnus.
Post by Bill WohlerIf we do add this code to MH-E, I'd suggest making the new option very
similar to that of mh-fetch-x-image-url; that is, it has the values Ask
Before Fetching, and Never Fetch. The issue is the fetching of URLs, not
the display of images. Thus, I wouldn't bother with "not displaying
included images."
That's a fair point. I'd certainly be willing to rework my patch to use
that approach.
Post by Bill WohlerStill, I don't think MH-E is the right place for any of this. We simply
call mm-inline-text-html-renderer. Any configuration of how this is done
should be at the level of mm-inline-text-html-renderer.
Well, there's a variable mm-inline-text-html-with-images which, based on
the documentation, would seem to be all the user needs.
mm-inline-text-html-with-images is a variable defined in `mm-decode.el'.
Its value is nil
Documentation:
If non-nil, Gnus will allow retrieving images in HTML contents with
the <img> tags. It has no effect on Emacs/w3. See also the
documentation for the `mm-w3m-safe-url-regexp' variable.
(There's so much layering in this part of the code, I didn't realize
this variable existed until I just now did an apropos search on
mm.*html.) But it doesn't work. It's set to nil, and I can still see
remotely-stored images.
I'll see if I can figure out why mm-inline-text-html-with-images doesn't
work. Maybe all that's needed is a simple bugfix in that part of the
code. But if disallowing the display of remote images also breaks the
display of images that are embedded in the mail, that will be inadequate
for my purposes. Solving this cleanly could take awhile.
mike