Re: [PATCH] Add a defcustom for whether to block remote images by default.
authorJinwoo Lee <jinwoo68@gmail.com>
Thu, 29 Jan 2015 17:31:10 +0000 (09:31 +1600)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 21:47:53 +0000 (14:47 -0700)
4c/97669f8514ec827c2d2a373f51aa9b5bba3a19 [new file with mode: 0644]

diff --git a/4c/97669f8514ec827c2d2a373f51aa9b5bba3a19 b/4c/97669f8514ec827c2d2a373f51aa9b5bba3a19
new file mode 100644 (file)
index 0000000..a195a1e
--- /dev/null
@@ -0,0 +1,128 @@
+Return-Path: <jinwoo68@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id C87AA431FC9\r
+       for <notmuch@notmuchmail.org>; Thu, 29 Jan 2015 09:31:15 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 2.639\r
+X-Spam-Level: **\r
+X-Spam-Status: No, score=2.639 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       DNS_FROM_AHBL_RHSBL=2.438, FREEMAIL_ENVFROM_END_DIGIT=1,\r
+       FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id AjrF4HlOC0Pj for <notmuch@notmuchmail.org>;\r
+       Thu, 29 Jan 2015 09:31:12 -0800 (PST)\r
+Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com\r
+       [209.85.220.51]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 36C27431FC4\r
+       for <notmuch@notmuchmail.org>; Thu, 29 Jan 2015 09:31:12 -0800 (PST)\r
+Received: by mail-pa0-f51.google.com with SMTP id fb1so41640446pad.10\r
+       for <notmuch@notmuchmail.org>; Thu, 29 Jan 2015 09:31:10 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
+       :mime-version:content-type;\r
+       bh=SQCWQA4M1BjlxIXjaa5k7cIySCYn/eKhXs+JWs5N6TY=;\r
+       b=VBaMZTruIc29S4baYDMsIQH+zuDlVQxZPlDKXATYSmZYVG1YLnPwpJ//NSy0m2PbYy\r
+       90ZBwzXHQBfiwtRwXiSQgQXZ4M7lrF77MsSls8IZPc5NBJz2nNmQo+KmMyug/KcpwdZh\r
+       RCyjJleHZKR9MQOycabyUb9cTcnAcNTOf7S/k/vhmV2HTFPoHujVxMxkMhOem7O8KfmX\r
+       GZJKxrrMKIzgW1Jt7RZhOz37pxlHx8VcKyhAShxXGo+FQva33YcRyox+SM65ITOz0obP\r
+       K4dqE9NOXKjsxzcBz5CMEgkt7jccJSdEN0hOoLu9SVuVN3ig/+iu1gQkcNaW3Tb4f0V8\r
+       wPDw==\r
+X-Received: by 10.70.37.104 with SMTP id x8mr2142891pdj.119.1422552670434;\r
+       Thu, 29 Jan 2015 09:31:10 -0800 (PST)\r
+Received: from localhost ([2601:9:5d00:15b9:9997:a9cd:4a6a:40f0])\r
+       by mx.google.com with ESMTPSA id bq7sm8354992pdb.50.2015.01.29.09.31.09\r
+       (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+       Thu, 29 Jan 2015 09:31:09 -0800 (PST)\r
+From: Jinwoo Lee <jinwoo68@gmail.com>\r
+To: Tomi Ollila <tomi.ollila@iki.fi>, David Bremner <david@tethera.net>,\r
+       notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] Add a defcustom for whether to block remote images by\r
+       default.\r
+In-Reply-To: <m2sieut13t.fsf@guru.guru-group.fi>\r
+References: <1422495572-40384-1-git-send-email-jinwoo68@gmail.com>\r
+       <87pp9yjbhw.fsf@maritornes.cs.unb.ca>\r
+       <m2sieut13t.fsf@guru.guru-group.fi>\r
+User-Agent: Notmuch/0.18.1 (http://notmuchmail.org) Emacs/24.4.1\r
+       (x86_64-apple-darwin13.2.0)\r
+Date: Thu, 29 Jan 2015 09:31:10 -0800\r
+Message-ID: <yq65mw51h4td.fsf@jinwoo-macbookair.roam.corp.google.com>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 29 Jan 2015 17:31:15 -0000\r
+\r
+On Thu, Jan 29, 2015 at 12:58 AM, Tomi Ollila <tomi.ollila@iki.fi> wrote:\r
+> On Thu, Jan 29 2015, David Bremner <david@tethera.net> wrote:\r
+>\r
+>> Jinwoo Lee <jinwoo68@gmail.com> writes:\r
+>>\r
+>>> +  (shr-blocked-images (if notmuch-show-block-remote-images\r
+>>> +                          "."\r
+>>> +                        shr-blocked-images)))\r
+>>>      (shr-insert-document dom)\r
+>>>      t))\r
+>>\r
+>> Ideally such a customization would apply to all html renders. I think\r
+>> Tomi did some experiments with w3m and friends, I _think_ they respect\r
+>> gnus-blocked-images, but maybe Tomi can comment.\r
+>\r
+> I did M-x debug-on-entry RET open-network-stream RET  (or an equivalent of\r
+> t that in elisp, but the code I did is now lost & forgotten ;/\r
+>\r
+> The docstring relevant to the renderers below it at the end of this email.\r
+>\r
+> 'gnus-w3m respect gnus-blocked-images\r
+>\r
+> I could not run 'w3m on that system... nor 'w3\r
+>\r
+> There was no effect with 'w3m-standalone -- in this case I'd think it is up\r
+> to w3m binary to load external stuff or not. I presume the same is the\r
+> case with 'links, 'lynx, 'html2text and nil\r
+>\r
+> So, to add to David's suggestion maybe just set both gnus-blocked-images\r
+> and shr-blocked-images to the value of\r
+> notmuch-show-text/html-blocked-images\r
+\r
+All right.  I sent another patch that does this.  Thanks, guys!\r
+\r
+>\r
+>\r
+> Tomi\r
+>\r
+>\r
+> mm-text-html-renderer is a variable defined in `mm-decode.el'.\r
+> Its value is shr\r
+>\r
+> Documentation:\r
+> Render of HTML contents.\r
+> It is one of defined renderer types, or a rendering function.\r
+> The defined renderer types are:\r
+> `shr': use the built-in Gnus HTML renderer;\r
+> `gnus-w3m': use Gnus renderer based on w3m;\r
+> `w3m': use emacs-w3m;\r
+> `w3m-standalone': use plain w3m;\r
+> `links': use links;\r
+> `lynx': use lynx;\r
+> `w3': use Emacs/W3;\r
+> `html2text': use html2text;\r
+> nil    : use external viewer (default web browser).\r
+>\r
+>\r
+>> d\r