[PATCH] configure: add --without-api-docs option
[notmuch-archives.git] / 85 / 7911973159c7b607595a4aa40201952b4ce9a4
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 E8FE5431FBC\r
6         for <notmuch@notmuchmail.org>; Mon, 29 Oct 2012 17:57:04 -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.7\r
10 X-Spam-Level: \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 e92pv-mW90u4 for <notmuch@notmuchmail.org>;\r
16         Mon, 29 Oct 2012 17:57:04 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-5.mit.edu (DMZ-MAILSEC-SCANNER-5.MIT.EDU\r
18         [18.7.68.34])\r
19         by olra.theworths.org (Postfix) with ESMTP id 52518431FAF\r
20         for <notmuch@notmuchmail.org>; Mon, 29 Oct 2012 17:57:04 -0700 (PDT)\r
21 X-AuditID: 12074422-b7f746d0000008cc-be-508f25dffbfc\r
22 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
23         by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id ED.08.02252.FD52F805; Mon, 29 Oct 2012 20:57:03 -0400 (EDT)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q9U0v20K005649; \r
27         Mon, 29 Oct 2012 20:57:03 -0400\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
29         (authenticated bits=0)\r
30         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
31         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q9U0v0Hl022083\r
32         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
33         Mon, 29 Oct 2012 20:57:01 -0400 (EDT)\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
35         (envelope-from <amdragon@mit.edu>)\r
36         id 1TT08a-00020w-KW; Mon, 29 Oct 2012 20:57:00 -0400\r
37 Date: Mon, 29 Oct 2012 20:57:00 -0400\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: James Vasile <james@hackervisions.org>\r
40 Subject: Re: [PATCH] don't show x-foo tags in search view\r
41 Message-ID: <20121030005700.GE15377@mit.edu>\r
42 References: <87fw4x3y3e.fsf@hackervisions.org>\r
43         <87liepw0b4.fsf@convex-new.cs.unb.ca>\r
44         <87625tc6xd.fsf@hackervisions.org>\r
45 MIME-Version: 1.0\r
46 Content-Type: text/plain; charset=us-ascii\r
47 Content-Disposition: inline\r
48 In-Reply-To: <87625tc6xd.fsf@hackervisions.org>\r
49 User-Agent: Mutt/1.5.21 (2010-09-15)\r
50 X-Brightmail-Tracker:\r
51  H4sIAAAAAAAAA+NgFupileLIzCtJLcpLzFFi42IRYrdT172v2h9gsPutvsWN1m5Gi//N1RbX\r
52         b85kdmD2mNT1jMnj2apbzB5bDr1nDmCO4rJJSc3JLEst0rdL4MrombScqaBHuuL7gXmMDYxb\r
53         hLoYOTgkBEwkTv3L7GLkBDLFJC7cW8/WxcjFISSwj1HiWu8GVghnA6PEqvtnWEGqhAROMklc\r
54         meAEkVjCKHH3USMbSIJFQFVi9aUuFhCbTUBDYtv+5YwgtoiAlsTK8/PAbGaBOIm2ztssIJuF\r
55         BSwlej7Fg4R5BXQk2s4sZYGYXy1x/8JFNoi4oMTJmU9YIFq1JG78e8kE0sosIC2x/B8HSJhT\r
56         QF/i5e5jYOWiAioSU05uY5vAKDQLSfcsJN2zELoXMDKvYpRNya3SzU3MzClOTdYtTk7My0st\r
57         0jXVy80s0UtNKd3ECA5yF6UdjD8PKh1iFOBgVOLh3bCmL0CINbGsuDL3EKMkB5OSKG+bcn+A\r
58         EF9SfkplRmJxRnxRaU5q8SFGCQ5mJRHenzeBynlTEiurUovyYVLSHCxK4rzXUm76CwmkJ5ak\r
59         ZqemFqQWwWRlODiUJHg3qwANFSxKTU+tSMvMKUFIM3FwggznARp+DqSGt7ggMbc4Mx0if4pR\r
60         UUqctwLkIgGQREZpHlwvLAm9YhQHekWYdw9IOw8wgcF1vwIazAQ0WIevF2RwSSJCSqqBsUPl\r
61         f7WX5myNb6zOjrec9becnR2jrzSz/MVZ4/UGUVWt+6/vfnfq1vObBaW3l5SZ6M//uGtl6udn\r
62         arPEjYov6J+0V57UuOiYw6TANSwX+Zb/41qXsTuL68iK5ut8V5LCNCfN3vdlgky5p5HP4YfH\r
63         ww38z+xW2Zx3ftlNsaOnFC7/vnfT95Qi2wolluKMREMt5qLiRAB+nZ8vHQMAAA==\r
64 Cc: notmuch mailing list <notmuch@notmuchmail.org>\r
65 X-BeenThere: notmuch@notmuchmail.org\r
66 X-Mailman-Version: 2.1.13\r
67 Precedence: list\r
68 List-Id: "Use and development of the notmuch mail system."\r
69         <notmuch.notmuchmail.org>\r
70 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
71         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
72 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
73 List-Post: <mailto:notmuch@notmuchmail.org>\r
74 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
75 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
76         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
77 X-List-Received-Date: Tue, 30 Oct 2012 00:57:05 -0000\r
78 \r
79 I like it.\r
80 \r
81 Quoth James Vasile on Oct 29 at  5:19 pm:\r
82 > This patch hides any tags in search view that match the regex specified\r
83 > in `notmuch-search-hide-tag-regex`.  That variable can be set via setq\r
84 > or the customize interface.  To hide all tags that begin with "x-" or\r
85 > "X-", set `notmuch-search-hide-tag-regex` to "^X-".\r
86\r
87 > ---\r
88 >  emacs/notmuch.el |   16 +++++++++++++++-\r
89 >  1 file changed, 15 insertions(+), 1 deletion(-)\r
90\r
91 > diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
92 > index f9454d8..4bff538 100644\r
93 > --- a/emacs/notmuch.el\r
94 > +++ b/emacs/notmuch.el\r
95 > @@ -775,6 +775,14 @@ non-authors is found, assume that all of the authors match."\r
96 >           (overlay-put overlay 'isearch-open-invisible #'delete-overlay)))\r
97 >        (insert padding))))\r
98 >  \r
99 > +(defcustom notmuch-search-hide-tag-regex ""\r
100 > +  "Regex specifying tags to hide in search view.\r
101 \r
102 I have no idea why, but Emacs typically uses "regexp" instead of\r
103 "regex".\r
104 \r
105 > +\r
106 > +Leave blank to disable hiding of tags in search view.\r
107 \r
108 Saying "Leave blank" supposes that the user knows what the default\r
109 value is.  How about "An empty string disables hiding of tags in\r
110 search view."?\r
111 \r
112 Even better, though, would be to use nil to indicate this, since "" is\r
113 a perfectly valid regexp and matches everything.  In that case, this\r
114 should say something like "If nil, no tags will be hidden in search\r
115 view."\r
116 \r
117 > +Note: elisp regexes are case-insensitive"\r
118 \r
119 Likewise, "regexps".  Also, Elisp regexps are not, in general,\r
120 case-insensitive.  If we want to control this, we should bind\r
121 case-fold-search to nil around the string-match below and say\r
122 something here like "Matching is case-insensitive."\r
123 \r
124 > +  :type 'string\r
125 \r
126 Better would be 'regexp.  Or, '(choice (const :tag "None" nil) regexp)\r
127 to allow nil or a regexp.\r
128 \r
129 > +  :group 'notmuch-search)\r
130 > +\r
131 >  (defun notmuch-search-insert-field (field format-string result)\r
132 >    (cond\r
133 >     ((string-equal field "date")\r
134 > @@ -793,7 +801,13 @@ non-authors is found, assume that all of the authors match."\r
135 >      (notmuch-search-insert-authors format-string (plist-get result :authors)))\r
136 >  \r
137 >     ((string-equal field "tags")\r
138 > -    (let ((tags-str (mapconcat 'identity (plist-get result :tags) " ")))\r
139 > +    (let ((tags-str (mapconcat 'identity\r
140 > +                              (delq nil\r
141 > +                                    (mapcar (lambda (x) (if (and (not (equal notmuch-search-hide-tag-regex ""))\r
142 > +                                                                 (string-match notmuch-search-hide-tag-regex x))\r
143 > +                                                            nil\r
144 > +                                                            x)) (plist-get result :tags)))\r
145 > +                              " ")))\r
146 \r
147 It would be simpler and more robust to use remove-if here.  What about\r
148 something like\r
149 \r
150   (let ((tags-str\r
151          (mapconcat 'identity\r
152                     (if notmuch-search-hide-tag-regex\r
153                         (let ((case-fold-search t))\r
154                           (remove-if\r
155                            (apply-partially #'string-match\r
156                                             notmuch-search-hide-tag-regex)\r
157                            (plist-get result :tags)))\r
158                       (plist-get result :tags))\r
159                     " ")))\r
160 \r
161 ?\r
162 \r
163 >        (insert (propertize (format format-string tags-str)\r
164 >                           'face 'notmuch-tag-face))))))\r
165 >  \r