diff options
| author | Noam Postavsky | 2017-09-29 21:00:10 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2017-09-30 20:01:33 -0400 |
| commit | ba9139c501ed8220980e898f127e293e8f263ea1 (patch) | |
| tree | e37da419afa420a660c37cf67ca5fd2a705cacd2 /doc/misc/eshell.texi | |
| parent | 43fac3beae75a38cf758ec94039c0d7a4edc9399 (diff) | |
| download | emacs-ba9139c501ed8220980e898f127e293e8f263ea1.tar.gz emacs-ba9139c501ed8220980e898f127e293e8f263ea1.zip | |
Revert "Don't lose arguments to eshell aliases (Bug#27954)"
It broke the established argument handling methods provided by eshell
aliases (Bug#28568).
* doc/misc/eshell.texi (Aliases): Fix example, call out use of
arguments in aliases.
* lisp/eshell/em-alias.el (eshell-maybe-replace-by-alias): Ignore
ARGS.
Diffstat (limited to 'doc/misc/eshell.texi')
| -rw-r--r-- | doc/misc/eshell.texi | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index 8963826c4cc..8a607ef7702 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi | |||
| @@ -431,13 +431,20 @@ would in an Elisp program. Eshell provides a command version of | |||
| 431 | 431 | ||
| 432 | Aliases are commands that expand to a longer input line. For example, | 432 | Aliases are commands that expand to a longer input line. For example, |
| 433 | @command{ll} is a common alias for @code{ls -l}, and would be defined | 433 | @command{ll} is a common alias for @code{ls -l}, and would be defined |
| 434 | with the command invocation @samp{alias ll ls -l}; with this defined, | 434 | with the command invocation @kbd{alias ll 'ls -l $*'}; with this defined, |
| 435 | running @samp{ll foo} in Eshell will actually run @samp{ls -l foo}. | 435 | running @samp{ll foo} in Eshell will actually run @samp{ls -l foo}. |
| 436 | Aliases defined (or deleted) by the @command{alias} command are | 436 | Aliases defined (or deleted) by the @command{alias} command are |
| 437 | automatically written to the file named by @code{eshell-aliases-file}, | 437 | automatically written to the file named by @code{eshell-aliases-file}, |
| 438 | which you can also edit directly (although you will have to manually | 438 | which you can also edit directly (although you will have to manually |
| 439 | reload it). | 439 | reload it). |
| 440 | 440 | ||
| 441 | Note that unlike aliases in Bash, arguments must be handled | ||
| 442 | explicitly. Typically the alias definition would end in @samp{$*} to | ||
| 443 | pass all arguments along. More selective use of arguments via | ||
| 444 | @samp{$1}, @samp{$2}, etc., is also possible. For example, | ||
| 445 | @kbd{alias mcd 'mkdir $1 && cd $1'} would cause @kbd{mcd foo} to | ||
| 446 | create and switch to a directory called @samp{foo}. | ||
| 447 | |||
| 441 | @node History | 448 | @node History |
| 442 | @section History | 449 | @section History |
| 443 | @cmindex history | 450 | @cmindex history |