Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 3f / 94729f32cd652788af5b995716f8529a169c3a
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 1C440431FBD\r
6         for <notmuch@notmuchmail.org>; Mon, 24 Mar 2014 13:39:10 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         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 rMBLGB8lg0Uh for <notmuch@notmuchmail.org>;\r
16         Mon, 24 Mar 2014 13:39:02 -0700 (PDT)\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 78EA0431FB6\r
19         for <notmuch@notmuchmail.org>; Mon, 24 Mar 2014 13:39:02 -0700 (PDT)\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
21         by guru.guru-group.fi (Postfix) with ESMTP id 38E191000E5;\r
22         Mon, 24 Mar 2014 22:38:51 +0200 (EET)\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>\r
24 To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org\r
25 Subject: Re: [PATCH 2/2] emacs: Use whitelist instead of blacklist for term\r
26         escaping\r
27 In-Reply-To: <1394576394-12816-2-git-send-email-amdragon@mit.edu>\r
28 References: <1394576394-12816-1-git-send-email-amdragon@mit.edu>\r
29         <1394576394-12816-2-git-send-email-amdragon@mit.edu>\r
30 User-Agent: Notmuch/0.17+156~g1203750 (http://notmuchmail.org) Emacs/24.3.1\r
31         (x86_64-unknown-linux-gnu)\r
32 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
33         $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
34         !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
35 Date: Mon, 24 Mar 2014 22:38:50 +0200\r
36 Message-ID: <m2ob0vs55x.fsf@guru.guru-group.fi>\r
37 MIME-Version: 1.0\r
38 Content-Type: text/plain\r
39 X-BeenThere: notmuch@notmuchmail.org\r
40 X-Mailman-Version: 2.1.13\r
41 Precedence: list\r
42 List-Id: "Use and development of the notmuch mail system."\r
43         <notmuch.notmuchmail.org>\r
44 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
45         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
47 List-Post: <mailto:notmuch@notmuchmail.org>\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
49 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
51 X-List-Received-Date: Mon, 24 Mar 2014 20:39:10 -0000\r
52 \r
53 On Wed, Mar 12 2014, Austin Clements <amdragon@MIT.EDU> wrote:\r
54 \r
55 > Previously, the term escaper used a blacklist of characters that\r
56 > needed escaping.  This blacklist turned out to be somewhat incomplete;\r
57 > for example, it did not contain non-whitespace ASCII control\r
58 > characters or Unicode "fancy quotes", both of which do require the\r
59 > term to be escaped.\r
60 >\r
61 > Switch to a whitelist of characters that are definitely safe to leave\r
62 > unquoted.  This fixes the broken test introduced by the previous\r
63 > patch.\r
64 > ---\r
65 \r
66 LGTM.\r
67 \r
68 Tomi\r
69 \r
70 >  emacs/notmuch-lib.el | 5 ++++-\r
71 >  test/T310-emacs.sh   | 1 -\r
72 >  2 files changed, 4 insertions(+), 2 deletions(-)\r
73 >\r
74 > diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el\r
75 > index 2fefdad..b071b2f 100644\r
76 > --- a/emacs/notmuch-lib.el\r
77 > +++ b/emacs/notmuch-lib.el\r
78 > @@ -426,7 +426,10 @@ user-friendly queries."\r
79 >  \r
80 >    (save-match-data\r
81 >      (if (or (equal term "")\r
82 > -         (string-match "[ ()]\\|^\"" term))\r
83 > +         ;; To be pessimistic, only pass through terms composed\r
84 > +         ;; entirely of ASCII printing characters other than ", (,\r
85 > +         ;; and ).\r
86 > +         (string-match "[^!#-'*-~]" term))\r
87 >       ;; Requires escaping\r
88 >       (concat "\"" (replace-regexp-in-string "\"" "\"\"" term t t) "\"")\r
89 >        term)))\r
90 > diff --git a/test/T310-emacs.sh b/test/T310-emacs.sh\r
91 > index 6c18bbd..ac966e5 100755\r
92 > --- a/test/T310-emacs.sh\r
93 > +++ b/test/T310-emacs.sh\r
94 > @@ -954,7 +954,6 @@ output=$(notmuch search --output=messages 'tag:search-global-race-tag')\r
95 >  test_expect_equal "$output" "id:$gen_msg_id_1"\r
96 >  \r
97 >  test_begin_subtest "Term escaping"\r
98 > -test_subtest_known_broken\r
99 >  output=$(test_emacs "(mapcar 'notmuch-escape-boolean-term (list\r
100 >       \"\"\r
101 >       \"abc\`~\!@#\$%^&*-=_+123\"\r
102 > -- \r
103 > 1.8.4.rc3\r
104 >\r
105 > _______________________________________________\r
106 > notmuch mailing list\r
107 > notmuch@notmuchmail.org\r
108 > http://notmuchmail.org/mailman/listinfo/notmuch\r