help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to make emacs aware of bash aliases


From: Giorgos Keramidas
Subject: Re: how to make emacs aware of bash aliases
Date: Wed, 10 Sep 2008 02:39:31 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix)

On Tue, 9 Sep 2008 01:46:44 -0700 (PDT), etay.meiri@gmail.com wrote:
> Hi,
>
> I have the following aliases in my .bashrc:
>
> alias remake="make clean && make"
> alias makedebug="make CXXFLAGS=\"-g -DDEBUG\""
> alias makerelease="make CXXFLAGS=\"-g -O3\""
>
> They work fine from a regular bash shell.
>
> I'm trying to use them via emacs compile command and get the following
> result:
>
> -*- mode: compilation; default-directory: "~/workspace/demo_12_1/" -*-
> Compilation started at Tue Sep  9 11:40:15
>
> cd ~/workspace/demo_12_1/ && makedebug
> /bin/bash: makedebug: command not found
>
> Compilation exited abnormally with code 127 at Tue Sep  9 11:40:15
>
> How can I make the emacs shell aware of the aliases I defined?

I think this is because bash runs in `non-interactive' mode when Emacs
spawns a compile process.  You can try defining BASH_ENV in the runtime
environment of Emacs.  The `BASH_ENV' variable is expanded by bash, then
it tries to read commands from this file.  So you can set its value to
something like:

    BASH_ENV='~/.bashenv'

Then add the aliases of your non-interactive bash sessions to that file.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]