emacsclient.sh 337 Bytes
Newer Older
1
2
3
4
5
6
#!/bin/sh

# Starts emacs daemon if not already started.

x=`emacsclient --alternate-editor '' --eval '(x-display-list)' 2>/dev/null`
if [ -z "$x" ] ;then
Tristan Carel's avatar
Tristan Carel committed
7
    emacsclient --alternate-editor "" --create-frame "$@"
8
else
Tristan Carel's avatar
Tristan Carel committed
9
    # prevent creating another X frame if there is at least one present.
Tristan Carel's avatar
Tristan Carel committed
10
    emacsclient --alternate-editor "" "$@"
11
fi