with @code{ediff}). @xref{Comparing Files, , , emacs, The GNU Emacs
Manual}.
+ @vindex eshell-plain-diff-behavior
If @code{eshell-plain-diff-behavior} is non-@code{nil}, then this
command does not use Emacs's internal @code{diff}. This is the same
-as using @samp{alias diff '*diff $*'}.
+as using @samp{alias diff '*diff $@@*'}.
@item dirname
@cmindex dirname
but use Emacs's internal @code{grep} instead.
@xref{Grep Searching, , , emacs, The GNU Emacs Manual}.
+ @vindex eshell-plain-grep-behavior
If @code{eshell-plain-grep-behavior} is non-@code{nil}, then these
commands do not use Emacs's internal @code{grep}. This is the same as
-using @samp{alias grep '*grep $*'}, though this setting applies to all
-of the built-in commands for which you would need to create a separate
-alias.
+using @samp{alias grep '*grep $@@*'}, though this setting applies to
+all of the built-in commands for which you would need to create a
+separate alias.
@item history
@cmindex history
@command{locate} command and parses the results.
@xref{Dired and Find, , , emacs, The GNU Emacs Manual}.
+ @vindex eshell-plain-locate-behavior
If @code{eshell-plain-locate-behavior} is non-@code{nil}, then Emacs's
internal @code{locate} is not used. This is the same as using
-@samp{alias locate '*locate $*'}.
+@samp{alias locate '*locate $@@*'}.
@item ls
@cmindex ls
@node Aliases
@section Aliases
-@vindex $*
+@findex eshell-read-aliases-list
+ @vindex eshell-aliases-file
Aliases are commands that expand to a longer input line. For example,
-@command{ll} is a common alias for @code{ls -l}, and would be defined
-with the command invocation @kbd{alias ll 'ls -l $*'}; with this defined,
-running @samp{ll foo} in Eshell will actually run @samp{ls -l foo}.
-Aliases defined (or deleted) by the @command{alias} command are
-automatically written to the file named by @code{eshell-aliases-file},
-which you can also edit directly (although you will have to manually
-reload it).
-
-@vindex $1, $2, @dots{}
+@command{ll} is a common alias for @code{ls -l}. To define this alias
+in Eshell, you can use the command invocation @kbd{alias ll 'ls -l
+$@@*'}; with this defined, running @samp{ll foo} in Eshell will
+actually run @samp{ls -l foo}. Aliases defined (or deleted) by the
+@command{alias} command are automatically written to the file named by
+@code{eshell-aliases-file}, which you can also edit directly. After
+doing so, use @w{@kbd{M-x eshell-read-aliases-list}} to load the
+edited aliases.
+
Note that unlike aliases in Bash, arguments must be handled
-explicitly. Typically the alias definition would end in @samp{$*} to
-pass all arguments along. More selective use of arguments via
-@samp{$1}, @samp{$2}, etc., is also possible. For example,
+explicitly. Within aliases, you can use the special variables
+@samp{$*}, @samp{$0}, @samp{$1}, @samp{$2}, etc. to refer to the
+arguments passed to the alias.
+
+@table @code
+
+@vindex $*
+@item $*
+This expands to the list of arguments passed to the alias. For
+example, if you run @code{my-alias 1 2 3}, then @samp{$*} would be the
+list @code{(1 2 3)}. Note that since this variable is a list, using
+@samp{$*} in an alias will pass this list as a single argument to the
+aliased command. Therefore, when defining an alias, you should
+usually use @samp{$@@*} to pass all arguments along, splicing them
+into your argument list (@pxref{Dollars Expansion}).
+
+@vindex $0
+@item $0
+This expands to the name of the alias currently being executed.
+
+@vindex $1, $2, @dots{}, $9
+@item $1, $2, @dots{}, $9
+These variables expand to the nth argument (starting at 1) passed to
+the alias. This lets you selectively use an alias's arguments, so
@kbd{alias mcd 'mkdir $1 && cd $1'} would cause @kbd{mcd foo} to
create and switch to a directory called @samp{foo}.
coming from Bash can still use Bash-style globbing, as there are no
incompatibilities.
-By default, globs are case sensitive, except on MS-DOS/MS-Windows
+ @vindex eshell-glob-case-insensitive
+@vindex eshell-glob-case-insensitive
+Globs are case sensitive by default, except on MS-DOS/MS-Windows
systems. You can control this behavior via the
-@code{eshell-glob-case-insensitive} option. You can further customize
-the syntax and behavior of globbing in Eshell via the Customize group
-@code{eshell-glob} (@pxref{Easy Customization, , , emacs, The GNU
-Emacs Manual}).
+@code{eshell-glob-case-insensitive} option.
+
+@vindex eshell-glob-splice-results
+By default, Eshell expands the results of a glob as a sublist into the
+list of arguments. You can change this to splice the results in-place
+by setting @code{eshell-glob-splice-results} to a non-@code{nil}
+value. If you want to splice a glob in-place for just one use, you
+can use a subcommand form like @samp{$@@@{listify @var{my-glob}@}}.
+(Conversely, you can explicitly expand a glob as a sublist via
+@samp{$@{listify @var{my-glob}@}}.)
+
+You can further customize the syntax and behavior of globbing in
+Eshell via the Customize group @code{eshell-glob} (@pxref{Easy
+Customization, , , emacs, The GNU Emacs Manual}).
@table @samp
input text. To enable this module, add @code{eshell-rebind} to
@code{eshell-modules-list}.
-For example, it binds @kbd{C-a} to move to the beginning of the input
-text, @kbd{C-u} to kill the current input text, and @kbd{C-w} to
-@code{backward-kill-word}. If the history module is enabled, it also
-binds @kbd{C-p} and @kbd{C-n} to move through the input history.
+For example, it binds @kbd{C-u} to kill the current input text and
+@kbd{C-w} to @code{backward-kill-word}. If the history module is
+enabled, it also binds @kbd{C-p} and @kbd{C-n} to move through the
+input history.
+ @vindex eshell-confine-point-to-input
If @code{eshell-confine-point-to-input} is non-@code{nil}, this module
prevents certain commands from causing the point to leave the input
area, such as @code{backward-word}, @code{previous-line}, etc.