Created
January 10, 2017 00:35
-
-
Save notetiene/e8e83bc3847fd976f91eb2242208a8bc to your computer and use it in GitHub Desktop.
Launch emacs server if it's not running or launch emacsclient
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 -e | |
emacs_server_is_running() { | |
return lsof -c emacs | grep server | tr -s " " | cut -d' ' -f8 | |
} | |
if [[ `emacs_server_is_running` ]]; then | |
emacsclient "$@" | |
else | |
emacs "$@" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment