--- /dev/null
+Return-Path: <dme@dme.org>\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 767AB431FC9\r
+ for <notmuch@notmuchmail.org>; Thu, 22 Jan 2015 23:21:51 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 1.739\r
+X-Spam-Level: *\r
+X-Spam-Status: No, score=1.739 tagged_above=-999 required=5\r
+ tests=[DNS_FROM_AHBL_RHSBL=2.438, RCVD_IN_DNSWL_LOW=-0.7,\r
+ UNPARSEABLE_RELAY=0.001] 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 hPiP5WAt5Uox for <notmuch@notmuchmail.org>;\r
+ Thu, 22 Jan 2015 23:21:48 -0800 (PST)\r
+Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com\r
+ [74.125.82.50]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client\r
+ certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
+ E4869431FBC for <notmuch@notmuchmail.org>; Thu, 22 Jan 2015 23:21:47 -0800\r
+ (PST)\r
+Received: by mail-wg0-f50.google.com with SMTP id b13so5800777wgh.9\r
+ for <notmuch@notmuchmail.org>; Thu, 22 Jan 2015 23:21:45 -0800 (PST)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:to:subject:in-reply-to:references:user-agent\r
+ :from:date:message-id:mime-version:content-type;\r
+ bh=ZWkq4RgDijFIFhWnPzuaOUtP0AiINqFRJw7h3U8rqKY=;\r
+ b=AyHISFp1x66MPgeD95O1QL2swJKYE61yjHkWzOjoqXTP2FgGrVGGcmRZ4YgZYq3m+q\r
+ WPE8kov10m14OnK9YU8dz8810rsxPs8mjUyMpC9Fie6Zd4+OelRTEOpqDRXXhFYyES1S\r
+ Z7rjRx1z79RFpksQQsGEBXTPs8laPJXf7Hsvlgrh1N7i6grRWzhlfifdqHHfAW61/JpK\r
+ noQu4K641Ambpc2JWGHpuhQ/99CLGTWYgEdmXIPMnXf4thVC2fGFG5AGtaTPdnlp1ge7\r
+ bG9i5u50Je6jfyeAfX+pk+oDG2yi57pCvPlMLiJR+Ol4Nw+ZpxA/dXTeTwOfyz6OcdzX\r
+ 3OXw==\r
+X-Gm-Message-State:\r
+ ALoCoQmFACvyd8hkO6Vj5Z99cLBuMAMplLCjAuDC7j0Z2lNhidpox6jLQpT+JakSvYGRV/NN6KXr\r
+X-Received: by 10.194.120.40 with SMTP id kz8mr10658929wjb.21.1421997704085;\r
+ Thu, 22 Jan 2015 23:21:44 -0800 (PST)\r
+Received: from disaster-area.hh.sledj.net\r
+ ([2a01:348:1a2:1:ea39:35ff:fe2c:a227])\r
+ by mx.google.com with ESMTPSA id ei5sm639444wid.2.2015.01.22.23.21.42\r
+ (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Thu, 22 Jan 2015 23:21:42 -0800 (PST)\r
+Received: from localhost (30000@localhost [local]);\r
+ by localhost (OpenSMTPD) with ESMTPA id 2b5df55d;\r
+ Fri, 23 Jan 2015 07:21:41 +0000 (UTC)\r
+To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] emacs: show: allow user to hide some mime types by\r
+ default.\r
+In-Reply-To: <1421960852-26424-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1421960852-26424-1-git-send-email-markwalters1009@gmail.com>\r
+User-Agent: none\r
+From: David Edmondson <dme@dme.org>\r
+Date: Fri, 23 Jan 2015 07:21:41 +0000\r
+Message-ID: <cun8ugu3qt6.fsf@gargravarr.hh.sledj.net>\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: Fri, 23 Jan 2015 07:21:51 -0000\r
+\r
+On Thu, Jan 22 2015, Mark Walters wrote:\r
+> This commit adds a customize variable that allows the user to choose\r
+> to hide some mime types by default. They can still choose to view the\r
+> part by toggling the part button.\r
+>\r
+> One use is for hiding all text/html parts. This would mean that some\r
+> explicit user action was required before the part was loaded which\r
+> would mitigate some of the problems of remote image loading by the\r
+> emacs html renderer as detailed by dkg in\r
+> id:87ppa7q25w.fsf@alice.fifthhorseman.net.\r
+\r
+Whilst I think that having this knob is a good thing, I don't think that\r
+it's a solution to the 'text/html renderers access the network'\r
+problem. I can't sensibly (and don't wish to) disable the display of\r
+text/html parts by default (colleagues generate too many text/html\r
+messages to make that feasible, and I have rss2imap generate a bunch of\r
+text/html messages that I want to see in their full glory), but would\r
+definitely like to choose whether a message can sell me out to\r
+advertisers.\r
+\r
+I'm trying to say that this is good, but let's not get into the habit of\r
+telling someone that complains about network access that adding\r
+text/html to `notmuch-show-always-hide-types' is the solution.\r
+\r
+> ---\r
+>\r
+> I think this might be useful anyway (dkg asked for it before he found\r
+> the bug) but seems particularly relevant now.\r
+>\r
+> To use set the variable notmuch-show-always-hide-types to '(text/html)\r
+> or use the customize setting to add text/html to the list.\r
+>\r
+> Given the lack of control we have over the emacs renderers (so\r
+> possibility of future problems) we could even set this by default.\r
+>\r
+> Best wishes\r
+>\r
+> Mark\r
+>\r
+> emacs/notmuch-show.el | 18 +++++++++++++++++-\r
+> 1 file changed, 17 insertions(+), 1 deletion(-)\r
+>\r
+> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+> index 9f6fe07..8f49f17 100644\r
+> --- a/emacs/notmuch-show.el\r
+> +++ b/emacs/notmuch-show.el\r
+> @@ -234,6 +234,15 @@ every user interaction with notmuch."\r
+> :type 'function\r
+> :group 'notmuch-show)\r
+> \r
+> +(defcustom notmuch-show-always-hide-types nil\r
+> + "List of mime types that should always be hidden.\r
+> +\r
+> +This is a list of mime types that should be initally displayed in\r
+> +the show buffer as hidden parts; they can be displayed by\r
+> +toggling the part button. Wildcards are allowed in the list."\r
+> + :type '(repeat string)\r
+> + :group 'notmuch-show)\r
+> +\r
+> (defmacro with-current-notmuch-show-message (&rest body)\r
+> "Evaluate body with current buffer set to the text of current message"\r
+> `(save-excursion\r
+> @@ -798,6 +807,12 @@ message at DEPTH in the current thread."\r
+> (intern (concat "notmuch-show-insert-part-" content-type))))\r
+> result))\r
+> \r
+> +(defun notmuch-show-always-hide (mime-type)\r
+> + "Is mime-type in notmuch-show-always-hide-types"\r
+> + (let (match)\r
+> + (dolist (type notmuch-show-always-hide-types match)\r
+> + (setq match (or match (notmuch-match-content-type mime-type type))))))\r
+> +\r
+> ;; \f\r
+\r
+> \r
+> (defun notmuch-show-insert-bodypart-internal (msg part content-type nth depth button)\r
+> @@ -900,7 +915,8 @@ useful for quoting in replies)."\r
+> (nth (plist-get part :id))\r
+> (beg (point))\r
+> ;; Hide the part initially if HIDE is t.\r
+> - (show-part (not (equal hide t)))\r
+> + (show-part (and (not (equal hide t))\r
+> + (not (notmuch-show-always-hide mime-type))))\r
+> ;; We omit the part button for the first (or only) part if\r
+> ;; this is text/plain, or HIDE is 'no-buttons.\r
+> (button (unless (or (equal hide 'no-buttons)\r
+> -- \r
+> 2.1.4\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r