unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* notmuch over ssh
@ 2021-02-10  9:52 Keegan Carruthers-Smith
  2021-02-10 10:51 ` Tomi Ollila
  0 siblings, 1 reply; 3+ messages in thread
From: Keegan Carruthers-Smith @ 2021-02-10  9:52 UTC (permalink / raw)
  To: notmuch

Hello.

Thought I'd share a hack I've been using recently. I have my 
notmuch database on another machine. I wanted to access it via my 
local emacs session. I didn't want to ssh in to the machine or 
sync the data to another machine. I realised all communication is 
done via the notmuch binary, so I wrote a wrapper script which 
runs notmuch via ssh:

  #!/usr/bin/env bash  args=()  for var in "$@" do 
      args+=($(printf '%q' "$var")) 
  done  exec ssh real.local -- notmuch "${args[@]}" 

Note I have hardcoded the remote (real.local). I also needed to 
escape arguments since the remote shell had a tendancy to 
interpret them. This escaping isn't fullproof, but has been 
working so far.

I put the above script on my PATH as "notmuch", and emacs 
magically uses it. Alternatively you could set the notmuch-command 
to point to the above shell script.

Cheers,
Keegan

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

end of thread, other threads:[~2021-02-10 11:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-10  9:52 notmuch over ssh Keegan Carruthers-Smith
2021-02-10 10:51 ` Tomi Ollila
2021-02-10 11:35   ` Chris Coutinho

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