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