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

Is it still necessary to enable exec-path-from-shell under Linux? #86

Closed yuzumx closed 5 years ago

yuzumx commented 5 years ago

Hello:

Is it still necessary to enable this package on Linux now? The premise is the latest Emacs version and popular distributions/shells/system configurations/Emacs distributions.

Thank you.

purcell commented 5 years ago

It depends, but sometimes yes, I believe.

purcell commented 5 years ago

(Ultimately users will need to make their own decisions about when it's necessary. Generally enabling the package too often is not a bad thing in terms of correctness, it just slows down startup slightly.)

azzamsa commented 5 years ago

Yes, I've tried to not use exec-path package. some packages can't find the executable.

It adds some startup time. but I try to embrace it. we don't restart Emacs too often, right.

Update: 2019-03-30 06:04

Yes, I admit that exec-path-from-shell is slow because it load all my bash dotfiles. So I invest time to examine what packages failed to work without it, they are (in my daily usage):

So I need to add their executable PATH in order to make them work, because Emacs didn't aware of their paths. You can see what Emacs aware of by using (getenv "PATH"). I need to add something like:

  (setenv "PATH" (concat "/usr/local/go/bin:"
                         (getenv "PATH")))
  (add-to-list 'exec-path "/usr/local/go/bin"))

Now, because I didn't invoke any shell activity during startup, some of my OS config are not loaded (before they were loaded because of Emacs is auto-start in my machine), so I add some OS config to .xsessionrc

Hope that helps.