From ad33b3417d92595cb8cf6c7600731dd46817c96e Mon Sep 17 00:00:00 2001 From: Jinwoo Lee Date: Fri, 30 Jan 2015 12:57:14 +1600 Subject: [PATCH] Re: [PATCH] Add a defcustom for whether to block remote images by default. --- 6a/1a50893fe43034c6ed0d73e62f268e8eb19c10 | 149 ++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 6a/1a50893fe43034c6ed0d73e62f268e8eb19c10 diff --git a/6a/1a50893fe43034c6ed0d73e62f268e8eb19c10 b/6a/1a50893fe43034c6ed0d73e62f268e8eb19c10 new file mode 100644 index 000000000..a852f7e1e --- /dev/null +++ b/6a/1a50893fe43034c6ed0d73e62f268e8eb19c10 @@ -0,0 +1,149 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 02315431FC4 + for ; Thu, 29 Jan 2015 12:57:21 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 2.639 +X-Spam-Level: ** +X-Spam-Status: No, score=2.639 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + DNS_FROM_AHBL_RHSBL=2.438, FREEMAIL_ENVFROM_END_DIGIT=1, + FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 5P4cOkqLxE9u for ; + Thu, 29 Jan 2015 12:57:18 -0800 (PST) +Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com + [209.85.220.41]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 4FB4C431FBC + for ; Thu, 29 Jan 2015 12:57:18 -0800 (PST) +Received: by mail-pa0-f41.google.com with SMTP id kq14so43466183pab.0 + for ; Thu, 29 Jan 2015 12:57:17 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:subject:in-reply-to:references:user-agent:date:message-id + :mime-version:content-type; + bh=a+/W2XR96WoBZymwOdoEpTm4q6g5/hbTj4k2Z+hMlvo=; + b=RRtVXcCP0Oat/R4JGfD8iZ4tsKHbO7QXo+h1dOeVz9d27xWwfal89bGCE+QB9di1Eg + sjERZbO+CX5c/YAnmTuTzZAOZqrTvoBGx8yI1Op+IH1RW9/tUx0wvJidYMDEt2mPFrqm + PKgJXHCx0tHy7sQ4UewUvujpHCbFg3uP1auFVe3f+k/1MtNE1PZum8jZ/YcXETYjlgWe + HmI61d0Bcuyra0JYLmoJvAeFO9q1PXhUXYrgr8uKGqlsIfn/2Z5KrJV/EvddQNq5ur2C + GCLKih2NSK63G3yHtwlUhuHx4df5KeMXjDPMCY/8Q30O0txo+nTHkOtD7hHfmi1sOQwo + g3ag== +X-Received: by 10.70.93.97 with SMTP id ct1mr3567370pdb.71.1422565036991; + Thu, 29 Jan 2015 12:57:16 -0800 (PST) +Received: from localhost ([24.130.61.213]) + by mx.google.com with ESMTPSA id tu7sm8757187pac.6.2015.01.29.12.57.16 + (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Thu, 29 Jan 2015 12:57:16 -0800 (PST) +From: Jinwoo Lee +To: Tomi Ollila , David Bremner , + notmuch@notmuchmail.org +Subject: Re: [PATCH] Add a defcustom for whether to block remote images by + default. +In-Reply-To: +References: <1422495572-40384-1-git-send-email-jinwoo68@gmail.com> + <87pp9yjbhw.fsf@maritornes.cs.unb.ca> + + + +User-Agent: Notmuch/0.18.1 (http://notmuchmail.org) Emacs/24.4.1 + (x86_64-apple-darwin13.2.0) +Date: Thu, 29 Jan 2015 12:57:14 -0800 +Message-ID: +MIME-Version: 1.0 +Content-Type: text/plain +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Thu, 29 Jan 2015 20:57:22 -0000 + +On Thu, Jan 29, 2015 at 12:25 PM, Tomi Ollila wrote: +> On Thu, Jan 29 2015, Jinwoo Lee wrote: +> +>> On Thu, Jan 29, 2015 at 12:58 AM, Tomi Ollila wrote: +>>> On Thu, Jan 29 2015, David Bremner wrote: +>>> +>>>> Jinwoo Lee writes: +>>>> +>>>>> + (shr-blocked-images (if notmuch-show-block-remote-images +>>>>> + "." +>>>>> + shr-blocked-images))) +>>>>> (shr-insert-document dom) +>>>>> t)) +>>>> +>>>> Ideally such a customization would apply to all html renders. I think +>>>> Tomi did some experiments with w3m and friends, I _think_ they respect +>>>> gnus-blocked-images, but maybe Tomi can comment. +>>> +>>> I did M-x debug-on-entry RET open-network-stream RET (or an equivalent of +>>> t that in elisp, but the code I did is now lost & forgotten ;/ +>>> +>>> The docstring relevant to the renderers below it at the end of this email. +>>> +>>> 'gnus-w3m respect gnus-blocked-images +>>> +>>> I could not run 'w3m on that system... nor 'w3 +>>> +>>> There was no effect with 'w3m-standalone -- in this case I'd think it is up +>>> to w3m binary to load external stuff or not. I presume the same is the +>>> case with 'links, 'lynx, 'html2text and nil +>>> +>>> So, to add to David's suggestion maybe just set both gnus-blocked-images +>>> and shr-blocked-images to the value of +>>> notmuch-show-text/html-blocked-images +>> +>> All right. I sent another patch that does this. Thanks, guys! +> +> Thanks for your contribution. You seem to have taken my suggestion +> literally just that it IIRC now only sets those when using shr renderer -- +> setting of gnus-blocked images should be in other code path... i am not +> sure though i am sending this using mobile phi0one terminal and checking +> for sure is just too PITA ;\ + +Ouch. I was stupid. I'll send an update soon. + +> +> Tomi +> +>> +>>> +>>> +>>> Tomi +>>> +>>> +>>> mm-text-html-renderer is a variable defined in `mm-decode.el'. +>>> Its value is shr +>>> +>>> Documentation: +>>> Render of HTML contents. +>>> It is one of defined renderer types, or a rendering function. +>>> The defined renderer types are: +>>> `shr': use the built-in Gnus HTML renderer; +>>> `gnus-w3m': use Gnus renderer based on w3m; +>>> `w3m': use emacs-w3m; +>>> `w3m-standalone': use plain w3m; +>>> `links': use links; +>>> `lynx': use lynx; +>>> `w3': use Emacs/W3; +>>> `html2text': use html2text; +>>> nil : use external viewer (default web browser). +>>> +>>> +>>>> d +>> _______________________________________________ +>> notmuch mailing list +>> notmuch@notmuchmail.org +>> http://notmuchmail.org/mailman/listinfo/notmuch -- 2.26.2