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

Recommend comparing window-system with ns only #53

Closed nickserv closed 7 years ago

nickserv commented 7 years ago

In the Window Systems section of the Emacs manual (and the documentation for variable window-system), ns is mentioned but mac is not. Since this package seems to only be designed for Unix flavors of macOS (10+), checking the window-system variable against 'ns should be enough.

purcell commented 7 years ago

I'm not sure if 'mac is used by either Aquamacs or the railwaycat (?) Mac port, and I'm hesitant to change the instructions without knowing. Any idea?

nickserv commented 7 years ago

Good point, I didn't think about those (I assumed 'mac would have been a relic of OS 9). I just checked, Aquamacs reports 'ns, but oddly enough, Railwaycat Emacs reports 'mac. Would you prefer to leave a note for Railwaycat users or leave it as is?

purcell commented 7 years ago

Thanks for looking into that -- we both learned something! I think the answer is probably just to leave things as-is. Cheers!

nickserv commented 7 years ago

I recently found this example from use-package's updated README:

(eq system-type 'darwin)

I have a feeling this would work better, since official and Railwaycat Emacs both set it to 'darwin, What do you think?

purcell commented 7 years ago

Yes, but I don't want exec-path-from-shell to run if Emacs was started inside a terminal, since the correct environment variables will already be present there. system-type would always be darwin, in any frame type, hence checking window-system in the suggested snippet.

nickserv commented 7 years ago

Whoops I forgot that's nil in terminals, thanks!