+Add something like the following functions to your Emacs (general(*) or
+notmuch specific) configuration files:
+
+ ;; this should work as backend function when copied verbatim
+ (defun user/notmuch-remote-setup (sockname)
+ (setq notmuch-command "/path/to/nottoomuch-remote.bash")
+ (setenv "REMOTE_NOTMUCH_SSHCTRL_SOCK" sockname)
+ ;; If you use Fcc, you may want to do something like this on the client,
+ ;; to Bcc mails to yourself (if not, remove in your implementation):
+ (setq notmuch-fcc-dirs nil)
+ (add-hook 'message-header-setup-hook
+ (lambda () (insert (format "Bcc: %s <%s>\n"
+ (notmuch-user-name)
+ (notmuch-user-primary-email))))))
+
+ ;; this is just an example to configure using "default" master socket
+ (defun user/notmuch-remote-default ()
+ (interactive)
+ (user/notmuch-remote-setup "master-notmuch@remote:22")
+
+ ;; usage example2: set USER & HOST1 according to your remote...
+ (defun user/notmuch-remote-at-HOST1 ()
+ (interactive)
+ (user/notmuch-remote-setup "master-USER@HOST1:22")
+
+ ;; ... you probably got the point now -- add relevant funcs to your config
+ (defun user/notmuch-remote-at-HOST2 ()
+ (interactive)
+ (user/notmuch-remote-setup "master-USER@HOST2:22")
+
+... and if you want to activate your remote by default just call
+`(user/notmuch-remote-setup "master-USER@HOST:22")` without function call
+wrapper.
+
+(*) general most likely being ~/.emacs
+
+### Yet another possibility -- script to start emacs
+
+Instead of adding new configurations you could also write a special
+script which starts and configures emacs suitable for remote usage.
+Copy the following "template" to a new name e.g. in `$HOME/bin/`,
+edit the value for `master-USER@HOST3:22` and perhaps add more
+post eval-after-load notmuch configs there.
+
+ #!/bin/sh
+ :; exec "${EMACS:-emacs}" --debug-init --load "$0" "$@"; exit
+
+ (setenv "REMOTE_NOTMUCH_SSHCTRL_SOCK" "master-USER@HOST3:22")
+
+ (eval-after-load "notmuch"
+ (lambda ()
+ (setq notmuch-command (concat (file-name-directory load-file-name)
+ "remote-notmuch.sh"))
+ ;; place for more post-notmuch-load emacs configs if any
+ ))
+ (notmuch)
+
+ ;; Local Variables:
+ ;; mode: emacs-lisp
+ ;; End: