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

advice in README might not work under `emacs -nw` #97

Closed dickmao closed 4 years ago

purcell commented 4 years ago

I don't understand the motivation for this change, sorry, but it looks undesirable to me.

dickmao commented 4 years ago

Okay, it's just if my .emacs contains:

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

and I run emacs -nw, then the above is always a no-op.

purcell commented 4 years ago

and I run emacs -nw, then the above is always a no-op.

Yes, that's the intention. You run emacs -nw from inside a shell session, so the environment variables that exec-path-from-shell would grab have already been passed to emacs.

dickmao commented 4 years ago

Oh, then I misunderstood "This sets $MANPATH, $PATH and exec-path from your shell, but only on OS X and Linux." I had thought the checking of window-system was to exclude msdos, but it seems it also does double duty as ensuring we're on a windowing system at all.

So to be clear, this module is meant to patch the environments of X-enabled emacses spawned from windows managers, and not X-enabled emacses from shells (even though in both cases, exec-path-from-shell-initialize is triggered)?

purcell commented 4 years ago

Yep. I'll look to see whether the README needs clarification...