How can I open Emacs on Mac OS X to boot from my $ PATH?

I start Snow Leopard and try to start Emacs so that when it starts, its output (getenv "PATH")matches output in Terminal.app echo $PATH.

In other words, I want to start Emacs from /Applications/Emacs.appand start with mine $PATH. I could not figure out how to do this in emacs, or with how I start emacs. So I spent most of my efforts trying to come up with a shell script that I can wrap with something like Platypus or Add .

So the closest I have now is:

echo MYPASSWD | sudo -S -u USERNAME -i nohup /Applications/Emacs.app/Contents/MacOS/Emacs > /dev/null &

which fails because nohup seems to throw my $ PATH in spite of the flag -i. The following does not throw mine PATH, but opens up the extra Terminal.app:

echo MYPASSWD | sudo -S -u USERNAME -i open /Applications/Emacs.app/Contents/MacOS/Emacs > /dev/null &

I tried to run this through do shell scriptin AppleScript, also to no avail.

Did I miss something basic? It doesn't seem to be hard. Thank!

+3
source share
4 answers

I wrote a little elisp some time ago to parse the env output and apply it to the Emacs environment because I did not want to support plist. Code http://paste.lisp.org/display/111574 .

+2
source

, . ~/.bashrc

source /etc/profile
source ~/.profile
+1

PATH .app, -

export PATH = $PATH:/path/to/the/program

EMACS, .

0

Source: https://habr.com/ru/post/1782233/


All Articles