unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Michal Sojka <sojkam1@fel.cvut.cz>
To: Austin Clements <amdragon@gmail.com>, servilio <servilio@gmail.com>
Cc: notmuch <notmuch@notmuchmail.org>
Subject: Re: [PATCH] Implement a simple read-eval-print loop.
Date: Sun, 21 Nov 2010 22:10:01 +0100	[thread overview]
Message-ID: <87y68mbcye.fsf@resox.2x.cz> (raw)
In-Reply-To: <AANLkTikMUhmEQjSLj3Uys9iBU1r8G22TuT337y1N3ZrJ@mail.gmail.com>

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
<count1>
<count2>
...

-Michal

  reply	other threads:[~2010-11-21 21:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-20 14:20 [PATCH] Implement a simple read-eval-print loop servilio
2010-11-20 21:15 ` Michal Sojka
2010-11-20 23:38   ` servilio
2010-11-21 17:35     ` Austin Clements
2010-11-21 21:10       ` Michal Sojka [this message]
2010-11-21 21:51         ` Michal Sojka
2010-11-21 22:14           ` Michael Hudson
2010-11-21 23:50         ` Austin Clements

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y68mbcye.fsf@resox.2x.cz \
    --to=sojkam1@fel.cvut.cz \
    --cc=amdragon@gmail.com \
    --cc=notmuch@notmuchmail.org \
    --cc=servilio@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).