[PATCH] RFC: all deleting all properties with a given key
[notmuch-archives.git] / 63 / 52e9c8c860bf19eb263481203d912960a31ebd
1 Return-Path: <damien.cassou@gmail.com>\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 C6784431FB6\r
6         for <notmuch@notmuchmail.org>; Thu,  8 Nov 2012 05:38:15 -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: -0.799\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id T3owA99tiM8g for <notmuch@notmuchmail.org>;\r
17         Thu,  8 Nov 2012 05:38:14 -0800 (PST)\r
18 Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com\r
19         [209.85.220.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 705D3431FAE\r
22         for <notmuch@notmuchmail.org>; Thu,  8 Nov 2012 05:38:14 -0800 (PST)\r
23 Received: by mail-vc0-f181.google.com with SMTP id n11so2790652vch.26\r
24         for <notmuch@notmuchmail.org>; Thu, 08 Nov 2012 05:38:13 -0800 (PST)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
26         h=mime-version:in-reply-to:references:from:date:message-id:subject:to\r
27         :cc:content-type;\r
28         bh=bKfy1pZ9Gwm5ZUh5/eWD6ySalWJqwUvlCx5cc18UlvU=;\r
29         b=CiJkegTGQc5dbDplI8yqmWBjRh/Clmeu1k7g8EudifSyhqid5p3Vi4QGZ/xzk0czz0\r
30         6IGKX6VhKtht/3mD5t0pd535KogD2CCqazztk95NkjzYWoGWKFjz8xZpzb+ISBfF6U7T\r
31         3G+I72btX+0CJlE/3or2nkuZn56TuMI3AC4cUpSOAUoxCCTb3lNGZG65UbfRqnZlL2X8\r
32         bHg2XdY4VL4TLM2/seVXrmAzwxOCDESma5dDLfDqW4BlmhwKkQMldBFRtSs7zxVH36Fq\r
33         2wkDWcK35WD39R4+wO9f2bq+mc3dHlkq+9J2K8MDuUX6ociQ1rqE4lZBXMLIDUttGWdI\r
34         XCFg==\r
35 Received: by 10.52.100.229 with SMTP id fb5mr6197678vdb.103.1352381893757;\r
36         Thu, 08 Nov 2012 05:38:13 -0800 (PST)\r
37 MIME-Version: 1.0\r
38 Received: by 10.58.143.51 with HTTP; Thu, 8 Nov 2012 05:37:53 -0800 (PST)\r
39 In-Reply-To: <87txt2z5lq.fsf@qmul.ac.uk>\r
40 References: <1352234344-28119-1-git-send-email-damien.cassou@gmail.com>\r
41         <87txt2z5lq.fsf@qmul.ac.uk>\r
42 From: Damien Cassou <damien.cassou@gmail.com>\r
43 Date: Thu, 8 Nov 2012 14:37:53 +0100\r
44 Message-ID:\r
45  <CA+y5ggiEyKgYeDuwB7uAwnERVCaTBe595skYz3wH6E5pExByVA@mail.gmail.com>\r
46 Subject: Re: [PATCH] emacs: display tags in notmuch-show's header-line with\r
47         links to search\r
48 To: Mark Walters <markwalters1009@gmail.com>\r
49 Content-Type: text/plain; charset=ISO-8859-1\r
50 Cc: notmuch mailing list <notmuch@notmuchmail.org>\r
51 X-BeenThere: notmuch@notmuchmail.org\r
52 X-Mailman-Version: 2.1.13\r
53 Precedence: list\r
54 List-Id: "Use and development of the notmuch mail system."\r
55         <notmuch.notmuchmail.org>\r
56 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
57         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
58 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
59 List-Post: <mailto:notmuch@notmuchmail.org>\r
60 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
61 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
62         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
63 X-List-Received-Date: Thu, 08 Nov 2012 13:38:15 -0000\r
64 \r
65 Hi\r
66 \r
67 On Wed, Nov 7, 2012 at 12:14 AM, Mark Walters <markwalters1009@gmail.com> wrote:\r
68 > This is not a full review: just a couple of thoughts. It basically seems\r
69 > to work as expected. I am not quite sure what behaviour you would expect\r
70 > in a couple of corner cases:\r
71 >\r
72 > 1) what it the user toggles the display of matching messages (elide\r
73 > mode)? Do you still want all tags from all messages including those not\r
74 > visible?\r
75 > 2) What about any tags from excluded messages? Should they show up? What\r
76 > if they would be excluded but aren't because of the particular search?\r
77 \r
78 \r
79 to me, a thread's tags should be independent of what is visible and\r
80 thus should be stable. For example, when I want to star a thread, I\r
81 star the message I'm currently seeing and I expect the thread to be\r
82 starred for the rest of its life, even if the particular mail is not\r
83 currently visible. What is the opinion of others?\r
84 \r
85 >>  emacs/notmuch-tager.el |   76 +++++++++++++++++++++++++++\r
86 >\r
87 > I would go for tagger rather than tager (but others can disagree).\r
88 \r
89 \r
90 I don't care and can change it without problem. I picked 'tager'\r
91 because it's shorter and I like to have a lot of information in my\r
92 function names. What is the opinion of others?\r
93 \r
94 >> +(defun notmuch-query-thread-tags-from-id (thread-id)\r
95 >> +  "Return the tags of thread whose id is THREAD-ID.\r
96 >> +The thread tags are the union of the tags of emails in the\r
97 >> +thread."\r
98 >> +  (let ((tag-lists\r
99 >> +      (notmuch-query-map-forest\r
100 >> +       (lambda (msg) (plist-get msg :tags))\r
101 >> +       (car (notmuch-query-get-threads\r
102 >> +             (list (concat "thread:" thread-id)))))))\r
103 >> +    (case (length tag-lists)\r
104 >> +      (0 nil)\r
105 >> +      (1 (car tag-lists))\r
106 >> +      (otherwise (reduce (lambda (l1 l2)\r
107 >> +                        (union l1 l2 :test 'string=))\r
108 >> +                      tag-lists)))))\r
109 >\r
110 > Couldn't you do this with notmuch-show-mapc and avoid the extra call to\r
111 > notmuch? It also probably helps some cases of excluded tags and elide\r
112 > mode.\r
113 >\r
114 \r
115 \r
116 That would not work for my definition of a thread's tags. But if we\r
117 change the definition, I can change the implementation of this\r
118 function and avoid a call to notmuch.\r
119 \r
120 \r
121 > If for some reason the query is better than I think you work\r
122 > to remove the thread: from the thread-id below and then add it back in\r
123 > here?\r
124 \r
125 \r
126 I know and it is on purpose :-). When I first had a look at notmuch\r
127 sources, I was confused by all those thread-id and mail-id everywhere\r
128 that are sometimes ids (e.g., "000012") and sometimes queries (e.g.,\r
129 "thread:000012"). To me, the code should use ids everywhere and build\r
130 a query out of that when calling notmuch or when displaying a query.\r
131 This would also avoid the use of the optional `bare' parameter in some\r
132 existing functions.\r
133 \r
134 \r
135 Thank you for your review. So, I'm waiting for more opinions because\r
136 changing anything.\r
137 \r
138 Best\r
139 \r
140 --\r
141 Damien Cassou\r
142 http://damiencassou.seasidehosting.st\r
143 \r
144 "Success is the ability to go from one failure to another without\r
145 losing enthusiasm."\r
146 Winston Churchill\r