2

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.

4

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))
  • Note however that this is not equivalent to a server-start hook: that code won't run if server-start is used without using --daemon. – YoungFrog Jan 11 '17 at 23:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.