diff options
| author | Dmitry Gutov | 2022-08-15 02:22:59 +0300 |
|---|---|---|
| committer | Dmitry Gutov | 2022-08-15 02:22:59 +0300 |
| commit | ee3a674c7c9e39fe7ff296ce1f9830fc45520de8 (patch) | |
| tree | e8ba1e7be54314f208454e80e3d31044c913f3eb /doc/misc/eshell.texi | |
| parent | fe0e53d963899a16e0dd1bbc1ba10a6b59f7989e (diff) | |
| parent | 0a8e88fd83db5398d36064a7f87cff5b57da7284 (diff) | |
| download | emacs-scratch/font_lock_large_files.tar.gz emacs-scratch/font_lock_large_files.zip | |
Merge branch 'master' into scratch/font_lock_large_filesscratch/font_lock_large_files
Diffstat (limited to 'doc/misc/eshell.texi')
| -rw-r--r-- | doc/misc/eshell.texi | 82 |
1 files changed, 57 insertions, 25 deletions
diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index 9f9c88582f3..13f13163dd7 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi | |||
| @@ -201,7 +201,7 @@ history and invoking commands in a script file. | |||
| 201 | * Aliases:: | 201 | * Aliases:: |
| 202 | * History:: | 202 | * History:: |
| 203 | * Completion:: | 203 | * Completion:: |
| 204 | * for loop:: | 204 | * Control Flow:: |
| 205 | * Scripts:: | 205 | * Scripts:: |
| 206 | @end menu | 206 | @end menu |
| 207 | 207 | ||
| @@ -219,12 +219,18 @@ same name; if there is no match, it then tries to execute it as an | |||
| 219 | external command. | 219 | external command. |
| 220 | 220 | ||
| 221 | The semicolon (@code{;}) can be used to separate multiple command | 221 | The semicolon (@code{;}) can be used to separate multiple command |
| 222 | invocations on a single line. A command invocation followed by an | 222 | invocations on a single line. You can also separate commands with |
| 223 | ampersand (@code{&}) will be run in the background. Eshell has no job | 223 | @code{&&} or @code{||}. When using @code{&&}, Eshell will execute the |
| 224 | control, so you can not suspend or background the current process, or | 224 | second command only if the first succeeds (i.e.@: has an exit |
| 225 | bring a background process into the foreground. That said, background | 225 | status of 0); with @code{||}, Eshell will execute the second command |
| 226 | processes invoked from Eshell can be controlled the same way as any | 226 | only if the first fails. |
| 227 | other background process in Emacs. | 227 | |
| 228 | A command invocation followed by an ampersand (@code{&}) will be run | ||
| 229 | in the background. Eshell has no job control, so you can not suspend | ||
| 230 | or background the current process, or bring a background process into | ||
| 231 | the foreground. That said, background processes invoked from Eshell | ||
| 232 | can be controlled the same way as any other background process in | ||
| 233 | Emacs. | ||
| 228 | 234 | ||
| 229 | @node Arguments | 235 | @node Arguments |
| 230 | @section Arguments | 236 | @section Arguments |
| @@ -884,14 +890,18 @@ command (excluding the command name itself). | |||
| 884 | 890 | ||
| 885 | @vindex $$ | 891 | @vindex $$ |
| 886 | @item $$ | 892 | @item $$ |
| 887 | This is the result of the last command. In case of an external | 893 | This is the result of the last command. For external commands, it is |
| 888 | command, it is @code{t} or @code{nil}. | 894 | @code{t} if the exit code was 0 or @code{nil} otherwise. |
| 889 | 895 | ||
| 896 | @vindex eshell-lisp-form-nil-is-failure | ||
| 890 | @vindex $? | 897 | @vindex $? |
| 891 | @item $? | 898 | @item $? |
| 892 | This variable contains the exit code of the last command. If the last | 899 | This variable contains the exit code of the last command. If the last |
| 893 | command was a Lisp function, it is 0 for successful completion or 1 | 900 | command was a Lisp function, it is 0 for successful completion or 1 |
| 894 | otherwise. | 901 | otherwise. If @code{eshell-lisp-form-nil-is-failure} is |
| 902 | non-@code{nil}, then a command with a Lisp form, like | ||
| 903 | @samp{(@var{command} @var{args}@dots{})}, that returns @code{nil} will | ||
| 904 | set this variable to 2. | ||
| 895 | 905 | ||
| 896 | @vindex $COLUMNS | 906 | @vindex $COLUMNS |
| 897 | @vindex $LINES | 907 | @vindex $LINES |
| @@ -1008,19 +1018,46 @@ command for which this function provides completions; you can also name | |||
| 1008 | the function @code{pcomplete/MAJOR-MODE/COMMAND} to define completions | 1018 | the function @code{pcomplete/MAJOR-MODE/COMMAND} to define completions |
| 1009 | for a specific major mode. | 1019 | for a specific major mode. |
| 1010 | 1020 | ||
| 1011 | @node for loop | 1021 | @node Control Flow |
| 1012 | @section @code{for} loop | 1022 | @section Control Flow |
| 1013 | Because Eshell commands can not (easily) be combined with lisp forms, | 1023 | Because Eshell commands can not (easily) be combined with lisp forms, |
| 1014 | Eshell provides a command-oriented @command{for}-loop for convenience. | 1024 | Eshell provides command-oriented control flow statements for |
| 1015 | The syntax is as follows: | 1025 | convenience. |
| 1016 | 1026 | ||
| 1017 | @example | 1027 | Most of Eshell's control flow statements accept a @var{conditional}. |
| 1018 | @code{for VAR in TOKENS @{ command invocation(s) @}} | 1028 | This can take a few different forms. If @var{conditional} is a dollar |
| 1019 | @end example | 1029 | expansion, the condition is satisfied if the result is a |
| 1030 | non-@code{nil} value. If @var{conditional} is a @samp{@{ | ||
| 1031 | @var{subcommand} @}} or @samp{(@var{lisp form})}, the condition is | ||
| 1032 | satisfied if the command's exit status is 0. | ||
| 1033 | |||
| 1034 | @table @code | ||
| 1035 | |||
| 1036 | @item if @var{conditional} @{ @var{true-commands} @} | ||
| 1037 | @itemx if @var{conditional} @{ @var{true-commands} @} @{ @var{false-commands} @} | ||
| 1038 | Evaluate @var{true-commands} if @var{conditional} is satisfied; | ||
| 1039 | otherwise, evaluate @var{false-commands}. | ||
| 1040 | |||
| 1041 | @item unless @var{conditional} @{ @var{false-commands} @} | ||
| 1042 | @itemx unless @var{conditional} @{ @var{false-commands} @} @{ @var{true-commands} @} | ||
| 1043 | Evaluate @var{false-commands} if @var{conditional} is not satisfied; | ||
| 1044 | otherwise, evaluate @var{true-commands}. | ||
| 1020 | 1045 | ||
| 1021 | where @samp{TOKENS} is a space-separated sequence of values of | 1046 | @item while @var{conditional} @{ @var{commands} @} |
| 1022 | @var{VAR} for each iteration. This can even be the output of a | 1047 | Repeatedly evaluate @var{commands} so long as @var{conditional} is |
| 1023 | command if @samp{TOKENS} is replaced with @samp{@{ command invocation @}}. | 1048 | satisfied. |
| 1049 | |||
| 1050 | @item until @var{conditional} @{ @var{commands} @} | ||
| 1051 | Repeatedly evaluate @var{commands} until @var{conditional} is | ||
| 1052 | satisfied. | ||
| 1053 | |||
| 1054 | @item for @var{var} in @var{list}@dots{} @{ @var{commands} @} | ||
| 1055 | Iterate over each element of of @var{list}, storing the element in | ||
| 1056 | @var{var} and evaluating @var{commands}. If @var{list} is not a list, | ||
| 1057 | treat it as a list of one element. If you specify multiple | ||
| 1058 | @var{lists}, this will iterate over each of them in turn. | ||
| 1059 | |||
| 1060 | @end table | ||
| 1024 | 1061 | ||
| 1025 | @node Scripts | 1062 | @node Scripts |
| 1026 | @section Scripts | 1063 | @section Scripts |
| @@ -1811,11 +1848,6 @@ scrolls back. | |||
| 1811 | 1848 | ||
| 1812 | @item Menu support was removed, but never put back | 1849 | @item Menu support was removed, but never put back |
| 1813 | 1850 | ||
| 1814 | @item Using C-p and C-n with rebind gets into a locked state | ||
| 1815 | |||
| 1816 | This happened a few times in Emacs 21, but has been irreproducible | ||
| 1817 | since. | ||
| 1818 | |||
| 1819 | @item If an interactive process is currently running, @kbd{M-!} doesn't work | 1851 | @item If an interactive process is currently running, @kbd{M-!} doesn't work |
| 1820 | 1852 | ||
| 1821 | @item Use a timer instead of @code{sleep-for} when killing child processes | 1853 | @item Use a timer instead of @code{sleep-for} when killing child processes |