[PATCH 2/9] lib: private string map (associative array) API
[notmuch-archives.git] / 2f / 02c1609b50cf9d208515b0e0d146b1e09d957c
1 Return-Path: <jani@nikula.org>\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 75B98429E25\r
6         for <notmuch@notmuchmail.org>; Sun, 11 Dec 2011 15:10:39 -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.699\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5\r
12         tests=[HTML_MESSAGE=0.001, 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 3pJCIvN8Yz37 for <notmuch@notmuchmail.org>;\r
16         Sun, 11 Dec 2011 15:10:38 -0800 (PST)\r
17 Received: from mail-pw0-f53.google.com (mail-pw0-f53.google.com\r
18         [209.85.160.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id A49B9431FB6\r
21         for <notmuch@notmuchmail.org>; Sun, 11 Dec 2011 15:10:38 -0800 (PST)\r
22 Received: by pbds6 with SMTP id s6so567966pbd.26\r
23         for <notmuch@notmuchmail.org>; Sun, 11 Dec 2011 15:10:37 -0800 (PST)\r
24 MIME-Version: 1.0\r
25 Received: by 10.68.73.34 with SMTP id i2mr28500441pbv.43.1323645037831; Sun,\r
26         11 Dec 2011 15:10:37 -0800 (PST)\r
27 Received: by 10.68.212.134 with HTTP; Sun, 11 Dec 2011 15:10:37 -0800 (PST)\r
28 Received: by 10.68.212.134 with HTTP; Sun, 11 Dec 2011 15:10:37 -0800 (PST)\r
29 In-Reply-To: <20111211225822.GH2760@mit.edu>\r
30 References: <1323640100-18326-1-git-send-email-jani@nikula.org>\r
31         <87wra26a5u.fsf@gmail.com> <20111211225822.GH2760@mit.edu>\r
32 Date: Mon, 12 Dec 2011 01:10:37 +0200\r
33 Message-ID:\r
34  <CAB+hUn-ADRtZRCq5Ad6H6R2L246EBR8hOSsk4B2yeRsH4kN16w@mail.gmail.com>\r
35 Subject: Re: [PATCH] emacs: support "notmuch new" as a notmuch-poll-script\r
36 From: Jani Nikula <jani@nikula.org>\r
37 To: Austin Clements <amdragon@mit.edu>\r
38 Content-Type: multipart/alternative; boundary=f46d0417071b49e4c804b3d920ce\r
39 Cc: notmuch@notmuchmail.org\r
40 X-BeenThere: notmuch@notmuchmail.org\r
41 X-Mailman-Version: 2.1.13\r
42 Precedence: list\r
43 List-Id: "Use and development of the notmuch mail system."\r
44         <notmuch.notmuchmail.org>\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
46         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
48 List-Post: <mailto:notmuch@notmuchmail.org>\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
51         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
52 X-List-Received-Date: Sun, 11 Dec 2011 23:10:39 -0000\r
53 \r
54 --f46d0417071b49e4c804b3d920ce\r
55 Content-Type: text/plain; charset=UTF-8\r
56 \r
57 On Dec 12, 2011 12:56 AM, "Austin Clements" <amdragon@mit.edu> wrote:\r
58 >\r
59 > Quoth Dmitry Kurochkin on Dec 12 at  2:00 am:\r
60 > > Hi Jani.\r
61 > >\r
62 > > On Sun, 11 Dec 2011 23:48:20 +0200, Jani Nikula <jani@nikula.org> wrote:\r
63 > > > Let notmuch-poll-script be a function as well as a string. Make\r
64 default\r
65 > > > value nil instead of an empty string, but allow "" for backwards\r
66 > > > compatibility. Add a notmuch poll function to call "notmuch new"\r
67 using the\r
68 > > > configured notmuch-command.\r
69 > > >\r
70 > > > This allows taking better advantage of the "notmuch new" hooks from\r
71 emacs\r
72 > > > without intermediate scripts.\r
73 > > >\r
74 > >\r
75 > > I was just thinking about working on this myself :)\r
76 > >\r
77 > > I think a better solution would be to allow running a command with\r
78 > > arguments.  Creating a elisp function just to run a command with some\r
79 > > parameters feels wrong.  This way we would have to add another function\r
80 > > each time we want to add another argument.\r
81 >\r
82 > This seems a little awkward to me, too, though perhaps it's the best\r
83 > way.  Other approaches to consider include accepting a list for\r
84 > notmuch-poll-script (e.g., ("notmuch" "new")) or leaving it as a\r
85 > string but treating it as a shell command so "notmuch new" would Just\r
86 > Work.  Personally, I think the latter is the most intuitive, but it\r
87 > would be worth looking at how other customizable external commands are\r
88 > done in Emacs.\r
89 >\r
90 > A function seems powerful, but also like overkill.  Can you give a use\r
91 > case for a function that wouldn't be more easily solved by one of the\r
92 > above approaches?\r
93 \r
94 The only reason I had for using a function was running notmuch using\r
95 notmuch-command. Any ideas how to do that with the Just Works approach?\r
96 \r
97 J.\r
98 \r
99 --f46d0417071b49e4c804b3d920ce\r
100 Content-Type: text/html; charset=UTF-8\r
101 Content-Transfer-Encoding: quoted-printable\r
102 \r
103 <p><br>\r
104 On Dec 12, 2011 12:56 AM, &quot;Austin Clements&quot; &lt;<a href=3D"mailto=\r
105 :amdragon@mit.edu">amdragon@mit.edu</a>&gt; wrote:<br>\r
106 &gt;<br>\r
107 &gt; Quoth Dmitry Kurochkin on Dec 12 at =C2=A02:00 am:<br>\r
108 &gt; &gt; Hi Jani.<br>\r
109 &gt; &gt;<br>\r
110 &gt; &gt; On Sun, 11 Dec 2011 23:48:20 +0200, Jani Nikula &lt;<a href=3D"ma=\r
111 ilto:jani@nikula.org">jani@nikula.org</a>&gt; wrote:<br>\r
112 &gt; &gt; &gt; Let notmuch-poll-script be a function as well as a string. M=\r
113 ake default<br>\r
114 &gt; &gt; &gt; value nil instead of an empty string, but allow &quot;&quot;=\r
115  for backwards<br>\r
116 &gt; &gt; &gt; compatibility. Add a notmuch poll function to call &quot;not=\r
117 much new&quot; using the<br>\r
118 &gt; &gt; &gt; configured notmuch-command.<br>\r
119 &gt; &gt; &gt;<br>\r
120 &gt; &gt; &gt; This allows taking better advantage of the &quot;notmuch new=\r
121 &quot; hooks from emacs<br>\r
122 &gt; &gt; &gt; without intermediate scripts.<br>\r
123 &gt; &gt; &gt;<br>\r
124 &gt; &gt;<br>\r
125 &gt; &gt; I was just thinking about working on this myself :)<br>\r
126 &gt; &gt;<br>\r
127 &gt; &gt; I think a better solution would be to allow running a command wit=\r
128 h<br>\r
129 &gt; &gt; arguments. =C2=A0Creating a elisp function just to run a command =\r
130 with some<br>\r
131 &gt; &gt; parameters feels wrong. =C2=A0This way we would have to add anoth=\r
132 er function<br>\r
133 &gt; &gt; each time we want to add another argument.<br>\r
134 &gt;<br>\r
135 &gt; This seems a little awkward to me, too, though perhaps it&#39;s the be=\r
136 st<br>\r
137 &gt; way. =C2=A0Other approaches to consider include accepting a list for<b=\r
138 r>\r
139 &gt; notmuch-poll-script (e.g., (&quot;notmuch&quot; &quot;new&quot;)) or l=\r
140 eaving it as a<br>\r
141 &gt; string but treating it as a shell command so &quot;notmuch new&quot; w=\r
142 ould Just<br>\r
143 &gt; Work. =C2=A0Personally, I think the latter is the most intuitive, but =\r
144 it<br>\r
145 &gt; would be worth looking at how other customizable external commands are=\r
146 <br>\r
147 &gt; done in Emacs.<br>\r
148 &gt;<br>\r
149 &gt; A function seems powerful, but also like overkill. =C2=A0Can you give =\r
150 a use<br>\r
151 &gt; case for a function that wouldn&#39;t be more easily solved by one of =\r
152 the<br>\r
153 &gt; above approaches?</p>\r
154 <p>The only reason I had for using a function was running notmuch using not=\r
155 much-command. Any ideas how to do that with the Just Works approach?</p>\r
156 <p>J.<br>\r
157 </p>\r
158 \r
159 --f46d0417071b49e4c804b3d920ce--\r