Skip to content

Instantly share code, notes, and snippets.

@chsh
Created September 18, 2009 01:46
Show Gist options
  • Select an option

  • Save chsh/188826 to your computer and use it in GitHub Desktop.

Select an option

Save chsh/188826 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ "$@" ]
then
ARGS=$@
else
ARGS=.
fi
ps uxww | grep -v grep | grep Emacs >/dev/null
if [ "$?" == "1" ]; then
/Applications/Emacs.app/Contents/MacOS/Emacs $ARGS &
else
/usr/bin/emacsclient -n $ARGS
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment