-
-
Save nebirhos/992376 to your computer and use it in GitHub Desktop.
Emacsclient wrapper
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 - Edit file in emacs client, launchin emacs daemon if necessary | |
# alternate falls on emacs --daemon | |
EMACS='emacsclient --alternate-editor=""' | |
# count opened window frames | |
XFRAMES=`emacsclient -e "(frame-list)" 2>/dev/null | grep -o '#<frame [^F][^>]*>' | wc -l` | |
if [ $XFRAMES = 0 ]; then | |
EMACS="$EMACS -c" | |
fi | |
eval "$EMACS -n $@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment