From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Giorgos Keramidas Newsgroups: gmane.emacs.help Subject: Re: how to make emacs aware of bash aliases Date: Wed, 10 Sep 2008 02:39:31 +0300 Organization: SunSITE.dk - Supporting Open source Message-ID: <873ak8rirw.fsf@kobe.laptop> References: <43f12347-4102-4636-b034-d08158ec8ed3@j22g2000hsf.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1221007258 1468 80.91.229.12 (10 Sep 2008 00:40:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 10 Sep 2008 00:40:58 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 10 02:41:54 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KdDmE-0002oz-KJ for geh-help-gnu-emacs@m.gmane.org; Wed, 10 Sep 2008 02:41:46 +0200 Original-Received: from localhost ([127.0.0.1]:40259 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KdDlE-0006bN-Fg for geh-help-gnu-emacs@m.gmane.org; Tue, 09 Sep 2008 20:40:44 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!feed118.news.tele.dk!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) Cancel-Lock: sha1:e+zlbnHULEbCO7qJ9A8WvMF0c1o= Original-Lines: 34 Original-NNTP-Posting-Host: 77.49.148.99 Original-X-Trace: news.sunsite.dk DXC=FKPkAmV1LIEc5QH[6O^X]LYSB=nbEKnkK5l7JOAVQ`jBL^MjGbH?lJH1TkjL@To9o6; [XnO`F30UkJV6AB Original-X-Complaints-To: staff@sunsite.dk Original-Xref: news.stanford.edu gnu.emacs.help:162030 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:57373 Archived-At: 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.