diff options
| author | Eli Zaretskii | 2022-03-01 15:08:38 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2022-03-01 15:08:38 +0200 |
| commit | 9dadcbe4297fdd52e2664e99fe693ba35a51eb57 (patch) | |
| tree | ce2f54ffd21b96be7feb6c34a780202b3a1d2f2c | |
| parent | 2c3d1b6bf41509bf0ba8995925fec9f20d8ed89d (diff) | |
| download | emacs-9dadcbe4297fdd52e2664e99fe693ba35a51eb57.tar.gz emacs-9dadcbe4297fdd52e2664e99fe693ba35a51eb57.zip | |
; * doc/misc/eshell.texi (Dollars Expansion): Fix markup.
| -rw-r--r-- | doc/misc/eshell.texi | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index 662c96dc920..f01023a1dca 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi | |||
| @@ -579,62 +579,63 @@ of familiarity. | |||
| 579 | 579 | ||
| 580 | @table @code | 580 | @table @code |
| 581 | 581 | ||
| 582 | @item $var | 582 | @item $@var{var} |
| 583 | Expands to the value bound to @code{var}. This is the main way to use | 583 | Expands to the value bound to @var{var}. This is the main way to use |
| 584 | variables in command invocations. | 584 | variables in command invocations. |
| 585 | 585 | ||
| 586 | @item $"var" | 586 | @item $"@var{var}" |
| 587 | @item $'var' | 587 | @item $'@var{var}' |
| 588 | Expands to the value bound to @code{var}. This is useful to | 588 | Expands to the value bound to @var{var}. This is useful to |
| 589 | disambiguate the variable name when concatenating it with another | 589 | disambiguate the variable name when concatenating it with another |
| 590 | value, such as @samp{$"var"-suffix}. | 590 | value, such as @samp{$"@var{var}"-suffix}. |
| 591 | 591 | ||
| 592 | @item $#var | 592 | @item $#@var{var} |
| 593 | Expands to the length of the value bound to @code{var}. Raises an error | 593 | Expands to the length of the value bound to @var{var}. Raises an error |
| 594 | if the value is not a sequence | 594 | if the value is not a sequence |
| 595 | (@pxref{Sequences Arrays Vectors, Sequences, , elisp, The Emacs Lisp Reference Manual}). | 595 | (@pxref{Sequences Arrays Vectors, Sequences, , elisp, The Emacs Lisp Reference Manual}). |
| 596 | 596 | ||
| 597 | @item $(lisp) | 597 | @item $(@var{lisp}) |
| 598 | Expands to the result of evaluating the S-expression @code{(lisp)}. On | 598 | Expands to the result of evaluating the S-expression @code{(@var{lisp})}. On |
| 599 | its own, this is identical to just @code{(lisp)}, but with the @code{$}, | 599 | its own, this is identical to just @code{(@var{lisp})}, but with the @code{$}, |
| 600 | it can be used in a string, such as @samp{/some/path/$(lisp).txt}. | 600 | it can be used in a string, such as @samp{/some/path/$(@var{lisp}).txt}. |
| 601 | 601 | ||
| 602 | @item $@{command@} | 602 | @item $@{@var{command}@} |
| 603 | Returns the output of @command{command}, which can be any valid Eshell | 603 | Returns the output of @command{@var{command}}, which can be any valid Eshell |
| 604 | command invocation, and may even contain expansions. | 604 | command invocation, and may even contain expansions. |
| 605 | 605 | ||
| 606 | @item $<command> | 606 | @item $<@var{command}> |
| 607 | As with @samp{$@{command@}}, evaluates the Eshell command invocation | 607 | As with @samp{$@{@var{command}@}}, evaluates the Eshell command invocation |
| 608 | @command{command}, but writes the output to a temporary file and | 608 | @command{@var{command}}, but writes the output to a temporary file and |
| 609 | returns the file name. | 609 | returns the file name. |
| 610 | 610 | ||
| 611 | @item $var[i] | 611 | @item $@var{var}[i] |
| 612 | Expands to the @code{i}th element of the value bound to @code{var}. If | 612 | Expands to the @code{i}th element of the value bound to @var{var}. If |
| 613 | the value is a string, it will be split at whitespace to make it a list. | 613 | the value is a string, it will be split at whitespace to make it a list. |
| 614 | Again, raises an error if the value is not a sequence. | 614 | Again, raises an error if the value is not a sequence. |
| 615 | 615 | ||
| 616 | @item $var[: i] | 616 | @item $@var{var}[: i] |
| 617 | As above, but now splitting occurs at the colon character. | 617 | As above, but now splitting occurs at the colon character. |
| 618 | 618 | ||
| 619 | @item $var[: i j] | 619 | @item $@var{var}[: i j] |
| 620 | As above, but instead of returning just a string, it now returns a list | 620 | As above, but instead of returning just a string, it now returns a list |
| 621 | of two strings. If the result is being interpolated into a larger | 621 | of two strings. If the result is being interpolated into a larger |
| 622 | string, this list will be flattened into one big string, with each | 622 | string, this list will be flattened into one big string, with each |
| 623 | element separated by a space. | 623 | element separated by a space. |
| 624 | 624 | ||
| 625 | @item $var["\\\\" i] | 625 | @item $@var{var}["\\\\" i] |
| 626 | Separate on backslash characters. Actually, the first argument -- if it | 626 | Separate on backslash characters. Actually, the first argument -- if it |
| 627 | doesn't have the form of a number, or a plain variable name -- can be | 627 | doesn't have the form of a number, or a plain variable name -- can be |
| 628 | any regular expression. So to split on numbers, use @samp{$var["[0-9]+" 10 20]}. | 628 | any regular expression. So to split on numbers, use |
| 629 | @samp{$@var{var}["[0-9]+" 10 20]}. | ||
| 629 | 630 | ||
| 630 | @item $var[hello] | 631 | @item $@var{var}[hello] |
| 631 | Calls @code{assoc} on @code{var} with @code{"hello"}, expecting it to be | 632 | Calls @code{assoc} on @var{var} with @code{"hello"}, expecting it to be |
| 632 | an alist (@pxref{Association List Type, Association Lists, , elisp, | 633 | an alist (@pxref{Association List Type, Association Lists, , elisp, |
| 633 | The Emacs Lisp Reference Manual}). | 634 | The Emacs Lisp Reference Manual}). |
| 634 | 635 | ||
| 635 | @item $#var[hello] | 636 | @item $#@var{var}[hello] |
| 636 | Returns the length of the cdr of the element of @code{var} who car is equal | 637 | Returns the length of the @code{cdr} of the element of @var{var} whose |
| 637 | to @code{"hello"}. | 638 | car is equal to @code{"hello"}. |
| 638 | 639 | ||
| 639 | @end table | 640 | @end table |
| 640 | 641 | ||