Re: [PATCH] Implement a simple read-eval-print loop.
authorservilio <servilio@gmail.com>
Sat, 20 Nov 2010 23:38:21 +0000 (18:38 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:37:34 +0000 (09:37 -0800)
b2/a8b04846d46ad86803d57ab7498192099c0620 [new file with mode: 0644]

diff --git a/b2/a8b04846d46ad86803d57ab7498192099c0620 b/b2/a8b04846d46ad86803d57ab7498192099c0620
new file mode 100644 (file)
index 0000000..b663b95
--- /dev/null
@@ -0,0 +1,104 @@
+Return-Path: <servilio@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 694EB40DF1D\r
+       for <notmuch@notmuchmail.org>; Sat, 20 Nov 2010 15:38:35 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.999\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.999 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, RCVD_IN_DNSWL_NONE=-0.0001]\r
+       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 7mma4IIfAPjc for <notmuch@notmuchmail.org>;\r
+       Sat, 20 Nov 2010 15:38:23 -0800 (PST)\r
+Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com\r
+       [74.125.82.181])\r
+       by olra.theworths.org (Postfix) with ESMTP id 19C3140DF18\r
+       for <notmuch@notmuchmail.org>; Sat, 20 Nov 2010 15:38:22 -0800 (PST)\r
+Received: by wyb36 with SMTP id 36so1083216wyb.26\r
+       for <notmuch@notmuchmail.org>; Sat, 20 Nov 2010 15:38:22 -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=RnI+rFQ95lHXmdrYdtGSYLXCyXxQUWYepYMW6w1m4zk=;\r
+       b=Z+nT1RtdPN4+ixYoZz6/+9dtXbmVwuN0HYEnalh6p8KbZqZ2czB/nfp2QAaXETC0Vt\r
+       m46qcIGT2xtHyixnXmBAz33uoGEpG+mHCK3ZQ1CdspNoJBrduK4nf4ROAXrfgFwF9Ekv\r
+       HzGd0YMF/IxwitnZzqwGeSdyZsAXFAUxY4KHw=\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=TrwuLUJqJS0rygmRF5dzD9Mso1fgf5YIs/Hy328FRS4iwGXJ83e6JBAtzU4voZHS9l\r
+       XPjau2kRXpOLG7ltIDltmd0IJVfUNNqmplkBZNOsD360D4VOf2zEIwGRblyOco/3afuU\r
+       o7Qi0uotsbUBbJYljAvrHski812W6JA41froo=\r
+MIME-Version: 1.0\r
+Received: by 10.216.11.205 with SMTP id 55mr2420531wex.72.1290296301975; Sat,\r
+       20 Nov 2010 15:38:21 -0800 (PST)\r
+Received: by 10.216.166.195 with HTTP; Sat, 20 Nov 2010 15:38:21 -0800 (PST)\r
+In-Reply-To: <87sjyvk875.fsf@wsheee.2x.cz>\r
+References: <AANLkTi=7eCt0=NqUiJFrGDcaZ17LOd3qNNqN1-ASwYzr@mail.gmail.com>\r
+       <87sjyvk875.fsf@wsheee.2x.cz>\r
+Date: Sat, 20 Nov 2010 18:38:21 -0500\r
+Message-ID: <AANLkTin_6A1qnuFpE9oPXySA0j5jTV-tq=BbqSNMPWfb@mail.gmail.com>\r
+Subject: Re: [PATCH] Implement a simple read-eval-print loop.\r
+From: servilio <servilio@gmail.com>\r
+To: Michal Sojka <sojkam1@fel.cvut.cz>\r
+Content-Type: text/plain; charset=ISO-8859-1\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: Sat, 20 Nov 2010 23:38:35 -0000\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