X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=remoteusage.mdwn;h=1ecd3aa4aed638b589561f19e021ec4a59b773c8;hb=e04e2b521cc8baeba3641d7ddee0c9cd51ddea1b;hp=bf41efb2deaee28561957405df0bcab6fa018d45;hpb=9a6ab6d79d29b3006a32f4bc2d6f57e8e359e0c5;p=notmuch-wiki diff --git a/remoteusage.mdwn b/remoteusage.mdwn index bf41efb..1ecd3aa 100644 --- a/remoteusage.mdwn +++ b/remoteusage.mdwn @@ -29,7 +29,7 @@ You will need to have the following items in place: 2. a working notmuch emacs interface on another computer (let's call that computer "client") 3. password-free login (public key authentication) from client to -server. [Here](http://sial.org/howto/openssh/publickey-auth/) is a +server. [Here](http://www.debian-administration.org/articles/152) is a good page on how to set it up. 4. a reasonably fast connection. (This isn't really *neccessary*, but if your connection is too slow, this won't be very pleasant to use, @@ -79,19 +79,21 @@ be necessary in the furture. [ -d "${CACHE}" ] || mkdir -p "${CACHE}" CMD=$1 shift - ARGS=`echo $@ | sed 's/\\$/\\\\$/g'` + # we need to a little sanitizing of msg ids so the shell + # doesn't mangle them + printf -v ARGS "%q " "$@" $SSH_BIN $USER@$SSH_HOST $NOTMUCH_REMOTE_BIN ${CMD} ${ARGS} } notmuch_search () { - #COUNTER=1 notmuch_run search $@ | while read line; do - sleep 0.02 - #[ $((COUNTER % 3)) == "0" ] && sleep 0.03 - echo "${line}" - #COUNTER=$((COUNTER + 1)) + sleep 0.02 # Workaround a bug (missing lines) in the emacs interface + # NOTE: This workaround is no longer necessary as of + # git rev eead2382. You can just run + # `notmuch_run search $@' + echo "${line}" done } @@ -99,12 +101,12 @@ be necessary in the furture. notmuch_show () { if [ ${1} = "--format=raw" ]; then - hashed=`hash_name ${2}` - check_for_file_name ${hashed} || - notmuch_run show --format=raw ${2} > "${CACHE}/${hashed}" - cat "${CACHE}/${hashed}" + hashed=`hash_name ${2}` + check_for_file_name ${hashed} || + notmuch_run show --format=raw ${2} > "${CACHE}/${hashed}" + cat "${CACHE}/${hashed}" else - notmuch_run show $@ + notmuch_run show $@ fi }