From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Shell aliases as shell-commands
Date: Thu, 22 Jan 2009 14:57:23 +0100 [thread overview]
Message-ID: <87mydj78ak.fsf@tux.homenetwork> (raw)
In-Reply-To: vs7r62vwoa2.fsf@pax07e3.mipool.uni-jena.de
Michael Heerdegen <michael_heerdegen@web.de> writes:
> Hello,
>
> I agree that that my solution with BASH_ENV is not very clean. I would
> suggest the following elisp code which works without setting env vars:
>
> (defadvice shell-command (before my-shell-command activate)
> (ad-set-arg
> 0
> (concat "source ~/.bashrc; shopt -s -q expand_aliases;\n "
> (ad-get-arg 0))))
>
> (you could replace .bashrc by an individual file especially written
> for that purpose).
>
> What do you think about it?
Just want to mention (again) that eshell-command work out of the box for
aliases. No config is needed.
The aliases are stored by default in .emacs.d/.eshell and are
different of those you have in .bashrc, that is a good thing:
You may have alias in your bashrc that are good for interactive shell
but no good for non-interactive shells.
And that avoid modifying bash with shopt (strange things can happen)
And you have file-name completion also.
To add an alias:
M-x eshell-command
alias Mcle mount /dev/sdb1
Now (i bind eshell-command to C-!)
C-! Mcle ==> mount my usbkey
--
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France
next prev parent reply other threads:[~2009-01-22 13:57 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-19 21:11 Shell aliases as shell-commands Sebastian Tennant
2009-01-19 22:02 ` Peter Dyballa
2009-01-20 9:09 ` Sebastian Tennant
2009-01-20 9:38 ` Peter Dyballa
2009-01-20 10:18 ` Sebastian Tennant
2009-01-20 11:43 ` Peter Dyballa
2009-01-20 15:40 ` Sebastian Tennant
2009-01-20 16:43 ` Peter Dyballa
2009-01-20 17:09 ` Thierry Volpiatto
2009-01-20 18:03 ` Sebastian Tennant
[not found] ` <mailman.5330.1232446602.26697.help-gnu-emacs@gnu.org>
2009-01-20 11:02 ` Teemu Likonen
2009-01-20 11:10 ` Sebastian Tennant
2009-01-21 5:46 ` Barry Margolin
2009-01-21 10:51 ` Sebastian Tennant
2009-01-21 10:40 ` Michael Heerdegen
2009-01-21 15:26 ` Sebastian Tennant
2009-01-21 15:49 ` Peter Dyballa
2009-01-21 17:07 ` Sebastian Tennant
2009-01-21 18:26 ` Peter Dyballa
[not found] ` <mailman.5445.1232552977.26697.help-gnu-emacs@gnu.org>
2009-01-22 11:52 ` Michael Heerdegen
2009-01-22 13:51 ` Peter Dyballa
2009-01-22 20:26 ` Sebastian Tennant
2009-01-22 13:57 ` Thierry Volpiatto [this message]
[not found] ` <mailman.5510.1232633053.26697.help-gnu-emacs@gnu.org>
2009-01-22 17:55 ` Michael Heerdegen
2009-01-22 20:35 ` Sebastian Tennant
[not found] ` <mailman.5443.1232551479.26697.help-gnu-emacs@gnu.org>
2009-02-17 15:14 ` David Combs
2009-02-17 23:18 ` Peter Dyballa
[not found] ` <mailman.5332.1232449359.26697.help-gnu-emacs@gnu.org>
2009-02-17 15:08 ` David Combs
[not found] <mailman.5279.1232399379.26697.help-gnu-emacs@gnu.org>
2009-01-19 22:53 ` Chetan
2009-01-20 9:07 ` Sebastian Tennant
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mydj78ak.fsf@tux.homenetwork \
--to=thierry.volpiatto@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).