Skip to content
Newer
Older
100755 29 lines (22 sloc) 750 Bytes
d9d5309 @jpr5 Change bash invocation to inherit environment explicitly.
jpr5 authored Apr 26, 2010
1 #!/usr/bin/env bash
2
908eab8 @jpr5 Initial commit.
jpr5 authored Mar 9, 2010
3 EMACSSERVER="/Applications/Emacs.app/Contents/MacOS/Emacs"
4 EMACSCLIENT="/Applications/Emacs.app/Contents/MacOS/bin/emacsclient"
5
6 # Premise: Almost always want to invoke emacsclient. Thus we catch the special
7 # cases of running emacs itself, otherwise pass through to emacsclient.
8
9 # if no args, invoke background emacs
10 # if (-nw, -batch, --batch) in args, invoke emacs
11 # else invoke emacsclient
12
13 if test $# -eq 0; then
14 # TODO: detect that the server socket already exists and isn't stale
15 $EMACSSERVER -D --iconic &
16 exit
17 fi
18
19 for opt in "-nw" "-batch" "--batch"; do
20 for arg in $*; do
21 if test "$opt" == "$arg"; then
22 $EMACSSERVER $*
23 exit
24 fi
25 done
26 done
27
28 $EMACSCLIENT $*
Something went wrong with that request. Please try again.