unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* rfc for notmuch remote access script
@ 2016-10-27 17:25 Tomi Ollila
  2016-10-27 21:37 ` Matt Armstrong
  2016-10-28  6:42 ` Jani Nikula
  0 siblings, 2 replies; 11+ messages in thread
From: Tomi Ollila @ 2016-10-27 17:25 UTC (permalink / raw)
  To: notmuch

Hi

j4ni on irc expressed interest of having an installation option for
notmuch-emacs and a notmuch remote access script as 'notmuch'

This got me thinking what kind of script would fulfill all the needs
that I know of.

and this is the result of that:

--8<----8<----8<----8<----8<----8<----8<----8<--

#!/bin/bash

set -euf

if [ "${NOTMUCH_REMOTE_XTRACE_FILE-}" ]; then
	exec 6>>"$NOTMUCH_REMOTE_XTRACE_FILE"
	BASH_XTRACEFD=6
	echo -- >&6
	set -x
	env >&6
fi

: ${NOTMUCH_REMOTE_SSH_COMMAND:=ssh}
: ${NOTMUCH_REMOTE_SSH_ARGS=}
: ${NOTMUCH_REMOTE_HOST:=notmuch}
: ${NOTMUCH_REMOTE_COMMAND:=notmuch}

printf -v ARGS '%q ' "$@"

exec "$NOTMUCH_REMOTE_SSH_COMMAND" $NOTMUCH_REMOTE_SSH_ARGS \
	"$NOTMUCH_REMOTE_HOST" $NOTMUCH_REMOTE_COMMAND $ARGS

--8<----8<----8<----8<----8<----8<----8<----8<--

out of the box this works like the instructions given in
https://notmuchmail.org/remoteusage/ (with ~/.ssh/config changes)
and https://notmuchmail.org/remoteusage/124/ (with suitable wrapping
so that contents of ~/.ssh/ can be left unmodified)

also, debugging is easy. (setenv "NOTMUCH_REMOTE_XTRACE_FILE" "xtrace.log")
inside emacs, and NOTMUCH_REMOTE_XTRACE_FILE=xtrace.log notmuch-remote
on the command line.

what do you think?

Tomi

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-11-04 18:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-27 17:25 rfc for notmuch remote access script Tomi Ollila
2016-10-27 21:37 ` Matt Armstrong
2016-10-30 21:31   ` Tomi Ollila
2016-10-28  6:42 ` Jani Nikula
2016-10-28 10:35   ` David Bremner
2016-10-30  9:35     ` Jani Nikula
2016-10-30 11:34       ` David Bremner
2016-10-30 12:39         ` Mark Walters
2016-10-30 14:36           ` Jani Nikula
2016-10-30 15:52           ` David Bremner
2016-11-04 18:54         ` Jani Nikula

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).