diff options
| author | Stefan Kangas | 2023-01-19 06:30:25 +0100 |
|---|---|---|
| committer | Stefan Kangas | 2023-01-19 06:30:25 +0100 |
| commit | 9161a302c9f9fbfa1a8f33181bb332d2c5df3aa7 (patch) | |
| tree | 21de62aa23f4ad770ff8afe322c0223ea7e0af76 /doc | |
| parent | efb9ec11bbee3871d77dc4e9217bd9293d525d5d (diff) | |
| parent | db727873803a974ba210c4942ae7cbcc3d6268ab (diff) | |
| download | emacs-9161a302c9f9fbfa1a8f33181bb332d2c5df3aa7.tar.gz emacs-9161a302c9f9fbfa1a8f33181bb332d2c5df3aa7.zip | |
Merge from origin/emacs-29
db727873803 ruby-ts-mode: Use font-lock-constant-face for true/false/nil
819719330ad (ruby-ts--indent-rules): Add a rule for continuation of a...
94b9cbf96fb (ruby-ts--parent-call-or-bol): Handle more cases with nes...
ba33b83ce4b (ruby-ts--statement-container-regexp): Remove "parenthesi...
f2bedf695c1 ruby-ts-mode: Handle indent in parenless calls much close...
758ac5eabbe Fix split-window-below for the case when split-window-kee...
8e9783b4ce4 Rebind in read-regexp-map ‘M-c’ to ‘M-s c’ compatible wit...
78f93d92b28 * lisp/vc/vc-dir.el: Make keys ‘% m’ and ‘* %’ compatible...
dc3f85fd4b0 Use proper types for Eshell warnings
6a8338a8bc8 ; Avoid byte-compiler warning in cc-fonts.el.
9186be20aeb ; Clarify doc strings of some functions in files.el
bd5ef3ef95e Improve the documentation of 'auto-mode-alist' search
1798ff5a663 ; Fix minor mistakes in documentation
faee7e1f1bd ; * lisp/treesit.el (treesit-font-lock-fontify-region): M...
24f0dfd3731 Revert "Revert "Add c-or-c++-ts-mode (bug#59613)""
ac3bc775b6f Make it harder to misactivate tree-sitter font-lock fast ...
bdd82fa7977 ; * src/treesit.c: Remove unused boilerplate.
343b9b3dfe3 ruby-ts-mode: Obey the option ruby-method-call-indent
045404d1aac ruby-ts-mode: Obey the option ruby-after-operator-indent
300ca6ac372 ruby-ts-mode: Fix indent after operator or conditional
ac5516bd7d5 ruby-ts-mode: Fix/change indentation of a continuation me...
5e2e68a0c2d ruby-ts-mode: Fix indent inside parenthesized_expr and el...
9ed9ff4690a ruby-ts-mode: Fix the rules for hanging arrays and hashes
c4f0b6ccea1 Add more detail about how to invoke Eshell commands
dbac923b9df CC Mode: On removal of "typedef", remove pertinent types ...
56d69c2fc47 ; Relax timeouts for failing ERC test
183e7492702 Don't preserve non-module minor modes in erc-open
7b8322f6285 Use correct buffer for local-module vars in erc-open
7b13422298a ; Avoid plist-get as generalized var in erc-compat
09e9d7c7496 Fix display of warnings on w32 console
bd094207c76 Fix buffer-list-update-hook for indirect buffers
9e7a5d58eea ; Fix tree-sitter indent anchor preset
7c61a304104 Fix treesit-node-first-child-for-pos (bug#60127)
b36cc7e7bbb ; * src/treesit.c (Ftreesit_induce_sparse_tree): Minor ch...
# Conflicts:
# etc/NEWS
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/maintaining.texi | 9 | ||||
| -rw-r--r-- | doc/emacs/modes.texi | 13 | ||||
| -rw-r--r-- | doc/lispref/minibuf.texi | 2 | ||||
| -rw-r--r-- | doc/lispref/strings.texi | 4 | ||||
| -rw-r--r-- | doc/misc/eshell.texi | 136 |
5 files changed, 120 insertions, 44 deletions
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 8c77ded55d3..5191bb2918d 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi | |||
| @@ -1331,11 +1331,18 @@ point is on a directory entry, mark all files in that directory tree | |||
| 1331 | listed files and directories. | 1331 | listed files and directories. |
| 1332 | 1332 | ||
| 1333 | @findex vc-dir-mark-by-regexp | 1333 | @findex vc-dir-mark-by-regexp |
| 1334 | @item % | 1334 | @item % m |
| 1335 | @itemx * % | ||
| 1335 | You can use this command to mark files by regexp | 1336 | You can use this command to mark files by regexp |
| 1336 | (@code{vc-dir-mark-by-regexp}). If given a prefix, unmark files | 1337 | (@code{vc-dir-mark-by-regexp}). If given a prefix, unmark files |
| 1337 | instead. | 1338 | instead. |
| 1338 | 1339 | ||
| 1340 | @findex vc-dir-mark-registered-files | ||
| 1341 | @item * r | ||
| 1342 | You can use this command to mark files that are in one of registered | ||
| 1343 | states, including edited, added or removed. | ||
| 1344 | (@code{vc-dir-mark-registered-files}). | ||
| 1345 | |||
| 1339 | @item G | 1346 | @item G |
| 1340 | Add the file under point to the list of files that the VC should | 1347 | Add the file under point to the list of files that the VC should |
| 1341 | ignore (@code{vc-dir-ignore}). For instance, if the VC is Git, it | 1348 | ignore (@code{vc-dir-ignore}). For instance, if the VC is Git, it |
diff --git a/doc/emacs/modes.texi b/doc/emacs/modes.texi index d0eacce0842..06f9929092c 100644 --- a/doc/emacs/modes.texi +++ b/doc/emacs/modes.texi | |||
| @@ -430,10 +430,15 @@ For example, one element normally found in the list has the form | |||
| 430 | mode for files whose names end in @file{.c}. (Note that @samp{\\} is | 430 | mode for files whose names end in @file{.c}. (Note that @samp{\\} is |
| 431 | needed in Lisp syntax to include a @samp{\} in the string, which must | 431 | needed in Lisp syntax to include a @samp{\} in the string, which must |
| 432 | be used to suppress the special meaning of @samp{.} in regexps.) If | 432 | be used to suppress the special meaning of @samp{.} in regexps.) If |
| 433 | the element has the form @code{(@var{regexp} @var{mode-function} | 433 | the element has the form @w{@code{(@var{regexp} @var{mode-function} |
| 434 | @var{flag})} and @var{flag} is non-@code{nil}, then after calling | 434 | @var{flag})}} and @var{flag} is non-@code{nil}, then after calling |
| 435 | @var{mode-function}, Emacs discards the suffix that matched | 435 | @var{mode-function} (if it is non-@code{nil}), Emacs discards the |
| 436 | @var{regexp} and searches the list again for another match. | 436 | suffix that matched @var{regexp} and searches the list again for |
| 437 | another match. This ``recursive extension stripping'' is used for | ||
| 438 | files which have multiple extensions, and the ``outer'' extension | ||
| 439 | hides the ``inner'' one that actually specifies the right mode. For | ||
| 440 | example, backup files and GPG-encrypted files with @file{.gpg} | ||
| 441 | extension use this feature. | ||
| 437 | 442 | ||
| 438 | @vindex auto-mode-case-fold | 443 | @vindex auto-mode-case-fold |
| 439 | On GNU/Linux and other systems with case-sensitive file names, Emacs | 444 | On GNU/Linux and other systems with case-sensitive file names, Emacs |
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index 18125c372ce..114e5d38a80 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi | |||
| @@ -312,7 +312,7 @@ to @code{regexp-history}. | |||
| 312 | 312 | ||
| 313 | @cindex @code{case-fold}, text property | 313 | @cindex @code{case-fold}, text property |
| 314 | @findex read-regexp-case-fold-search | 314 | @findex read-regexp-case-fold-search |
| 315 | The user can use the @kbd{M-c} command to indicate whether case | 315 | The user can use the @kbd{M-s c} command to indicate whether case |
| 316 | folding should be on or off. If the user has used this command, the | 316 | folding should be on or off. If the user has used this command, the |
| 317 | returned string will have the text property @code{case-fold} set to | 317 | returned string will have the text property @code{case-fold} set to |
| 318 | either @code{fold} or @code{inhibit-fold}. It is up to the caller of | 318 | either @code{fold} or @code{inhibit-fold}. It is up to the caller of |
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index ca18f0a9cc1..3d86a87516b 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi | |||
| @@ -911,8 +911,8 @@ This function returns a new string containing one character, | |||
| 911 | @end defun | 911 | @end defun |
| 912 | 912 | ||
| 913 | @defun string-to-char string | 913 | @defun string-to-char string |
| 914 | This function returns the first character in @var{string}. This | 914 | This function returns the first character in @var{string}. This is |
| 915 | mostly identical to @code{(aref string 0)}, except that it returns 0 | 915 | mostly identical to @w{@code{(aref string 0)}}, except that it returns 0 |
| 916 | if the string is empty. (The value is also 0 when the first character | 916 | if the string is empty. (The value is also 0 when the first character |
| 917 | of @var{string} is the null character, @acronym{ASCII} code 0.) This | 917 | of @var{string} is the null character, @acronym{ASCII} code 0.) This |
| 918 | function may be eliminated in the future if it does not seem useful | 918 | function may be eliminated in the future if it does not seem useful |
diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index c40ff58f42c..57a2020fdca 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi | |||
| @@ -64,10 +64,11 @@ modify this GNU manual.'' | |||
| 64 | 64 | ||
| 65 | Eshell is a shell-like command interpreter implemented in Emacs Lisp. | 65 | Eshell is a shell-like command interpreter implemented in Emacs Lisp. |
| 66 | It invokes no external processes except for those requested by the | 66 | It invokes no external processes except for those requested by the |
| 67 | user. It is intended to be an alternative to the IELM (@pxref{Lisp Interaction, Emacs Lisp Interaction, , emacs, The Emacs Editor}) | 67 | user. It is intended to be an alternative to the IELM (@pxref{Lisp |
| 68 | REPL for Emacs @emph{and} with an interface similar to command shells | 68 | Interaction, Emacs Lisp Interaction, , emacs, The Emacs Editor}) |
| 69 | such as @command{bash}, @command{zsh}, @command{rc}, or | 69 | REPL@footnote{Short for ``Read-Eval-Print Loop''.} for Emacs |
| 70 | @command{4dos}. | 70 | @emph{and} with an interface similar to command shells such as |
| 71 | @command{bash}, @command{zsh}, @command{rc}, or @command{4dos}. | ||
| 71 | @c This manual is updated to release 2.4 of Eshell. | 72 | @c This manual is updated to release 2.4 of Eshell. |
| 72 | 73 | ||
| 73 | @insertcopying | 74 | @insertcopying |
| @@ -193,6 +194,13 @@ In a command shell, everything is done by invoking commands. This | |||
| 193 | chapter covers command invocations in Eshell, including the command | 194 | chapter covers command invocations in Eshell, including the command |
| 194 | history and invoking commands in a script file. | 195 | history and invoking commands in a script file. |
| 195 | 196 | ||
| 197 | Unlike regular system shells, Eshell never invokes kernel functions | ||
| 198 | directly, such as @code{exec(3)}. Instead, it uses the Lisp functions | ||
| 199 | available in the Emacs Lisp library. It does this by transforming the | ||
| 200 | input line into a callable Lisp form.@footnote{To see the Lisp form | ||
| 201 | that will be invoked, type this as the Eshell prompt: | ||
| 202 | @kbd{eshell-parse-command 'echo hello'}} | ||
| 203 | |||
| 196 | @menu | 204 | @menu |
| 197 | * Invocation:: | 205 | * Invocation:: |
| 198 | * Arguments:: | 206 | * Arguments:: |
| @@ -207,23 +215,16 @@ history and invoking commands in a script file. | |||
| 207 | 215 | ||
| 208 | @node Invocation | 216 | @node Invocation |
| 209 | @section Invocation | 217 | @section Invocation |
| 210 | Unlike regular system shells, Eshell never invokes kernel functions | 218 | Eshell is both a command shell and an Emacs Lisp @acronym{REPL}. As a |
| 211 | directly, such as @code{exec(3)}. Instead, it uses the Lisp functions | 219 | result, you can invoke commands in two different ways: in @dfn{command |
| 212 | available in the Emacs Lisp library. It does this by transforming the | 220 | form} or in @dfn{lisp form}. |
| 213 | input line into a callable Lisp form.@footnote{To see the Lisp form that will be invoked, type: @samp{eshell-parse-command "echo hello"}} | ||
| 214 | 221 | ||
| 215 | The command can be either an Elisp function or an external command. | 222 | You can use the semicolon (@code{;}) to separate multiple command |
| 216 | Eshell looks first for an alias (@pxref{Aliases}) with the same name as the | 223 | invocations on a single line, executing each in turn. You can also |
| 217 | command, then a built-in (@pxref{Built-ins}) or a function with the | 224 | separate commands with @code{&&} or @code{||}. When using @code{&&}, |
| 218 | same name; if there is no match, it then tries to execute it as an | 225 | Eshell will execute the second command only if the first succeeds |
| 219 | external command. | 226 | (i.e.@: has an exit status of 0); with @code{||}, Eshell will execute |
| 220 | 227 | the second command only if the first fails. | |
| 221 | The semicolon (@code{;}) can be used to separate multiple command | ||
| 222 | invocations on a single line. You can also separate commands with | ||
| 223 | @code{&&} or @code{||}. When using @code{&&}, Eshell will execute the | ||
| 224 | second command only if the first succeeds (i.e.@: has an exit | ||
| 225 | status of 0); with @code{||}, Eshell will execute the second command | ||
| 226 | only if the first fails. | ||
| 227 | 228 | ||
| 228 | A command invocation followed by an ampersand (@code{&}) will be run | 229 | 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 | in the background. Eshell has no job control, so you can not suspend |
| @@ -232,12 +233,80 @@ the foreground. That said, background processes invoked from Eshell | |||
| 232 | can be controlled the same way as any other background process in | 233 | can be controlled the same way as any other background process in |
| 233 | Emacs. | 234 | Emacs. |
| 234 | 235 | ||
| 236 | @subsection Command form | ||
| 237 | Command form looks much the same as in other shells. A command | ||
| 238 | consists of arguments separated by spaces; the first argument is the | ||
| 239 | command to run, with any subsequent arguments being passed to that | ||
| 240 | command. | ||
| 241 | |||
| 242 | @example | ||
| 243 | ~ $ echo hello | ||
| 244 | hello | ||
| 245 | @end example | ||
| 246 | |||
| 247 | @cindex order of looking for commands | ||
| 248 | @cindex command lookup order | ||
| 249 | The command can be either an Elisp function or an external command. | ||
| 250 | Eshell looks for the command in the following order: | ||
| 251 | |||
| 252 | @enumerate | ||
| 253 | @item | ||
| 254 | As a command alias (@pxref{Aliases}) | ||
| 255 | |||
| 256 | @item | ||
| 257 | As a built-in command (@pxref{Built-ins}) | ||
| 258 | |||
| 259 | @item | ||
| 260 | As an external program | ||
| 261 | |||
| 262 | @item | ||
| 263 | As an ordinary Lisp function | ||
| 264 | @end enumerate | ||
| 265 | |||
| 266 | @vindex eshell-prefer-lisp-functions | ||
| 267 | If you would prefer to use ordinary Lisp functions over external | ||
| 268 | programs, set the option @code{eshell-prefer-lisp-functions} to | ||
| 269 | @code{t}. This will swap the lookup order of the last two items. | ||
| 270 | |||
| 271 | You can also group command forms together into a subcommand with curly | ||
| 272 | braces (@code{@{@}}). This lets you use the output of a subcommand as | ||
| 273 | an argument to another command, or within control flow statements | ||
| 274 | (@pxref{Control Flow}). | ||
| 275 | |||
| 276 | @example | ||
| 277 | ~ $ echo @{echo hello; echo there@} | ||
| 278 | hellothere | ||
| 279 | @end example | ||
| 280 | |||
| 281 | @subsection Lisp form | ||
| 282 | Lisp form looks like ordinary Emacs Lisp code, because that's what it | ||
| 283 | is. As a result, you can use any syntax normally available to an | ||
| 284 | Emacs Lisp program (@pxref{Top, , , elisp, The Emacs Lisp Reference | ||
| 285 | Manual}). | ||
| 286 | |||
| 287 | @example | ||
| 288 | ~ $ (format "hello, %s" user-login-name) | ||
| 289 | hello, user | ||
| 290 | @end example | ||
| 291 | |||
| 292 | In addition, you can @emph{combine} command forms and Lisp forms | ||
| 293 | together into single statements, letting you use whatever form is the | ||
| 294 | most convenient for expressing your intentions. | ||
| 295 | |||
| 296 | @example | ||
| 297 | ~ $ ls *.patch > (format-time-string "%F.log") | ||
| 298 | @end example | ||
| 299 | |||
| 300 | This command writes a list of all files matching the glob pattern | ||
| 301 | @code{*.patch} (@pxref{Globbing}) to a file named | ||
| 302 | @code{@var{current-date}.log} (@pxref{Redirection}). | ||
| 303 | |||
| 235 | @node Arguments | 304 | @node Arguments |
| 236 | @section Arguments | 305 | @section Arguments |
| 237 | Ordinarily, command arguments are parsed by Eshell as either strings | 306 | Ordinarily, Eshell parses arguments in command form as either strings |
| 238 | or numbers, depending on what the parser thinks they look like. To | 307 | or numbers, depending on what the parser thinks they look like. To |
| 239 | specify an argument of some other data type, you can use an | 308 | specify an argument of some other data type, you can use a Lisp form |
| 240 | @ref{Dollars Expansion, Elisp expression}: | 309 | (@pxref{Invocation}): |
| 241 | 310 | ||
| 242 | @example | 311 | @example |
| 243 | ~ $ echo (list 1 2 3) | 312 | ~ $ echo (list 1 2 3) |
| @@ -354,10 +423,6 @@ eshell/sudo is a compiled Lisp function in `em-tramp.el'. | |||
| 354 | sudo is an alias, defined as "*sudo $@@*" | 423 | sudo is an alias, defined as "*sudo $@@*" |
| 355 | @end example | 424 | @end example |
| 356 | 425 | ||
| 357 | @vindex eshell-prefer-lisp-functions | ||
| 358 | If you would prefer to use the built-in commands instead of the external | ||
| 359 | commands, set @code{eshell-prefer-lisp-functions} to @code{t}. | ||
| 360 | |||
| 361 | Some of the built-in commands have different behavior from their | 426 | Some of the built-in commands have different behavior from their |
| 362 | external counterparts, and some have no external counterpart. Most of | 427 | external counterparts, and some have no external counterpart. Most of |
| 363 | these will print a usage message when given the @code{--help} option. | 428 | these will print a usage message when given the @code{--help} option. |
| @@ -923,15 +988,14 @@ For example, you could handle a subset of the options for the | |||
| 923 | @node Variables | 988 | @node Variables |
| 924 | @section Variables | 989 | @section Variables |
| 925 | @vindex eshell-prefer-lisp-variables | 990 | @vindex eshell-prefer-lisp-variables |
| 926 | Since Eshell is a combination of an Emacs @acronym{REPL}@footnote{ | 991 | Since Eshell is a combination of an Emacs @acronym{REPL} and a command |
| 927 | Short for ``Read-Eval-Print Loop''. | 992 | shell, it can refer to variables from two different sources: ordinary |
| 928 | } and a command shell, it can refer to variables from two different | 993 | Emacs Lisp variables, as well as environment variables. By default, |
| 929 | sources: ordinary Emacs Lisp variables, as well as environment | 994 | when using a variable in Eshell, it will first look in the list of |
| 930 | variables. By default, when using a variable in Eshell, it will first | 995 | built-in variables, then in the list of environment variables, and |
| 931 | look in the list of built-in variables, then in the list of | 996 | finally in the list of Lisp variables. If you would prefer to use |
| 932 | environment variables, and finally in the list of Lisp variables. If | 997 | Lisp variables over environment variables, you can set |
| 933 | you would prefer to use Lisp variables over environment variables, you | 998 | @code{eshell-prefer-lisp-variables} to @code{t}. |
| 934 | can set @code{eshell-prefer-lisp-variables} to @code{t}. | ||
| 935 | 999 | ||
| 936 | You can set variables in a few different ways. To set a Lisp | 1000 | You can set variables in a few different ways. To set a Lisp |
| 937 | variable, you can use the command @samp{setq @var{name} @var{value}}, | 1001 | variable, you can use the command @samp{setq @var{name} @var{value}}, |