Skip to content

Instantly share code, notes, and snippets.

@shigeyas
Created January 18, 2010 07:03
Show Gist options
  • Save shigeyas/279846 to your computer and use it in GitHub Desktop.
Save shigeyas/279846 to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# Open text editor Emacs with given file name. If no Emacs running, it launches
# automatically on MacOS X.
#
# save this file as whatever filename you like (I'm using 'e'), put in somehere
# in the path (I use ${HOME}/bin), make it executable (chmod +x e) then 'hash -r' or 'rehash'
#
if [ -x /usr/bin/open ]; then # may be MacOS
/usr/bin/open -a Emacs $*
else
# Launch via emacsclient if not on MacOS X
emacsclient $*
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment