Re: [PATCH] Fix typo in Message.maildir_flags_to_tags
[notmuch-archives.git] / 81 / 7f5151792e430c4044875578ccf721d2786f1f
1 Return-Path: <dmitry.kurochkin@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 6E5B7431FAF\r
6         for <notmuch@notmuchmail.org>; Mon,  5 Mar 2012 13:11:10 -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 hMnMqPMEMq1v for <notmuch@notmuchmail.org>;\r
17         Mon,  5 Mar 2012 13:11:09 -0800 (PST)\r
18 Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com\r
19         [209.85.214.53]) (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 86BB6431FAE\r
22         for <notmuch@notmuchmail.org>; Mon,  5 Mar 2012 13:11:09 -0800 (PST)\r
23 Received: by bkwj4 with SMTP id j4so4144258bkw.26\r
24         for <notmuch@notmuchmail.org>; Mon, 05 Mar 2012 13:11:06 -0800 (PST)\r
25 Received-SPF: pass (google.com: domain of dmitry.kurochkin@gmail.com\r
26         designates 10.205.122.73 as permitted sender)\r
27         client-ip=10.205.122.73; \r
28 Authentication-Results: mr.google.com; spf=pass (google.com: domain of\r
29         dmitry.kurochkin@gmail.com designates 10.205.122.73 as\r
30         permitted sender) smtp.mail=dmitry.kurochkin@gmail.com;\r
31         dkim=pass header.i=dmitry.kurochkin@gmail.com\r
32 Received: from mr.google.com ([10.205.122.73])\r
33         by 10.205.122.73 with SMTP id gf9mr10235481bkc.96.1330981866892\r
34         (num_hops = 1); Mon, 05 Mar 2012 13:11:06 -0800 (PST)\r
35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
36         h=from:to:cc:subject:in-reply-to:references:user-agent:date\r
37         :message-id:mime-version:content-type;\r
38         bh=Q1wPuHcV5+7ZbPXPiz49g0ROLpnu91MX4H39d6QL/gg=;\r
39         b=kc9YNQBP5MHMR11G6Nia3Ft6U4+BlxC7RfGEcnGOK6KpMAPgNdoI5Wb0PkxW6zFvLE\r
40         iZrcxhCwNuxdv/JRunV2iqIv/vwtPfPVKD8n3BZQOVPVO8FWJ5Iu0+klHCP9rKDgBFg2\r
41         KwbOJ6azaPxYRAAUR/msHAd+eGg5Md2zyuDNcKJnrBE3ozzZBjBUCA/fQ1BgRTOSHA4e\r
42         LPM9dNgUxS7VpBiuCoZWsilz3APTsTavdA0CESC0GdELyfdDFTB0vjg+MNDU2abeL+ga\r
43         vIHMUz9stm63uM5pcGaHhPImTE/qyHgvpZKlkV9fNGSsoVhL8BBt0lZ5oY43j8Ojpa2q\r
44         5DAw==\r
45 Received: by 10.205.122.73 with SMTP id gf9mr8092294bkc.96.1330981866741;\r
46         Mon, 05 Mar 2012 13:11:06 -0800 (PST)\r
47 Received: from localhost ([91.144.186.21])\r
48         by mx.google.com with ESMTPS id x22sm27828976bkw.11.2012.03.05.13.11.05\r
49         (version=TLSv1/SSLv3 cipher=OTHER);\r
50         Mon, 05 Mar 2012 13:11:06 -0800 (PST)\r
51 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
52 To: Jani Nikula <jani@nikula.org>\r
53 Subject: Re: [PATCH v2] emacs: Pass a copy to\r
54         notmuch-saved-search-sort-function\r
55 In-Reply-To:\r
56  <CAB+hUn-iQbXq_UDcj97h2Duq=gJdxpiJjOn6YzmVcZw+GEgK0A@mail.gmail.com>\r
57 References: <1330613059-5130-1-git-send-email-daniel@schoepe.org>\r
58         <1330613059-5130-2-git-send-email-daniel@schoepe.org>\r
59         <CAB+hUn-iQbXq_UDcj97h2Duq=gJdxpiJjOn6YzmVcZw+GEgK0A@mail.gmail.com>\r
60 User-Agent: Notmuch/0.11.1+288~g4b3af0e (http://notmuchmail.org) Emacs/23.3.1\r
61         (x86_64-pc-linux-gnu)\r
62 Date: Tue, 06 Mar 2012 01:09:38 +0400\r
63 Message-ID: <87zkbukb59.fsf@gmail.com>\r
64 MIME-Version: 1.0\r
65 Content-Type: text/plain; charset=us-ascii\r
66 Cc: notmuch@notmuchmail.org\r
67 X-BeenThere: notmuch@notmuchmail.org\r
68 X-Mailman-Version: 2.1.13\r
69 Precedence: list\r
70 List-Id: "Use and development of the notmuch mail system."\r
71         <notmuch.notmuchmail.org>\r
72 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
73         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
74 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
75 List-Post: <mailto:notmuch@notmuchmail.org>\r
76 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
77 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
78         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
79 X-List-Received-Date: Mon, 05 Mar 2012 21:11:10 -0000\r
80 \r
81 On Mon, 5 Mar 2012 22:55:54 +0200, Jani Nikula <jani@nikula.org> wrote:\r
82 > On Mar 5, 2012 5:43 PM, "Dmitry Kurochkin" <dmitry.kurochkin@gmail.com>\r
83 > wrote:\r
84 > >\r
85 > > On Mon, 05 Mar 2012 12:17:43 +0100, Daniel Schoepe <daniel@schoepe.org>\r
86 > wrote:\r
87 > > > On Mon, 05 Mar 2012 06:21:52 +0400, Dmitry Kurochkin <\r
88 > dmitry.kurochkin@gmail.com> wrote:\r
89 > > > > On Thu,  1 Mar 2012 21:24:38 +0100, Daniel Schoepe <daniel@schoepe.org>\r
90 > wrote:\r
91 > > > > > notmuch-saved-search-sort-function might destructively modify its\r
92 > > > > > input (`sort' does that, for instance), so it should not be given\r
93 > > > > > notmuch-saved-searches directly.\r
94 > > > > > ---\r
95 > > > >\r
96 > > > > -1\r
97 > > > >\r
98 > > > > I think we should require `notmuch-saved-search-sort-function' not to\r
99 > > > > have side effects.  Current documentation should be more clear about\r
100 > > > > this.  We need to fix `notmuch-sort-saved-searches' to copy the list\r
101 > > > > before calling `sort'.  But we should not do it in\r
102 > > > > `notmuch-hello-insert-saved-searches' for any sorting function (which\r
103 > > > > may not need this copying).\r
104 > > >\r
105 > > > My reasoning was that since sort is such a common function, many users\r
106 > > > will probably use sort for their own sorting functions, not realizing\r
107 > > > that it has side effects. This will lead to confusing behavior that's\r
108 > > > not so easy to track down.\r
109 > > >\r
110 > > > Copying the list of saved searches when running notmuch-hello does not\r
111 > > > seem be relevant to performance to me, since it's a) not called that\r
112 > > > often and b) the list of saved searches will rarely exceed 30 elements.\r
113 > > >\r
114 > > > Hence, this way we can avoid some headaches for users who define their\r
115 > > > own sorting functions at a negligible (performance) cost. Incidentally,\r
116 > > > this is also how notmuch-hello did it before the user-defined sections\r
117 > > > patches.\r
118 > > >\r
119 > >\r
120 > > I do not buy the argument that we should help users who implement their\r
121 > > own sorting functions but do not read documentation for functions they\r
122 > > use.  Apparently, those who implemented the `sort' function had similar\r
123 > > ideas.  And I do not think it is our job to add workarounds for it.\r
124 > >\r
125 > > An alternative (and IMO better) solution would be to allow customization\r
126 > > of compare function used for sorting instead of the sorting function\r
127 > > itself.\r
128\r
129 > Providing the customization of the sort function is more powerful than the\r
130 > compare function. In the case of saved searches I can imagine people might\r
131 > want to partially use the original order while sort the rest (e.g.\r
132 > important ones first in predefined order, others sorted).\r
133 \r
134 Valid point.\r
135 \r
136 > In fact this also\r
137 > allows dropping out some elements. And renaming. And changing the queries...\r
138\r
139 > (I had something like that in mind originally but then settled with just\r
140 > capitalizing the important ones to show them first.)\r
141\r
142 \r
143 All of these are invalid usages of `notmuch-saved-search-sort-function'.\r
144 The function is meant for sorting only (hence the name).  So the code\r
145 might assume that the function does only sorting.\r
146 \r
147 I do not understand why we need such functionality (renaming,\r
148 capitalizing, etc.).  You can just rename the query itself if you want\r
149 to.  Should be easier IMO.  But if we need such functionality, we should\r
150 not misuse sorting function for it.  We can add `notmuch-saved-searches'\r
151 function which would return saved searches list (sorted, renamed and\r
152 mangled in any other way).  By default it would return\r
153 `notmuch-saved-searches' variable as is.\r
154 \r
155 Regards,\r
156   Dmitry\r
157 \r
158 > BR,\r
159 > Jani.\r
160\r
161 > >\r
162 > > Regards,\r
163 > >  Dmitry\r
164 > >\r
165 > > > Cheers,\r
166 > > > Daniel\r
167 > > _______________________________________________\r
168 > > notmuch mailing list\r
169 > > notmuch@notmuchmail.org\r
170 > > http://notmuchmail.org/mailman/listinfo/notmuch\r
171 Non-text part: text/html\r