unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* how to make emacs aware of bash aliases
@ 2008-09-09  8:46 etay.meiri
  2008-09-09 23:39 ` Giorgos Keramidas
  0 siblings, 1 reply; 2+ messages in thread
From: etay.meiri @ 2008-09-09  8:46 UTC (permalink / raw)
  To: help-gnu-emacs

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?

Thanks a lot,

-Etay


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: how to make emacs aware of bash aliases
  2008-09-09  8:46 how to make emacs aware of bash aliases etay.meiri
@ 2008-09-09 23:39 ` Giorgos Keramidas
  0 siblings, 0 replies; 2+ messages in thread
From: Giorgos Keramidas @ 2008-09-09 23:39 UTC (permalink / raw)
  To: help-gnu-emacs

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.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-09-09 23:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-09  8:46 how to make emacs aware of bash aliases etay.meiri
2008-09-09 23:39 ` Giorgos Keramidas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).