Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I found that the elisp (emacs elisp) doesn't seem to read .bashrc, as the PATH variable is different from the one set in .bashrc, as I asked in here. I tried to load .bashrc using 'source .bashrc' in elisp, but when I do, elisp just quits.

  • What files does elisp read when being loaded?
  • Is there any way that I can use the setups that I made in .bashrc (alias, PATH, ...)?


Gilles gave me a good answer, and with the PATH, it depends on how I start the Aquamcs.

  • When I click the button to start Aquamacs, it has different PATH.
  • When I run 'aquamacs' from the command line, it has the same PATH.
share|improve this question
as I said on SO, .bashrc is not the right place to set PATH or other environment variables, and which place is right depends on your OS and other environment information which you haven't provided. – Gilles Sep 2 '10 at 7:30
up vote 2 down vote accepted

Aliases are a shell-specific concept, so bash aliases don't carry over to eshell. Eshell has its own alias system, documented in comments near the top of em-alias.el. In a nutshell, you define aliases with the alias commands, and they are stored automatically for future sessions. The syntax is not the same as bash, for example you would write alias l='ls -l $*' in eshell where you write alias ls='ls -l' in bash. Alias definitions live in a file called ~/.eshell/alias where "~/.eshell" is the value of eshell-directory-name.

Eshell also has a shell function system, documented in comments near the top of esh-cmd.el. Quoting the first paragraph:

Whenever a command is specified using a simple name, such as 'ls', Eshell will first look for a Lisp function of the name `eshell/ls'. If it exists, it will be called in preference to any other command which might have matched the name 'ls' (such as command aliases, external commands, Lisp functions of that name, etc).

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .