Created
May 24, 2012 17:56
-
-
Save aturley/2783129 to your computer and use it in GitHub Desktop.
emacsclient-like scripts for open files in remotely running emacs instances. Run remacsserver.sh on the machine running emacs (don't forget to start-server in emacs) and use remacsclient.sh FILENAME to open files. You need to have tramp set up in emacs, a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
if [ -z "${EMACSCLIENT_HOST}" ]; then | |
echo "EMACSCLIENT_HOST is not set!" | |
exit 1 | |
fi | |
FILENAME=$1 | |
if [ -z "${FILENAME}" ]; then | |
echo "Please specify a file name." | |
exit 1 | |
fi | |
FULL_FILENAME=$(pwd)/${FILENAME} | |
SELF_ADDRESS=$(ip addr show eth0 | grep 'inet ' | sed 's/.*inet \([^\/]*\).*/\1/') | |
echo "/$(whoami)@${SELF_ADDRESS}:${FULL_FILENAME}" | nc ${EMACSCLIENT_HOST} 9292 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while [ "1" == "1" ]; do | |
nc -l 9292 | xargs emacsclient -n | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment