; * doc/misc/eshell.texi (Dollars Expansion): Fix markup.

This commit is contained in:
Eli Zaretskii 2022-03-01 15:08:38 +02:00
parent 2c3d1b6bf4
commit 9dadcbe429

View file

@ -579,62 +579,63 @@ of familiarity.
@table @code @table @code
@item $var @item $@var{var}
Expands to the value bound to @code{var}. This is the main way to use Expands to the value bound to @var{var}. This is the main way to use
variables in command invocations. variables in command invocations.
@item $"var" @item $"@var{var}"
@item $'var' @item $'@var{var}'
Expands to the value bound to @code{var}. This is useful to Expands to the value bound to @var{var}. This is useful to
disambiguate the variable name when concatenating it with another disambiguate the variable name when concatenating it with another
value, such as @samp{$"var"-suffix}. value, such as @samp{$"@var{var}"-suffix}.
@item $#var @item $#@var{var}
Expands to the length of the value bound to @code{var}. Raises an error Expands to the length of the value bound to @var{var}. Raises an error
if the value is not a sequence if the value is not a sequence
(@pxref{Sequences Arrays Vectors, Sequences, , elisp, The Emacs Lisp Reference Manual}). (@pxref{Sequences Arrays Vectors, Sequences, , elisp, The Emacs Lisp Reference Manual}).
@item $(lisp) @item $(@var{lisp})
Expands to the result of evaluating the S-expression @code{(lisp)}. On Expands to the result of evaluating the S-expression @code{(@var{lisp})}. On
its own, this is identical to just @code{(lisp)}, but with the @code{$}, its own, this is identical to just @code{(@var{lisp})}, but with the @code{$},
it can be used in a string, such as @samp{/some/path/$(lisp).txt}. it can be used in a string, such as @samp{/some/path/$(@var{lisp}).txt}.
@item $@{command@} @item $@{@var{command}@}
Returns the output of @command{command}, which can be any valid Eshell Returns the output of @command{@var{command}}, which can be any valid Eshell
command invocation, and may even contain expansions. command invocation, and may even contain expansions.
@item $<command> @item $<@var{command}>
As with @samp{$@{command@}}, evaluates the Eshell command invocation As with @samp{$@{@var{command}@}}, evaluates the Eshell command invocation
@command{command}, but writes the output to a temporary file and @command{@var{command}}, but writes the output to a temporary file and
returns the file name. returns the file name.
@item $var[i] @item $@var{var}[i]
Expands to the @code{i}th element of the value bound to @code{var}. If Expands to the @code{i}th element of the value bound to @var{var}. If
the value is a string, it will be split at whitespace to make it a list. the value is a string, it will be split at whitespace to make it a list.
Again, raises an error if the value is not a sequence. Again, raises an error if the value is not a sequence.
@item $var[: i] @item $@var{var}[: i]
As above, but now splitting occurs at the colon character. As above, but now splitting occurs at the colon character.
@item $var[: i j] @item $@var{var}[: i j]
As above, but instead of returning just a string, it now returns a list As above, but instead of returning just a string, it now returns a list
of two strings. If the result is being interpolated into a larger of two strings. If the result is being interpolated into a larger
string, this list will be flattened into one big string, with each string, this list will be flattened into one big string, with each
element separated by a space. element separated by a space.
@item $var["\\\\" i] @item $@var{var}["\\\\" i]
Separate on backslash characters. Actually, the first argument -- if it Separate on backslash characters. Actually, the first argument -- if it
doesn't have the form of a number, or a plain variable name -- can be doesn't have the form of a number, or a plain variable name -- can be
any regular expression. So to split on numbers, use @samp{$var["[0-9]+" 10 20]}. any regular expression. So to split on numbers, use
@samp{$@var{var}["[0-9]+" 10 20]}.
@item $var[hello] @item $@var{var}[hello]
Calls @code{assoc} on @code{var} with @code{"hello"}, expecting it to be Calls @code{assoc} on @var{var} with @code{"hello"}, expecting it to be
an alist (@pxref{Association List Type, Association Lists, , elisp, an alist (@pxref{Association List Type, Association Lists, , elisp,
The Emacs Lisp Reference Manual}). The Emacs Lisp Reference Manual}).
@item $#var[hello] @item $#@var{var}[hello]
Returns the length of the cdr of the element of @code{var} who car is equal Returns the length of the @code{cdr} of the element of @var{var} whose
to @code{"hello"}. car is equal to @code{"hello"}.
@end table @end table