Skip to content

Instantly share code, notes, and snippets.

@chaoky
Created January 6, 2020 17:26
Show Gist options
  • Save chaoky/41ab26764688ea8250d973d4e265a9ba to your computer and use it in GitHub Desktop.
Save chaoky/41ab26764688ea8250d973d4e265a9ba to your computer and use it in GitHub Desktop.
Emacs will only create a new window if none exist
e() {
#return a list of all frames on $DISPLAY
emacsclient -e "(frames-on-display-list \"$DISPLAY\")" &>/dev/null
if [ $? -eq 0 ]; then
emacsclient -n "$@"
else
emacsclient -nc "$@"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment