Skip to content

Instantly share code, notes, and snippets.

@developernotes
Created July 22, 2010 16:10
Show Gist options
  • Save developernotes/486174 to your computer and use it in GitHub Desktop.
Save developernotes/486174 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Send the file to our running Emacs and bring it to the foreground.
~/tools/emacs/bin/emacsclient "${1}" \
2> /dev/null \
# If that failed, then open a new emacs visiting the file.
if [ $? -ne 0 ]; then
dir=sed "/s/\/cygdrive\//g/" ${PWD} 2> /dev/null
EOPEN_DIR="${dir}" EOPEN_FILE="${1}" ~/tools/emacs/bin/runemacs.exe
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment