Created
January 6, 2012 16:27
-
-
Save masaedw/1571296 to your computer and use it in GitHub Desktop.
run emacs.app or emacsclient on Mac OS X
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
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