1 Return-Path: <amdragon@mit.edu>
\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 1B7DC431FDA
\r
6 for <notmuch@notmuchmail.org>; Tue, 11 Mar 2014 15:20:19 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 aQuQ3lyH0dvs for <notmuch@notmuchmail.org>;
\r
16 Tue, 11 Mar 2014 15:20:15 -0700 (PDT)
\r
17 Received: from dmz-mailsec-scanner-8.mit.edu (dmz-mailsec-scanner-8.mit.edu
\r
19 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 560E8431FBF
\r
22 for <notmuch@notmuchmail.org>; Tue, 11 Mar 2014 15:20:15 -0700 (PDT)
\r
23 X-AuditID: 12074425-f79906d000000cf9-eb-531f8c1b37d9
\r
24 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])
\r
25 (using TLS with cipher AES256-SHA (256/256 bits))
\r
26 (Client did not present a certificate)
\r
27 by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP
\r
28 id 12.8F.03321.B1C8F135; Tue, 11 Mar 2014 18:20:11 -0400 (EDT)
\r
29 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])
\r
30 by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id s2BMK9Pm028026;
\r
31 Tue, 11 Mar 2014 18:20:10 -0400
\r
32 Received: from drake.dyndns.org (31-33-67.wireless.csail.mit.edu
\r
33 [128.31.33.67]) (authenticated bits=0)
\r
34 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
35 by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s2BMK86j024800
\r
36 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
37 Tue, 11 Mar 2014 18:20:09 -0400
\r
38 Received: from amthrax by drake.dyndns.org with local (Exim 4.77)
\r
39 (envelope-from <amdragon@mit.edu>)
\r
40 id 1WNV1r-0003Ma-Mb; Tue, 11 Mar 2014 18:20:07 -0400
\r
41 From: Austin Clements <amdragon@MIT.EDU>
\r
42 To: notmuch@notmuchmail.org
\r
43 Subject: [PATCH 2/2] emacs: Use whitelist instead of blacklist for term
\r
45 Date: Tue, 11 Mar 2014 18:19:54 -0400
\r
46 Message-Id: <1394576394-12816-2-git-send-email-amdragon@mit.edu>
\r
47 X-Mailer: git-send-email 1.8.4.rc3
\r
48 In-Reply-To: <1394576394-12816-1-git-send-email-amdragon@mit.edu>
\r
49 References: <1394576394-12816-1-git-send-email-amdragon@mit.edu>
\r
50 X-Brightmail-Tracker:
\r
51 H4sIAAAAAAAAA+NgFlrHIsWRmVeSWpSXmKPExsUixG6noivdIx9sMGW7pcX1mzOZHRg9nq26
\r
52 xRzAGMVlk5Kak1mWWqRvl8CV0XxDs+AET8XF+fsYGxgXc3UxcnJICJhIzFqwiB3CFpO4cG89
\r
53 G4gtJDCbSeLyM/0uRi4geyOjRPujiYwQzjEmiR/zZjBDOHMZJf5+28sM0sImoCGxbf9yRhBb
\r
54 REBaYufd2axdjBwczAJqEn+6VEBMYYEAiSkn1EAqWARUJc7/XMoCEuYVcJA4s18d4gYliYWn
\r
55 trGC2JwCjhLT5k5jBikRAiqZudhuAiP/AkaGVYyyKblVurmJmTnFqcm6xcmJeXmpRboWermZ
\r
56 JXqpKaWbGMHB4qK6g3HCIaVDjAIcjEo8vA4K8sFCrIllxZW5hxglOZiURHlndwCF+JLyUyoz
\r
57 Eosz4otKc1KLDzFKcDArifB+1ATK8aYkVlalFuXDpKQ5WJTEefvOSgQLCaQnlqRmp6YWpBbB
\r
58 ZGU4OJQkeJd3ATUKFqWmp1akZeaUIKSZODhBhvMADWfoBhleXJCYW5yZDpE/xagoJc67EKRZ
\r
59 ACSRUZoH1wuL5leM4kCvCPNGgVTxABMBXPcroMFMQIN/BIANLklESEk1MGaoqXiejjzxQ/Sg
\r
60 tdMB7sPL3/N1Htu+ozQj4YHaQ67ebxxuuZka75+0tm2rvNXqVPGD71982Y9d7mdEim7mrbSW
\r
61 +7kxiNHZcdGaQsVZ6u9VM+a0lH0pfZrO+7fh09XDP4VqF7QeuOWS+K2B9Tmr387ic4UM5/NL
\r
62 zlv7zq2Uvcp4b0rUlDSPnUosxRmJhlrMRcWJACcPjBPBAgAA
\r
63 X-BeenThere: notmuch@notmuchmail.org
\r
64 X-Mailman-Version: 2.1.13
\r
66 List-Id: "Use and development of the notmuch mail system."
\r
67 <notmuch.notmuchmail.org>
\r
68 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
69 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
70 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
71 List-Post: <mailto:notmuch@notmuchmail.org>
\r
72 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
73 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
74 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
75 X-List-Received-Date: Tue, 11 Mar 2014 22:20:19 -0000
\r
77 Previously, the term escaper used a blacklist of characters that
\r
78 needed escaping. This blacklist turned out to be somewhat incomplete;
\r
79 for example, it did not contain non-whitespace ASCII control
\r
80 characters or Unicode "fancy quotes", both of which do require the
\r
83 Switch to a whitelist of characters that are definitely safe to leave
\r
84 unquoted. This fixes the broken test introduced by the previous
\r
87 emacs/notmuch-lib.el | 5 ++++-
\r
88 test/T310-emacs.sh | 1 -
\r
89 2 files changed, 4 insertions(+), 2 deletions(-)
\r
91 diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
\r
92 index 2fefdad..b071b2f 100644
\r
93 --- a/emacs/notmuch-lib.el
\r
94 +++ b/emacs/notmuch-lib.el
\r
95 @@ -426,7 +426,10 @@ user-friendly queries."
\r
98 (if (or (equal term "")
\r
99 - (string-match "[ ()]\\|^\"" term))
\r
100 + ;; To be pessimistic, only pass through terms composed
\r
101 + ;; entirely of ASCII printing characters other than ", (,
\r
103 + (string-match "[^!#-'*-~]" term))
\r
104 ;; Requires escaping
\r
105 (concat "\"" (replace-regexp-in-string "\"" "\"\"" term t t) "\"")
\r
107 diff --git a/test/T310-emacs.sh b/test/T310-emacs.sh
\r
108 index 6c18bbd..ac966e5 100755
\r
109 --- a/test/T310-emacs.sh
\r
110 +++ b/test/T310-emacs.sh
\r
111 @@ -954,7 +954,6 @@ output=$(notmuch search --output=messages 'tag:search-global-race-tag')
\r
112 test_expect_equal "$output" "id:$gen_msg_id_1"
\r
114 test_begin_subtest "Term escaping"
\r
115 -test_subtest_known_broken
\r
116 output=$(test_emacs "(mapcar 'notmuch-escape-boolean-term (list
\r
118 \"abc\`~\!@#\$%^&*-=_+123\"
\r