[OS X Emacs] How to configure '~/.bash_profile' and '~/.bashrc' to work with Aquamacs?

Peter Dyballa Peter_Dyballa at Web.DE
Fri Jul 8 04:32:20 EDT 2011


Am 08.07.2011 um 02:35 schrieb Christopher M. Balz:

> However, what is needed is to configure Aquamacs so that  
> '~/.bash_profile' executes once per Aquamacs session, and  
> '~/.bashrc' executes once per Aquamacs shell?  Otherwise, for  
> example with a link from '~/.emacs_bash' to '~/.bash_profile',  
> concatenated shell variables (commonly, $PATH) get a lot of  
> redundant values in them.
>
>
> On *nix and Cygwin-on-NT, GNU Emacs works out of the box with  
> '.bash_profile' and '.bashrc' in the expected way: '.bash_profile'  
> is executed once on the *nix system, and all shells, including Emacs  
> shell buffers, get the variables from that. Likewise, '.bashrc'  
> executes once per *nix shell, including for Emacs shell buffers.

The difference of Mac OS X is that it launches processes *without* a  
shell's aid. So you need to wrap a shell (script) around the launching  
of Aquamacs Emacs. Or you launch it from a command line (open ...).  
Another way is to use ~/.MacOSX/environment.plist, documented in / 
Developer/Documentation/DocSets/ 
com.apple.ADC_Reference_Library.CoreReference.docset/Contents/ 
Resources/Documents/documentation/MacOSX/Conceptual/BPRuntimeConfig/ 
Articles/EnvironmentVars.html or http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/EnvironmentVars.html 
.


The file ~/.emacs_bash is executed when inside any Emacs a(n  
interactive) shell is started, by this shell instance. You can insert  
those statements that perform or set up something particular for Emacs.

--
Greetings

   Pete

There is no worse tyranny than to force a man to pay for what he does  
not want merely because you think it would be good for him.
				– Robert Heinlein




More information about the MacOSX-Emacs mailing list