[PATCH 9/9] add has: query prefix to search for specific properties
[notmuch-archives.git] / 7b / 9045f89baf5978a5848f126d45585f7e5282ed
1 Return-Path: <tomi.ollila@iki.fi>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 2F5A9431FC2\r
6         for <notmuch@notmuchmail.org>; Sun,  1 Feb 2015 13:41:22 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 2.438\r
10 X-Spam-Level: **\r
11 X-Spam-Status: No, score=2.438 tagged_above=-999 required=5\r
12         tests=[DNS_FROM_AHBL_RHSBL=2.438] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id 8MOyhAOGzPPi for <notmuch@notmuchmail.org>;\r
16         Sun,  1 Feb 2015 13:41:19 -0800 (PST)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id D90FB431FC0\r
19         for <notmuch@notmuchmail.org>; Sun,  1 Feb 2015 13:41:18 -0800 (PST)\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
21         by guru.guru-group.fi (Postfix) with ESMTP id 3164810004A;\r
22         Sun,  1 Feb 2015 23:40:53 +0200 (EET)\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>\r
24 To: Jinwoo Lee <jinwoo68@gmail.com>, notmuch@notmuchmail.org\r
25 Subject: Re: [PATCH] emacs: Add a defcustom that specifies regexp for\r
26         blocked remote images.\r
27 In-Reply-To: <1422567352-32647-1-git-send-email-jinwoo68@gmail.com>\r
28 References: <1422567352-32647-1-git-send-email-jinwoo68@gmail.com>\r
29 User-Agent: Notmuch/0.19+53~gb45d2f9 (http://notmuchmail.org) Emacs/24.3.1\r
30         (x86_64-unknown-linux-gnu)\r
31 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
32         $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
33         !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
34 Date: Sun, 01 Feb 2015 23:40:52 +0200\r
35 Message-ID: <m2h9v5paxn.fsf@guru.guru-group.fi>\r
36 MIME-Version: 1.0\r
37 Content-Type: text/plain\r
38 X-BeenThere: notmuch@notmuchmail.org\r
39 X-Mailman-Version: 2.1.13\r
40 Precedence: list\r
41 List-Id: "Use and development of the notmuch mail system."\r
42         <notmuch.notmuchmail.org>\r
43 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
46 List-Post: <mailto:notmuch@notmuchmail.org>\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
48 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
50 X-List-Received-Date: Sun, 01 Feb 2015 21:41:22 -0000\r
51 \r
52 On Thu, Jan 29 2015, Jinwoo Lee <jinwoo68@gmail.com> wrote:\r
53 \r
54 > It's default value is ".", meaning all remote images will be blocked\r
55 > by default.\r
56 >\r
57 > ---\r
58 > This time setting gnus-blocked-images from the correct place.\r
59 > ---\r
60 >  emacs/notmuch-show.el | 23 ++++++++++++++++++-----\r
61 >  1 file changed, 18 insertions(+), 5 deletions(-)\r
62 >\r
63 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
64 > index 66350d4..6f38e0c 100644\r
65 > --- a/emacs/notmuch-show.el\r
66 > +++ b/emacs/notmuch-show.el\r
67 > @@ -136,6 +136,11 @@ indentation."\r
68 >    :type 'boolean\r
69 >    :group 'notmuch-show)\r
70 >  \r
71 > +(defcustom notmuch-show-text/html-blocked-images "."\r
72 > +  "Remote images that have URLs matching this regexp will be blocked."\r
73 > +  :type '(choice (const nil) regexp)\r
74 > +  :group 'notmuch-show)\r
75 > +\r
76 >  (defvar notmuch-show-thread-id nil)\r
77 >  (make-variable-buffer-local 'notmuch-show-thread-id)\r
78 >  (put 'notmuch-show-thread-id 'permanent-local t)\r
79 > @@ -798,16 +803,24 @@ will return nil if the CID is unknown or cannot be retrieved."\r
80 >          ;; URL-decode it (see RFC 2392).\r
81 >          (let ((cid (url-unhex-string url)))\r
82 >            (first (notmuch-show--get-cid-content cid)))))\r
83 > -     ;; Block all external images to prevent privacy leaks and\r
84 > -     ;; potential attacks.  FIXME: If we block an image, offer a\r
85 > -     ;; button to load external images.\r
86 > -     (shr-blocked-images "."))\r
87 > +     ;; By default, block all external images to prevent privacy\r
88 > +     ;; leaks and potential attacks.  FIXME: If we block an image,\r
89 > +     ;; offer a button to load external images.\r
90 \r
91 This comment looks little weird; maybe the "Block all external images to\r
92 prevent privacy leaks and potential attacks." part could be moved to\r
93 the defcustom part and leave the FIXME part here \r
94 \r
95 > +     (shr-blocked-images notmuch-show-text/html-blocked-images))\r
96 >      (shr-insert-document dom)\r
97 >      t))\r
98 >  \r
99 >  (defun notmuch-show-insert-part-*/* (msg part content-type nth depth button)\r
100 >    ;; This handler _must_ succeed - it is the handler of last resort.\r
101 > -  (notmuch-mm-display-part-inline msg part content-type notmuch-show-process-crypto)\r
102 > +\r
103 > +  ;; By default, block all external images to prevent privacy leaks\r
104 > +  ;; and potential attacks.  FIXME: If we block an image, offer a\r
105 > +  ;; button to load external images.\r
106 > +  ;; Note that GNUS-BLOCKED-IMAGES is effective only when\r
107 > +  ;; MM-TEXT-HTML-RENDERER is 'gnus-w3m.\r
108 \r
109 This last statement should be dropped unless we know for sure that this\r
110 is exact -- and rest (sans FIXME) can go to the defcustom...\r
111 \r
112 ... and to me, it looks like this is not the most suitable place for this\r
113 setting; easiest is to drop it into  notmuch-show-insert-part-text/html\r
114 so it is in the same context as the shr. Alternative is to put it to\r
115 the earlier place in insert-part handling (or later,\r
116 i.e. notmuch-mm-display-part-inline )\r
117 \r
118 > +  (let ((gnus-blocked-images notmuch-show-text/html-blocked-images))\r
119 > +    (notmuch-mm-display-part-inline msg part content-type\r
120 > +                                 notmuch-show-process-crypto))\r
121 >    t)\r
122 \r
123 Tomi\r
124 \r
125 >  \r
126 >  ;; Functions for determining how to handle MIME parts.\r
127 > -- \r
128 > 2.2.2\r