X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=remoteusage.mdwn;h=2b7dd5c7ca5ff6b3cbf044e2e3414d4ffb2545fd;hb=832300a9e0e553f6cc1a36b91dcaad143eb74d01;hp=d43a8cdb60308c3ca604d14d9ca30185a19c2bcc;hpb=773996e1b150a0733e90a75b93c740da980259f9;p=notmuch-wiki diff --git a/remoteusage.mdwn b/remoteusage.mdwn index d43a8cd..2b7dd5c 100644 --- a/remoteusage.mdwn +++ b/remoteusage.mdwn @@ -44,29 +44,35 @@ entries. This is currently necessary so that the emacs process-filter doesn't chop off messages. It's an obvious hack, and hopefully won't be necessary in the furture. - #!/usr/bin/env bash - - SSH_BIN="/path/to/ssh/on/client" - USER="user_name" - HOST="server_name" - NOTMUCH_REMOTE_BIN="/path/to/notmuch/on/server" - - if [ $1 = "search" ]; then - COUNT=0; - OUT=`$SSH_BIN $USER@$HOST $NOTMUCH_REMOTE_BIN $@` - echo "$OUT" | while read line; do - COUNT=`expr $COUNT + 1` - echo "$line"; - if [ $COUNT = 10 ]; then - sleep 0.1; - fi - done - else - $SSH_BIN $USER@$HOST $NOTMUCH_REMOTE_BIN $@ - fi - + #!/usr/bin/env bash + + SSH_BIN="/path/to/ssh/on/client" + USER="user_name" + HOST="server_name" + NOTMUCH_REMOTE_BIN="/path/to/notmuch/on/server" + + if [ $1 = "search" ]; then + COUNT=0; + OUT=`$SSH_BIN $USER@$HOST $NOTMUCH_REMOTE_BIN $@` + echo "$OUT" | while read line; do + COUNT=`expr $COUNT + 1` + echo "$line"; + if [ $COUNT = 10 ]; then + sleep 0.1; + fi + done + else + $SSH_BIN $USER@$HOST $NOTMUCH_REMOTE_BIN $@ + fi + Save this to a file, "remote-notmuch.sh", in your path. +Now you can run "remote-notmuch.sh new". You can call the script +anything you like. If you don't have a notmuch instance on your client +computer, you can even call it "notmuch" and have totally transparent +usage. (Since I run "new" from an emacs keybinding, I've never +bothered with this renaming.) + ##Configure your emacs client## Add the following to your .emacs (this is on your client machine): @@ -91,6 +97,28 @@ files, via TRAMP, so that it can extract attachments and parse HTML. Work is afoot to make notmuch handle these tasks itself, so this part should soon be unecessary. +##A tip to speed things up## +If you have openssh >= 0.4, you can make use of the "ControlMaster" +feature. This allows you to reuse an existing connection. Therefore +if you keep a connection open, you won't have to authenticate every +time. + +Add the following to your ~/.ssh/config file: + + Host server_name + ControlMaster auto + ControlPath ~/.ssh/master0%r@%h:%p + +You can also se the Host to "*", if you want to use it for all +connections. I usually have an interactive ssh connection to my home +computer open, so I don't need to do anything more. But if not, you +can always run: + + ssh -Nf server_name + +which will open up a background connection, which you can then reuse +for all of your notmuch commands. + ##Problems## Some things won't work perfectly, and there might be some unexpected mismatches between normal usage and this sort of usage. If you're