Re:Making My Emacs Start Faster
by theophrastus on Wednesday December 09, 2015 @12:56PM
(#10705357)
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
[ Parent
| on HN ]
Starting from systemd is a league beyond what I've done. But you might like this script:
#!/bin/sh
emacsclient -t $@ || (emacs --daemon && emacsclient -t $@)
You'll want something like (unless (server-running-p)
(server-start))
in your init file.Or use
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.After some investigation I found that the option and the env var are called "alternate editor" and not "alternative editor".
Sorry, brainfart!
Re:Making My Emacs Start Faster
by NoGravitas on Thursday December 10, 2015 @07:26AM
(#10710278)
I use the system service ([email protected]) from [this blog post][0]. I used 'systemctl enable [email protected]' so that emacs is always started on boot.
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.
I don't have a systemd example, but here's a GNU dmd service that I use which shows how to properly start/stop the daemon:
https://git.dthompson.us/dotfiles.git/blob/HEAD:/dotfiles/.d...
I had a slightly different approach in that I made a script to launch Emacs server on-demand: https://github.com/qiushihe/dotpiles/blob/master/emacs/emacs...