views:

255

answers:

1

Hi all, I compiled Emacs 23 on OS X Leopard and I am loving it. But one thing I noticed when I switched from Aquamancs is that I am no longer able to access my environment variables that I specify in my .bash_profile file. For instance, I have a line:

export WORK=/Users/myname/Documents/otherpaths/Work

So to open files I can type in the minibuffer:

Find file: $WORK/projectname/filename.txt

or something to that effect, to save myself the trouble of typing the whole file path.

I found some instructions on editing ~/.MacOSX/environment.plist, .profile, and .login files from this site:

http://www.emacswiki.org/emacs/CarbonEmacsPackage

but does not appear to work and I am not certain it is applicable. I wonder if anyone knows of a solution? Thanks in anticipation,

-Stephen

+4  A: 

you can tell emacs any environment variable by putting a line like

(setenv "WORK" "/Users/myname/Documents/otherpaths/Work")

in your emacs config file (.emacs, .emacs.d/init.el or whatever you use)

Probably Aquamacs and CarbonEmacs uses some tricks to achieve that without specifying it by hand. Take a look at the source code of both.

Carmine Paolino
Great! Thanks for the tip. I'm afraid to peek under the hood of these beasts... (incidentally, I got D.S.'s Code Reading which I thought might ease me into it but finding the entry-point really seems to be project-specific...)
Stephen