From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.bugs Subject: bug#21650: fix should be underneath MH-E Date: Wed, 03 Feb 2016 18:43:43 +0900 Organization: Emacsen advocacy group Message-ID: References: <29197.1454352814@allegro.localdomain> <0tzivin3m4.fsf@fencepost.gnu.org> <87lh72le2h.fsf@gnus.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1454492668 13088 80.91.229.3 (3 Feb 2016 09:44:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Feb 2016 09:44:28 +0000 (UTC) Cc: 21650@debbugs.gnu.org, Bill Wohler , Mike Kupfer To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 03 10:44:18 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aQtyy-0006bJ-Ln for geb-bug-gnu-emacs@m.gmane.org; Wed, 03 Feb 2016 10:44:16 +0100 Original-Received: from localhost ([::1]:33607 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQtys-0005zi-TL for geb-bug-gnu-emacs@m.gmane.org; Wed, 03 Feb 2016 04:44:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59538) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQtyp-0005zc-5I for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2016 04:44:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aQtyk-0002Ey-2l for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2016 04:44:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48884) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQtyj-0002Eu-Vi for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2016 04:44:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aQtyj-0000tn-QG for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2016 04:44:01 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Katsumi Yamaoka Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Feb 2016 09:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21650 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: security Original-Received: via spool by 21650-submit@debbugs.gnu.org id=B21650.14544926373432 (code B ref 21650); Wed, 03 Feb 2016 09:44:01 +0000 Original-Received: (at 21650) by debbugs.gnu.org; 3 Feb 2016 09:43:57 +0000 Original-Received: from localhost ([127.0.0.1]:57473 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aQtyf-0000tI-IB for submit@debbugs.gnu.org; Wed, 03 Feb 2016 04:43:57 -0500 Original-Received: from mail-hampton.hostforweb.net ([205.234.186.191]:45195 helo=hampton.hostforweb.net) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aQtye-0000t5-3h for 21650@debbugs.gnu.org; Wed, 03 Feb 2016 04:43:56 -0500 Original-Received: from s70.gtokyofl21.vectant.ne.jp ([202.215.75.70]:63287 helo=localhost) by hampton.hostforweb.net with esmtpsa (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.86) (envelope-from ) id 1aQtyV-001IGR-2s; Wed, 03 Feb 2016 03:43:48 -0600 X-Face: #kKnN,xUnmKia.'[pp`; Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu; B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.90 (i686-pc-cygwin) Cancel-Lock: sha1:5S2TBRuYaas0EWMSw9vQUT41gn4= X-OutGoing-Spam-Status: No, score=-2.9 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - hampton.hostforweb.net X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Get-Message-Sender-Via: hampton.hostforweb.net: authenticated_id: yamaoka/from_h X-Authenticated-Sender: hampton.hostforweb.net: yamaoka@jpl.org X-Source: X-Source-Args: X-Source-Dir: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:112333 Archived-At: --=-=-= On Wed, 03 Feb 2016 13:31:34 +1100, Lars Ingebrigtsen wrote: > Glenn Morris writes: >> Surely Gnus should make whatever buffer-local shr-related settings it >> needs in its Gnus buffers, and the MH-E folks can do the same, rather >> than hard-coding Gnus-specific behavior in mm-shr? > Yup. 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. --=-=-= Content-Type: text/x-patch Content-Disposition: inline --- gnus-art.el~ 2016-02-02 02:43:45.605413000 +0000 +++ gnus-art.el 2016-02-03 09:42:20.238190600 +0000 @@ -2722,9 +2722,8 @@ (when (gmm-called-interactively-p 'any) (gnus-treat-article nil)))) -(defun article-wash-html () +(defun article-wash-html-1 () "Format an HTML article." - (interactive) (let ((handles nil) (buffer-read-only nil)) (when (gnus-buffer-live-p gnus-original-article-buffer) @@ -2735,6 +2734,19 @@ (mm-enable-multibyte) (mm-inline-text-html handles))) +(defun article-wash-html () + "Format an HTML article." + (interactive) + (cond ((eq mm-text-html-renderer 'shr) + (require 'shr) + (let (shr-inhibit-images shr-blocked-images) + (with-current-buffer gnus-summary-buffer + (setq shr-inhibit-images gnus-inhibit-images + shr-blocked-images (gnus-blocked-images))) + (article-wash-html-1))) + (t + (article-wash-html-1)))) + (defvar gnus-article-browse-html-temp-list nil "List of temporary files created by `gnus-article-browse-html-parts'. Internal variable.") @@ -4930,7 +4942,9 @@ gnus-url-button-commands))) (defmacro gnus-bind-safe-url-regexp (&rest body) - "Bind `mm-w3m-safe-url-regexp' according to `gnus-safe-html-newsgroups'." + "Bind `mm-w3m-safe-url-regexp' according to `gnus-safe-html-newsgroups'. +Also bind `shr-inhibit-images' and `shr-blocked-images' with +`gnus-inhibit-images' and `gnus-blocked-images' if `shr' is used." `(let ((mm-w3m-safe-url-regexp (let ((group (if (and (derived-mode-p 'gnus-article-mode) (gnus-buffer-live-p @@ -4948,7 +4962,15 @@ (member group gnus-safe-html-newsgroups))) nil mm-w3m-safe-url-regexp)))) - ,@body)) + (cond ((eq mm-text-html-renderer 'shr) + (require 'shr) + (let (shr-inhibit-images shr-blocked-images) + (with-current-buffer gnus-summary-buffer + (setq shr-inhibit-images gnus-inhibit-images + shr-blocked-images (gnus-blocked-images))) + ,@body)) + (t + ,@body)))) (defun gnus-mime-button-menu (event prefix) "Construct a context-sensitive menu of MIME commands." --- mm-decode.el~ 2016-01-04 22:05:27.255542500 +0000 +++ mm-decode.el 2016-02-03 09:42:20.238799100 +0000 @@ -1844,15 +1844,7 @@ (when handle (mm-with-part handle (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))) + charset char) (unless handle (setq handle (mm-dissect-buffer t))) (setq charset (mail-content-type-get (mm-handle-type handle) 'charset)) --=-=-=--