Re: [PATCH v3] nmbug: Translate to Python
[notmuch-archives.git] / 87 / fde0b8196e3b54e4eba5f27c9f3c74ef699d2c
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 D9A1E431FBC\r
6         for <notmuch@notmuchmail.org>; Mon,  5 Mar 2012 07:43:44 -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 F5g7lJ6HWL6V for <notmuch@notmuchmail.org>;\r
17         Mon,  5 Mar 2012 07:43:44 -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 1A93F431FAE\r
22         for <notmuch@notmuchmail.org>; Mon,  5 Mar 2012 07:43:43 -0800 (PST)\r
23 Received: by bkwj4 with SMTP id j4so3784591bkw.26\r
24         for <notmuch@notmuchmail.org>; Mon, 05 Mar 2012 07:43:41 -0800 (PST)\r
25 Received-SPF: pass (google.com: domain of dmitry.kurochkin@gmail.com\r
26         designates 10.204.156.70 as permitted sender)\r
27         client-ip=10.204.156.70; \r
28 Authentication-Results: mr.google.com; spf=pass (google.com: domain of\r
29         dmitry.kurochkin@gmail.com designates 10.204.156.70 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.204.156.70])\r
33         by 10.204.156.70 with SMTP id v6mr1449625bkw.124.1330962221503\r
34         (num_hops = 1); Mon, 05 Mar 2012 07:43:41 -0800 (PST)\r
35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
36         h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
37         :mime-version:content-type;\r
38         bh=2sUSidYx47yR3QYGrOCC1jvFwtvz0Jj0LM1iuFa4dKE=;\r
39         b=Z1eUK7+e3M80W5ZzkeYT/ty9mV+x16tB9wlNB80cJtj5k7kYxvOVQS9EBFLj+0EYpY\r
40         RVGbmLmzJPHrQrv/2jNl6PrjE2bBl/6vnDkXY4Me3VK/gez7zYB06aSRnaSJRYM/I6MN\r
41         7r+Mvo/tC9ipBql+7Bx6phkh84F919rLauVCWkgwBmThNjRdbDOagp5HXHuEsj2Ik+hZ\r
42         +LCKYRrOA/id5m3SysbggsdV9cXX8d/srRz90dMgaw1rOIRHHBL37ZveAPHECSxWJoP3\r
43         RzJTaGzN+boqnzoAi3k6g3jp0cNpWU2lN64sHI39+RMluuovRT0DCJVsv8racPn7hDut\r
44         S04g==\r
45 Received: by 10.204.156.70 with SMTP id v6mr1094790bkw.124.1330962221373;\r
46         Mon, 05 Mar 2012 07:43:41 -0800 (PST)\r
47 Received: from localhost ([91.144.186.21])\r
48         by mx.google.com with ESMTPS id d5sm26371937bkb.3.2012.03.05.07.43.39\r
49         (version=TLSv1/SSLv3 cipher=OTHER);\r
50         Mon, 05 Mar 2012 07:43:40 -0800 (PST)\r
51 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
52 To: Daniel Schoepe <daniel@schoepe.org>, notmuch@notmuchmail.org\r
53 Subject: Re: [PATCH v2] emacs: Pass a copy to\r
54         notmuch-saved-search-sort-function\r
55 In-Reply-To: <87399n2t60.fsf@schoepe.localhost>\r
56 References: <1330613059-5130-1-git-send-email-daniel@schoepe.org>\r
57         <1330633478-1974-1-git-send-email-daniel@schoepe.org>\r
58         <1330633478-1974-2-git-send-email-daniel@schoepe.org>\r
59         <87booblrcv.fsf@gmail.com> <87399n2t60.fsf@schoepe.localhost>\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: Mon, 05 Mar 2012 19:42:12 +0400\r
63 Message-ID: <878vjfkqaz.fsf@gmail.com>\r
64 MIME-Version: 1.0\r
65 Content-Type: text/plain; charset=us-ascii\r
66 X-BeenThere: notmuch@notmuchmail.org\r
67 X-Mailman-Version: 2.1.13\r
68 Precedence: list\r
69 List-Id: "Use and development of the notmuch mail system."\r
70         <notmuch.notmuchmail.org>\r
71 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
72         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
73 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
74 List-Post: <mailto:notmuch@notmuchmail.org>\r
75 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
76 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
77         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
78 X-List-Received-Date: Mon, 05 Mar 2012 15:43:45 -0000\r
79 \r
80 On Mon, 05 Mar 2012 12:17:43 +0100, Daniel Schoepe <daniel@schoepe.org> wrote:\r
81 > On Mon, 05 Mar 2012 06:21:52 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:\r
82 > > On Thu,  1 Mar 2012 21:24:38 +0100, Daniel Schoepe <daniel@schoepe.org> wrote:\r
83 > > > notmuch-saved-search-sort-function might destructively modify its\r
84 > > > input (`sort' does that, for instance), so it should not be given\r
85 > > > notmuch-saved-searches directly.\r
86 > > > ---\r
87 > > \r
88 > > -1\r
89 > > \r
90 > > I think we should require `notmuch-saved-search-sort-function' not to\r
91 > > have side effects.  Current documentation should be more clear about\r
92 > > this.  We need to fix `notmuch-sort-saved-searches' to copy the list\r
93 > > before calling `sort'.  But we should not do it in\r
94 > > `notmuch-hello-insert-saved-searches' for any sorting function (which\r
95 > > may not need this copying).\r
96\r
97 > My reasoning was that since sort is such a common function, many users\r
98 > will probably use sort for their own sorting functions, not realizing\r
99 > that it has side effects. This will lead to confusing behavior that's\r
100 > not so easy to track down.\r
101\r
102 > Copying the list of saved searches when running notmuch-hello does not\r
103 > seem be relevant to performance to me, since it's a) not called that\r
104 > often and b) the list of saved searches will rarely exceed 30 elements.\r
105\r
106 > Hence, this way we can avoid some headaches for users who define their\r
107 > own sorting functions at a negligible (performance) cost. Incidentally,\r
108 > this is also how notmuch-hello did it before the user-defined sections\r
109 > patches.\r
110\r
111 \r
112 I do not buy the argument that we should help users who implement their\r
113 own sorting functions but do not read documentation for functions they\r
114 use.  Apparently, those who implemented the `sort' function had similar\r
115 ideas.  And I do not think it is our job to add workarounds for it.\r
116 \r
117 An alternative (and IMO better) solution would be to allow customization\r
118 of compare function used for sorting instead of the sorting function\r
119 itself.\r
120 \r
121 Regards,\r
122   Dmitry\r
123 \r
124 > Cheers,\r
125 > Daniel\r