From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: shell-command, its relatives, and aliases
Date: Fri, 14 Nov 2008 06:22:58 -0700 [thread overview]
Message-ID: <gfju3h$11p$1@ger.gmane.org> (raw)
In-Reply-To: <C502E7C6-5AF8-4106-A937-4AB102D8FFFD@alum.mit.edu>
Bill Rising wrote:
>
> I would like to use aliases in (shell-command ...) or (call-process
> region ...). Even if I tell the latter to behave as a login shell, and
> make sure that the aliases are available to the login shell, I cannot
> get them to execute.
>
> The shell can see the aliases without any problem, because I can send
> the -alias- command and get the list of aliases.
>
> It seems to me that elisp is trying to see if the command is defined
> before running it, instead of simply letting the shell chew on whatever
> was sent to it. This could be a grave misconception.
>
> In any case, is there are way to be able to use aliases within any of
> the 'execute this line/region without starting a buffer with a shell'
> commands?
call-process-region does not invoke the shell at all. If you want to
use any shell features (e.g. redirection, aliases) you need to use
shell-command-on-region.
There are several ways to make aliases available in the shell invoked
by Emacs. I would just explicitly read the shell definitions e.g.
M-| . ~/my_aliases.bash && alias_1 arg_1
Or you could create the ~/.emacs_bash file and read the shell
definitions there (automatically) -- see the Interactive Shell
node of the Emacs manual.
--
Kevin Rodgers
Denver, Colorado, USA
next prev parent reply other threads:[~2008-11-14 13:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-13 15:27 shell-command, its relatives, and aliases Bill Rising
2008-11-14 13:22 ` Kevin Rodgers [this message]
2008-11-21 13:44 ` Bill Rising
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='gfju3h$11p$1@ger.gmane.org' \
--to=kevin.d.rodgers@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).