If you have any details, links, hints about how to accomplish this (for instance, where does one find a proper "emacsclient.service" file?) please consider yourself emboldened
#!/bin/sh
emacsclient -t $@ || (emacs --daemon && emacsclient -t $@)
You'll want something like (unless (server-running-p)
(server-start))
in your init file. emacsclient -t --alternative-editor=""
and emacsclient will start the daemon if it hasn't already been started. You can also set the ALTERNATIVE_EDITOR environment variable to "" to achieve the same effect.I have a one-liner shell script called 'em' that just runs 'emacsclient -t $*' so that it can be set as $VISUAL and used by whatever command line tools use that.
https://git.dthompson.us/dotfiles.git/blob/HEAD:/dotfiles/.d...