]> git.cworth.org Git - obsolete/notmuch-wiki/blobdiff - remoteusage.mdwn
remoteusage: Can this be simplified with the 0.5 release?
[obsolete/notmuch-wiki] / remoteusage.mdwn
index 15b5118b10c6125bb8bed6c5094076909611650a..a585bd776cf3494bc9e371071d86acb5b37f97e9 100644 (file)
@@ -36,6 +36,12 @@ if your connection is too slow, this won't be very pleasant to use,
 and certainly won't seem transparent.)
 
 ##Write a wrapper shell script##
+
+/!\ From reading about `notmuch show --format=raw` in the 0.5 (2010-11-11)
+release's *New command-line features* section of the `NEWS` file, it appears to
+me that step *2.* is no longer needed, and this whole procedure can be
+simplified a lot.  But I haven't tested / confirmed this yet.
+
 Now we will need to write a simple shell script that does two things:
 
 1.  replaces the call to the notmuch binary with a call to notmuch
@@ -54,18 +60,17 @@ be necessary in the furture.
     USER="user_name"
     SSH_HOST="server_name"
     NOTMUCH_REMOTE_BIN="/path/to/notmuch/on/server"
-    CACHE=${HOME}/.notmuch-cache.d
+    CACHE="${HOME}/.notmuch-cache.d"
 
     notmuch_run ()
     {
         if [ $1 = "search" ]; then
-       OUT=$($SSH_BIN $USER@$SSH_HOST $NOTMUCH_REMOTE_BIN $@)
-       echo "$OUT" | while read line; do
-           echo "$line";
-           sleep 0.1;
-       done
+            $SSH_BIN $USER@$SSH_HOST $NOTMUCH_REMOTE_BIN $@ | while read line; do
+                sleep 0.1
+                echo "${line}"
+           done
         else
-       $SSH_BIN $USER@$SSH_HOST $NOTMUCH_REMOTE_BIN $@
+           $SSH_BIN $USER@$SSH_HOST $NOTMUCH_REMOTE_BIN $@
         fi
     }
     
@@ -81,8 +86,8 @@ be necessary in the furture.
         scp ${SSH_HOST}:${1} "${FILE_DIR}" > /dev/null 2>&1
         retcode="${?}"
         if [ "${retcode}" -ne "0" ]; then
-       echo "Failed to fetch file" 1>&2
-       exit ${retcode}
+           echo "Failed to fetch file" 1>&2
+           exit ${retcode}
         fi
     }
     
@@ -120,9 +125,11 @@ message text.
 
     (defun notmuch-show-get-filename ()
       (let* ((orig-filename (notmuch-show-get-prop :filename))
-             (retvalue (shell-command-to-string (concat notmuch-command 
-                                                       " --get "
-                                                       orig-filename))))
+             (retvalue (progn 
+                         (message "Downloading... ")
+                         (shell-command-to-string (concat notmuch-command 
+                                                          " --get "
+                                                          orig-filename)))))
         (replace-regexp-in-string "\n" "" retvalue)))
 
 This will will use the "--get" option of the above
@@ -158,15 +165,3 @@ mismatches between normal usage and this sort of usage. If you're
 using this approach and run into any problems, please feel free to
 list them here. And, of course, if you improve on any of these
 approaches, please do edit this page and let people know!
-                               
-                               
-
-
-
-    
-
-       
-
-
-