Re: [PATCH] Implement a simple read-eval-print loop.
authorAustin Clements <amdragon@gmail.com>
Sun, 21 Nov 2010 17:35:47 +0000 (12:35 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:37:34 +0000 (09:37 -0800)
18/ffc2e7b8fbb61565b1c2f60184b231e2d8806d [new file with mode: 0644]

diff --git a/18/ffc2e7b8fbb61565b1c2f60184b231e2d8806d b/18/ffc2e7b8fbb61565b1c2f60184b231e2d8806d
new file mode 100644 (file)
index 0000000..1fc2e4a
--- /dev/null
@@ -0,0 +1,199 @@
+Return-Path: <amdragon@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id C550240DDC2\r
+       for <notmuch@notmuchmail.org>; Sun, 21 Nov 2010 09:36:00 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.998\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.998 tagged_above=-999 required=5\r
+       tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,\r
+       DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001,\r
+       RCVD_IN_DNSWL_NONE=-0.0001] autolearn=ham\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id d0RRnDW28ebY for <notmuch@notmuchmail.org>;\r
+       Sun, 21 Nov 2010 09:35:50 -0800 (PST)\r
+Received: from mail-qw0-f53.google.com (mail-qw0-f53.google.com\r
+       [209.85.216.53])\r
+       by olra.theworths.org (Postfix) with ESMTP id 03AC240DF1F\r
+       for <notmuch@notmuchmail.org>; Sun, 21 Nov 2010 09:35:49 -0800 (PST)\r
+Received: by qwd7 with SMTP id 7so1644291qwd.26\r
+       for <notmuch@notmuchmail.org>; Sun, 21 Nov 2010 09:35:47 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=domainkey-signature:mime-version:received:received:in-reply-to\r
+       :references:date:message-id:subject:from:to:cc:content-type;\r
+       bh=Q4p+52QEleAGZwy7r8Li8yGJigiaLZMZbFneszAIThE=;\r
+       b=LMSJaalOD2UgsZsqlNjTsuI0F4H11xdLQBDpqS8vvC6692zr4mdmDUncw/q7XdVX6Q\r
+       XvEhujmKsdHowvk47aSr6GbcM9TmADjXQ5/+2fpOwZAbaXu1FJVcAh4iAopO9pRbpC7T\r
+       W9HTUZ+DUYuxD7DuLY1zzeF4gAa0gp3/rx2nU=\r
+DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;\r
+       h=mime-version:in-reply-to:references:date:message-id:subject:from:to\r
+       :cc:content-type;\r
+       b=pG6dg5Q3AbKQ8jdSoMB0tOuHhaoXfPp0fo7wKRT+50mVTIC+BbLVNpXDl+Uf70LxVH\r
+       PeSGCqkAqIVuuNZEXFJ1MaK5HedROiA3RdN6oWV6T3zqU6nougAExfuhyRUYNB0Giip/\r
+       PTl8gO3biJq/GvI+8caj8+cSDRPS1B+Dm9V0s=\r
+MIME-Version: 1.0\r
+Received: by 10.229.189.20 with SMTP id dc20mr4282247qcb.125.1290360947378;\r
+       Sun, 21 Nov 2010 09:35:47 -0800 (PST)\r
+Received: by 10.229.224.202 with HTTP; Sun, 21 Nov 2010 09:35:47 -0800 (PST)\r
+In-Reply-To: <AANLkTin_6A1qnuFpE9oPXySA0j5jTV-tq=BbqSNMPWfb@mail.gmail.com>\r
+References: <AANLkTi=7eCt0=NqUiJFrGDcaZ17LOd3qNNqN1-ASwYzr@mail.gmail.com>\r
+       <87sjyvk875.fsf@wsheee.2x.cz>\r
+       <AANLkTin_6A1qnuFpE9oPXySA0j5jTV-tq=BbqSNMPWfb@mail.gmail.com>\r
+Date: Sun, 21 Nov 2010 12:35:47 -0500\r
+Message-ID: <AANLkTikMUhmEQjSLj3Uys9iBU1r8G22TuT337y1N3ZrJ@mail.gmail.com>\r
+Subject: Re: [PATCH] Implement a simple read-eval-print loop.\r
+From: Austin Clements <amdragon@gmail.com>\r
+To: servilio <servilio@gmail.com>\r
+Content-Type: multipart/alternative; boundary=0016362842dee68c950495939126\r
+Cc: notmuch <notmuch@notmuchmail.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 21 Nov 2010 17:36:00 -0000\r
+\r
+--0016362842dee68c950495939126\r
+Content-Type: text/plain; charset=ISO-8859-1\r
+\r
+Out of curiosity, why not simply use SSH control mastering?  You could even\r
+make that part of the "standard" remote notmuch script, without requiring\r
+the user to change anything in their ssh configuration.  This should be just\r
+as fast as a remote notmuch shell, but retains the ability to run multiple\r
+simultaneous operations and leverages all of the fancy session machinery\r
+already built in to ssh.  It seems to me that ssh already does what you\r
+want, and I'm curious what the advantage is to reinventing the wheel.\r
+\r
+On Sat, Nov 20, 2010 at 6:38 PM, servilio <servilio@gmail.com> wrote:\r
+\r
+> Hi Michal,\r
+>\r
+> On 20 November 2010 16:15, Michal Sojka <sojkam1@fel.cvut.cz> wrote:\r
+> > On Sat, 20 Nov 2010, servilio wrote:\r
+> >> This implementation uses GNU readline for the prompt and command\r
+> >> history, with the default file completion enabled. GLib is used to\r
+> >> split the read line into an arguments list.\r
+> >\r
+> > Hi,\r
+> >\r
+> > I haven't tested it yet, but it seems to be exactly the piece of code I\r
+> > wanted to have to speed up notmuch-hello when notmuch is used remotely\r
+> > over ssh. Spawning new ssh for every saved search to get the count of\r
+> > matched messages has a way too big overhead. Is this the use case you\r
+> > had in mind when implementing this?\r
+>\r
+> Great to see that you find it useful. Yes, the remote usage was in my\r
+> mind, but it should enhance the local usage as well. We could also\r
+> create a quicker test run using the shell.\r
+>\r
+> The disadvantage of using an interactive shell is that you can have\r
+> only one operation running in the UI, and I see no way of\r
+> interrumpting an operation unless you kill the process, but as\r
+> starting a new shell shouldn't be a biggie, this might not be as\r
+> limiting as might seem.\r
+>\r
+> The ideal would be for libnotmuch to be able to connect to a\r
+> xapian-tcpsrv, but haven't had time to look at than, and an\r
+> interactive shell seemed to be less time demanding to implement (and\r
+> had the subjective promise of providing a lot of fun).\r
+>\r
+> > Currently, I have only one comment to the patch. For me, "repl" is a bit\r
+> > unintuitive. I was thinking about "shell" as the name of subcommand for\r
+> > this.\r
+>\r
+> I agree, maybe "shell" or "interactive" would be more intuitive, but\r
+> when I started "repl" was the only one I could think of.\r
+>\r
+> Servilio\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r
+>\r
+\r
+--0016362842dee68c950495939126\r
+Content-Type: text/html; charset=ISO-8859-1\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+Out of curiosity, why not simply use SSH control mastering? =A0You could ev=\r
+en make that part of the &quot;standard&quot; remote notmuch script, withou=\r
+t requiring the user to change anything in their ssh configuration. =A0This=\r
+ should be just as fast as a remote notmuch shell, but retains the ability =\r
+to run multiple simultaneous operations and leverages all of the fancy sess=\r
+ion machinery already built in to ssh. =A0It seems to me that ssh already d=\r
+oes what you want, and I&#39;m curious what the advantage is to reinventing=\r
+ the wheel.<div>\r
+<br><div class=3D"gmail_quote">On Sat, Nov 20, 2010 at 6:38 PM, servilio <s=\r
+pan dir=3D"ltr">&lt;<a href=3D"mailto:servilio@gmail.com">servilio@gmail.co=\r
+m</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margi=\r
+n:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">\r
+Hi Michal,<br>\r
+<div class=3D"im"><br>\r
+On 20 November 2010 16:15, Michal Sojka &lt;<a href=3D"mailto:sojkam1@fel.c=\r
+vut.cz">sojkam1@fel.cvut.cz</a>&gt; wrote:<br>\r
+&gt; On Sat, 20 Nov 2010, servilio wrote:<br>\r
+&gt;&gt; This implementation uses GNU readline for the prompt and command<b=\r
+r>\r
+&gt;&gt; history, with the default file completion enabled. GLib is used to=\r
+<br>\r
+&gt;&gt; split the read line into an arguments list.<br>\r
+&gt;<br>\r
+&gt; Hi,<br>\r
+&gt;<br>\r
+&gt; I haven&#39;t tested it yet, but it seems to be exactly the piece of c=\r
+ode I<br>\r
+&gt; wanted to have to speed up notmuch-hello when notmuch is used remotely=\r
+<br>\r
+&gt; over ssh. Spawning new ssh for every saved search to get the count of<=\r
+br>\r
+&gt; matched messages has a way too big overhead. Is this the use case you<=\r
+br>\r
+&gt; had in mind when implementing this?<br>\r
+<br>\r
+</div>Great to see that you find it useful. Yes, the remote usage was in my=\r
+<br>\r
+mind, but it should enhance the local usage as well. We could also<br>\r
+create a quicker test run using the shell.<br>\r
+<br>\r
+The disadvantage of using an interactive shell is that you can have<br>\r
+only one operation running in the UI, and I see no way of<br>\r
+interrumpting an operation unless you kill the process, but as<br>\r
+starting a new shell shouldn&#39;t be a biggie, this might not be as<br>\r
+limiting as might seem.<br>\r
+<br>\r
+The ideal would be for libnotmuch to be able to connect to a<br>\r
+xapian-tcpsrv, but haven&#39;t had time to look at than, and an<br>\r
+interactive shell seemed to be less time demanding to implement (and<br>\r
+had the subjective promise of providing a lot of fun).<br>\r
+<div class=3D"im"><br>\r
+&gt; Currently, I have only one comment to the patch. For me, &quot;repl&qu=\r
+ot; is a bit<br>\r
+&gt; unintuitive. I was thinking about &quot;shell&quot; as the name of sub=\r
+command for<br>\r
+&gt; this.<br>\r
+<br>\r
+</div>I agree, maybe &quot;shell&quot; or &quot;interactive&quot; would be =\r
+more intuitive, but<br>\r
+when I started &quot;repl&quot; was the only one I could think of.<br>\r
+<font color=3D"#888888"><br>\r
+Servilio<br>\r
+</font><div><div></div><div class=3D"h5">__________________________________=\r
+_____________<br>\r
+notmuch mailing list<br>\r
+<a href=3D"mailto:notmuch@notmuchmail.org">notmuch@notmuchmail.org</a><br>\r
+<a href=3D"http://notmuchmail.org/mailman/listinfo/notmuch" target=3D"_blan=\r
+k">http://notmuchmail.org/mailman/listinfo/notmuch</a><br>\r
+</div></div></blockquote></div><br></div>\r
+\r
+--0016362842dee68c950495939126--\r