I'm using emacs26 on macOS and using server-client for the fast initialization.
However, it's a bit annoying that a new emacs instance is always spawning when I run "Emacs.app" with SpotLight instead of running 'emacsclient' in terminal. What I want is running emacs server as a background service when first emacs instance is created (when there is no running server), and other new instances are connected to the server without massive library loading.
To achieve that, I think these four functionalities are needed for the init.el.
- Check running emacs server.
- Run server as a background service.(For the first instance)
- Attach to running server.
- Skip rest of initialization.
Is there any example of init.el showing those functionalities?