Skip to content

Instantly share code, notes, and snippets.

@heyarne
Created August 2, 2018 16:09
Show Gist options
  • Save heyarne/b43efb66fb314ec679034fca690d85ad to your computer and use it in GitHub Desktop.
Save heyarne/b43efb66fb314ec679034fca690d85ad to your computer and use it in GitHub Desktop.
emacsclient wrapper for fish shell
# This is a port of the emacs zsh script found on
# https://medium.com/@bobbypriambodo/blazingly-fast-spacemacs-with-persistent-server-92260f2118b7
# basically it checks whether we have a running emacs server; if we don't, it starts one
function e
emacsclient -n -e "(if (> (length (frame-list)) 1) 't)" ^ /dev/null | grep --silent t
if test $status -eq 1
# not running, -a '' starts a new server
emacsclient -a '' -nqc $argv > /dev/null ^ /dev/null
else
emacsclient -nq $argv > /dev/null ^ /dev/null
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment