Last active
December 29, 2015 06:19
-
-
Save Bad-ptr/7628186 to your computer and use it in GitHub Desktop.
start or kill emacs daemon
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
#!/bin/bash | |
# https://gist.github.com/Bad-ptr/7628186 | |
DAEMON='server'; | |
if [ -n "$1" ]; | |
then | |
DAEMON="$1" | |
fi | |
emacsclient -f "$DAEMON" -a false -e 't'; | |
if [ "$?" -eq 1 ]; | |
then | |
#rm ~/.emacs.desktop.lock | |
rm "~/.emacs.d/server/$DAEMON" | |
emacs --daemon="$DAEMON" --eval '(setq server-use-tcp t)' "${@:2}" </dev/null | |
else | |
emacsclient -f "$DAEMON" -a false -e '(kill-emacs)' </dev/null | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment