aboutsummaryrefslogtreecommitdiff
path: root/Scripts/.local/scripts/eserver
blob: b613bba58c4a25e8824fa87476531dc32691003d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env sh

if [ $1 = "restart" ]
then
    eserver stop
    eserver start
elif [ $1 = "start" ]
then
    if [ -e "/tmp/emacs-server-id" ]
    then
        echo "Server running already!"
    else
        emacs --bg-daemon=MAIN
        touch /tmp/emacs-server
    fi
elif [ $1 = "stop" ]
then
    eserver --eval "(kill-emacs)"
    rm /tmp/emacs-server
else
    emacsclient -s MAIN $@
fi