purcell / exec-path-from-shell

Make Emacs use the $PATH set up by the user's shell
Other
1.43k stars 82 forks source link

support emacs daemon from launchd #35

Closed xiaoxinghu closed 8 years ago

xiaoxinghu commented 8 years ago

It works perfectly for GUI emacs. Is it possible to support emacs daemon that launched from ~/Library/LaunchAgents/homebrew.mxcl.emacs.plist?

purcell commented 8 years ago

I'm surprised that it doesn't just work already. What configuration do you have in your emacs startup file for exec-path-from-shell?

xiaoxinghu commented 8 years ago

I am using spacemacs here. The only config I can find is here.

purcell commented 8 years ago

Right. This is really a spacemacs issue, I believe.

bradJM commented 8 years ago

I had this problem without Spacemacs. It looks like window-system is nil when the Emacs daemon starts, which makes sense. Changing my configuration to:

(when (memq window-system '(mac ns nil))
  (exec-path-from-shell-initialize))

from:

(when (memq window-system '(mac ns))
  (exec-path-from-shell-initialize))

resolved it. Apologies for the comment on a closed issue, this is one of the first results I found while looking into the problem so it's likely others may land here.