Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id EA51740DF18 for ; Sun, 21 Nov 2010 13:10:41 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=ham Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tQLB9-GXDv1y for ; Sun, 21 Nov 2010 13:10:31 -0800 (PST) Received: from smtp.nextra.cz (smtp.nextra.cz [212.65.193.3]) by olra.theworths.org (Postfix) with ESMTP id 963D140DDC2 for ; Sun, 21 Nov 2010 13:10:24 -0800 (PST) Received: from resox.2x.cz (unknown [213.29.198.144]) by smtp.nextra.cz (Postfix) with ESMTP id 5E2609B791; Sun, 21 Nov 2010 22:10:21 +0100 (CET) Received: from wsh by resox.2x.cz with local (Exim 4.72) (envelope-from ) id 1PKHAp-0001Nj-2y; Sun, 21 Nov 2010 22:10:11 +0100 From: Michal Sojka To: Austin Clements , servilio Subject: Re: [PATCH] Implement a simple read-eval-print loop. In-Reply-To: References: <87sjyvk875.fsf@wsheee.2x.cz> User-Agent: Notmuch/0.5-11-g48b5e00 (http://notmuchmail.org) Emacs/23.2.1 (i486-pc-linux-gnu) Date: Sun, 21 Nov 2010 22:10:01 +0100 Message-ID: <87y68mbcye.fsf@resox.2x.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: notmuch X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Nov 2010 21:10:42 -0000 On Sun, 21 Nov 2010, Austin Clements wrote: > Out of curiosity, why not simply use SSH control mastering? I use control mastering, but it still takes about five seconds to display notmuch hello screen. > You could even make that part of the "standard" remote notmuch script, > without requiring the user to change anything in their ssh > configuration. This is a great idea. Now I use this script to invoke notmuch remotely and I don't have to create master connection manually. #!/bin/bash socket="$HOME/.ssh/notmuch-connection" if [[ ! -S $socket ]]; then # Create master connection in background (the connection is closed # after 10 minutes) ssh -f -M -S $socket example.org sleep 600 fi printf -v args "%q " "$@" ssh -S $socket example.org notmuch $args > This should be just as fast as a remote notmuch shell, but retains the > ability to run multiple simultaneous operations and leverages all of > the fancy session machinery already built in to ssh. It seems to me > that ssh already does what you want, and I'm curious what the > advantage is to reinventing the wheel. You are probably right that notmuch shell would not help here. The big delay in displaying notmuch-hello is mostly caused by ping delays which add for each execution of notmuch count. So better then notmuch shell might be a possibility to specify several commands at once and get all the results together. Probably, the simplest thing would be to enhance count subcommand so that it accepts multiple queries, possibly from stdin. Then we could use something like the following to determine the counts of matched messages for saved searches: $ (echo $query1; echo $query2; ...) | notmuch count --stdin ... -Michal