Is there a hook to execute stuff after I've run emacs --daemon
? I'd like to keep load stuff only when running emacs --daemon
and not when running emacs
.
I know it sounds like using square wheels, but I do have my reasons.
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.
Sign up to join this communityIs there a hook to execute stuff after I've run emacs --daemon
? I'd like to keep load stuff only when running emacs --daemon
and not when running emacs
.
I know it sounds like using square wheels, but I do have my reasons.
You can wrap the relevant portions of you init file in a conditional
on (daemonp)
, whose docstring reads:
Return non-
nil
if the current emacs process is a daemon. If the daemon was given a name argument, return that name.
So:
(when (daemonp)
(do-server-only-stuff-here))
server-start
hook: that code won't run if server-start
is used without using --daemon
.
– YoungFrog
Jan 11 '17 at 23:49
(daemonp)
. – Dan♦ Jul 27 '16 at 18:35