Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
run emacs.app or emacsclient on Mac OS X
function e() {
if [ -z `pgrep Emacs` ]; then
env LANG=C open -a Emacs "$@"
return
fi
local client="/Applications/MacPorts/Emacs.app/Contents/MacOS/bin/emacsclient"
local uid=`id -u`
local socket="$TMPDIR"/emacs"$uid"/server
if [ ! -e "$socket" ]; then
socket=`getconf DARWIN_USER_TEMP_DIR`emacs"$uid"/server
fi
$client -n -s $socket "$@"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment