unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: Mike Kupfer <m.kupfer@acm.org>
Cc: Lars Ingebrigtsen <larsi@gnus.org>,
	21650@debbugs.gnu.org, Bill Wohler <wohler@newt.com>
Subject: bug#21650: fix should be underneath MH-E
Date: Thu, 04 Feb 2016 15:09:43 +0900	[thread overview]
Message-ID: <b4m8u312ehk.fsf@jpl.org> (raw)
In-Reply-To: <yxq8u7dz416.fsf@chaos.i-did-not-set--mail-host-address--so-tickle-me>

[-- Attachment #1: Type: text/plain, Size: 2099 bytes --]

On Wed, 03 Feb 2016 19:58:46 -0800, Mike Kupfer wrote:
> Bill Wohler wrote:

>> Katsumi Yamaoka <yamaoka@jpl.org> wrote:
>>> My solution is below.  Tested briefly.  This patch moves the
>>> binding of shr-inhibit-images and shr-blocked-images to Gnus
>>> from mm.  So, MH-E has to do a similar thing.
>>
>> I disagree. This only works for shr and defeats encapsulation.

> I think what makes this a non-trivial problem is wanting more
> flexibility than just a binary yes-no decision, which is what
> mm-inline-text-html-with-images currently provides.  That's why
> gnus-blocked-images is a regexp (or a function that returns a regexp).

> Could mm-inline-text-html-with-images be generalized to be more like
> gnus-blocked-images?  (For example, nil means don't retrieve anything, t
> means retrieve everything, a string would be a regexp of what URLs will
> be retrieved.)  Then shr could use mm-inline-text-html-with-images
> instead of shr-blocked-images, and MH-E users would have a single knob
> that could control any of the different rendering back-ends.

Ok, I was too near-sighted yesterday.  Here is a second try:

Implement the new user options in mm:
`mm-html-inhibit-images' --- boolean
  Non-nil means inhibit displaying of images inline in the article body.
  The default is t.
`mm-html-blocked-images' --- regexp or nil
  Regexp matching image URLs to be blocked.  The default is "".

Make `mm-inline-text-html-with-images' an obsolete variable alias
for `mm-html-inhibit-images'.

How Gnus does when calling an mm function:

(defun gnus-function ()
  (let ((mm-html-inhibit-images gnus-inhibit-images)
	(mm-html-blocked-images (with-current-buffer gnus-summary-buffer
				  (gnus-blocked-images))))
    (mm-function)))

MH-E doesn't have to do like this if there's no need to have
options like `mh-inhibit-images'.

That's all.  Is this the right approach?

In Gnus, shr and gnus-html are controlled by both inhibit-images
and blocked-images, and w3m is controlled by only inhibit-images.
MH-E doesn't use gnus-html.el, does it?  As for mm-shr, it would
have to be changed into:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 706 bytes --]

--- mm-decode.el~	2016-01-04 22:05:27.255542500 +0000
+++ mm-decode.el	2016-02-04 06:05:08.419602200 +0000
@@ -1846,11 +1846,5 @@
 				      (buffer-string))))))
-	shr-inhibit-images shr-blocked-images charset char)
-    (if (and (boundp 'gnus-summary-buffer)
-	     (bufferp gnus-summary-buffer)
-	     (buffer-name gnus-summary-buffer))
-	(with-current-buffer gnus-summary-buffer
-	  (setq shr-inhibit-images gnus-inhibit-images
-		shr-blocked-images (gnus-blocked-images)))
-      (setq shr-inhibit-images gnus-inhibit-images
-	    shr-blocked-images (gnus-blocked-images)))
+	(shr-inhibit-images mm-html-inhibit-images)
+	(shr-blocked-images mm-html-blocked-images)
+	charset char)
     (unless handle

  parent reply	other threads:[~2016-02-04  6:09 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-08 17:03 bug#21650: 24.5; mh-e keeps trying to open urls Simon Gerraty
2015-10-08 19:20 ` Eli Zaretskii
2015-10-08 20:19   ` Simon J. Gerraty
2015-10-08 21:21     ` Glenn Morris
2015-10-09 15:10       ` Simon J. Gerraty
2015-10-09  7:11     ` Eli Zaretskii
2015-12-23  6:07       ` Bill Wohler
2016-01-09  2:20         ` Mike Kupfer
2015-10-09  1:23 ` Wolfgang Jenkner
2016-02-01 18:53 ` bug#21650: fix should be underneath MH-E Mike Kupfer
2016-02-02 18:28   ` Glenn Morris
2016-02-02 22:23     ` Katsumi Yamaoka
2016-02-02 22:34       ` Glenn Morris
2016-02-02 23:34         ` Katsumi Yamaoka
2016-02-03  2:31         ` Lars Ingebrigtsen
2016-02-03  9:43           ` Katsumi Yamaoka
2016-02-03 22:52             ` Bill Wohler
2016-02-04  3:58               ` Mike Kupfer
2016-02-03  5:58       ` Bill Wohler
2016-02-04  6:09 ` Katsumi Yamaoka [this message]
2016-02-05  1:41   ` Mike Kupfer
2016-02-05  6:04 ` Katsumi Yamaoka
2016-02-06 22:53   ` Mike Kupfer
2016-02-05  6:41 ` Katsumi Yamaoka
2016-02-08 22:43 ` Katsumi Yamaoka
2016-02-09  0:41   ` Mike Kupfer
2016-02-09  3:24     ` Mike Kupfer
2016-02-09  1:49 ` Katsumi Yamaoka
2016-02-09  4:41 ` Katsumi Yamaoka
2016-02-09  5:49   ` Bill Wohler
2016-02-09 15:17   ` Mike Kupfer
2016-02-09 22:15 ` Katsumi Yamaoka
2016-02-10  2:23   ` Mike Kupfer
2016-02-10  3:51     ` Bill Wohler
2016-02-28  3:20     ` Mike Kupfer
2016-06-07  0:35 ` bug#21650: 21650: fixed in Emacs 25 Mike Kupfer

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=b4m8u312ehk.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=21650@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=m.kupfer@acm.org \
    --cc=wohler@newt.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).