purcell / exec-path-from-shell

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

eshell could not find executables on exec-path #74

Closed ZelphirKaltstahl closed 6 years ago

ZelphirKaltstahl commented 6 years ago

exec-path-from-shell did not work for me, until I removed (require 'em-pred) from my ~/.emacs.d/init.el. I added it previously to ensure that I could add to the eshell-predicate-alist and forgot to remove that, when I found a better working way doing:

(if (boundp 'eshell-predicate-alist)
    (add-to-list 'eshell-predicate-alist '(?T . (eshell-org-file-tags)))
  (progn
    (setq eshell-predicate-alist '())
    (add-to-list 'eshell-predicate-alist '(?T . (eshell-org-file-tags)))))

Maybe this will help anyone experiencing the same issue.

purcell commented 6 years ago

Thanks. Just looked at that file and couldn't see why it would make a difference. Any insights?

P.S. The code you posted above should be exactly equivalent to simply (add-to-list 'eshell-predicate-alist '(?T . (eshell-org-file-tags))).

ZelphirKaltstahl commented 6 years ago

@purcell Somehow I got errors on startup when I only used add-to-list without checking if it exists. It might have been because of the em-pred requirering as well (and thus the code might be redundant now.). It was about the symbol eshell-predicate-alist being void when trying to add to it, so I decided to check, just so that the startup continues, even if for some reason that list was not defined.

purcell commented 6 years ago

Ah. From what you've written, I think you probably just had an error in your emacs startup file which caused it to be aborted before exec-path-from-shell was run. So I don't feel like there's any issue on this side. :-)