Skip to content
This repository has been archived by the owner on Apr 13, 2019. It is now read-only.

Commit

Permalink
Added remote-emacs script to contrib
Browse files Browse the repository at this point in the history
  • Loading branch information
wiedzmin committed Aug 11, 2012
1 parent c191130 commit eb97fd8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions contrib/remote-emacs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh
#
# Use this script as your EDITOR to allow editing remote files with emacsclient.
# Works by connecting to the Emacs machine with SSH and using a suitable tramp prefix.

# How to reach this machine from the one that's running Emacs
ME=user@remote-host

# How to reach the machine that's running Emacs from this machine
THEY=user@host-running-emacs

if [ "${1#/}" != "$1" ]; then
# absolute path
exec ssh $THEY "emacsclient /$ME:$1"
else
# relative path
PWD=$(pwd)
exec ssh $THEY "emacsclient /$ME:$PWD/$1"
fi

0 comments on commit eb97fd8

Please sign in to comment.