Created
July 22, 2010 14:24
-
-
Save developernotes/486027 to your computer and use it in GitHub Desktop.
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/sh | |
# Send the file to our running Emacs and bring it to the foreground. | |
/Applications/Emacs.app/Contents/MacOS/bin/emacsclient "${1}" \ | |
2> /dev/null \ | |
&& open -a Emacs | |
# If that failed, then open a new emacs visiting the file. | |
if [ $? -ne 0 ]; then | |
EOPEN_DIR="${PWD}" EOPEN_FILE="${1}" open -a Emacs | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment