From: Jim Porter Date: Tue, 22 Aug 2023 01:23:11 +0000 (-0700) Subject: Merge from origin/emacs-29 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=357c2fba9825a44e27bf83ecd7a3527a32268a47;p=emacs.git Merge from origin/emacs-29 3296031ad74 ; Another improvement for documentation of pixelwise scro... baeb2d71ae7 Support defun navigation for DEFUN in c-ts-mode (bug#64442) 781ddd7e7d8 Fix touchpad scrolling on MS-Windows c125bd060e2 Fix order in which package-vc dependencies are resolved 500ced133ad Fix building of VC package manuals with relative org link... 456ecabe9e8 Fix the documentation of 'cl-flet' f6ebd1ef0d0 ; * src/treesit.c (Ftreesit_node_parent): Improve comment... fac0e2d5334 Avoid false "wrong passphrase" messages in EPA 8f683b51d8b Fix jsx font-lock in older tree-sitter-js grammars d9af79ae39d Fix cloning 'face-remapping-alist' for indirect buffers 636fb267c46 Improve documentation of case transfer in replacement com... 7856d51436b Fix horizontal scrolling of images with C-f 8cf5659ec2f ; Fix defcustom in completion.el a8c8a4e3680 ; * src/fns.c (Fcopy_sequence): Doc fix. (Bug#64960) 205d87cdca0 Fix unpacking ZIP archives on MS-Windows 3712e8bc385 ; Fix typos in lisp/keymap.el doc strings (bug#65329). 21b2ecee661 Fix command example in Eshell manual 26949819df0 ; lisp/progmodes/csharp-mode.el (treesit-query-capture): ... 221ed70b90a ; Improve documentation of 'define-alternatives' 32280205e27 Add user options mentioned in the Eshell manual to the va... cf3145a486b * Add missing alias to `native-comp-enable-subr-trampolin... 922b6490286 * Add missing alias to `native-comp-enable-subr-trampolin... 6962823c83c ; * etc/PROBLEMS: Fix typo and clarify wording. # Conflicts: # doc/misc/eshell.texi --- 357c2fba9825a44e27bf83ecd7a3527a32268a47 diff --cc doc/misc/eshell.texi index 59c07457158,c9d84cf2851..29ffc3dc964 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi @@@ -572,9 -550,10 +577,10 @@@ Compare files using Emacs's internal @c with @code{ediff}). @xref{Comparing Files, , , emacs, The GNU Emacs Manual}. + @vindex eshell-plain-diff-behavior If @code{eshell-plain-diff-behavior} is non-@code{nil}, then this command does not use Emacs's internal @code{diff}. This is the same -as using @samp{alias diff '*diff $*'}. +as using @samp{alias diff '*diff $@@*'}. @item dirname @cmindex dirname @@@ -644,11 -623,12 +652,12 @@@ The @command{grep} commands are compati but use Emacs's internal @code{grep} instead. @xref{Grep Searching, , , emacs, The GNU Emacs Manual}. + @vindex eshell-plain-grep-behavior If @code{eshell-plain-grep-behavior} is non-@code{nil}, then these commands do not use Emacs's internal @code{grep}. This is the same as -using @samp{alias grep '*grep $*'}, though this setting applies to all -of the built-in commands for which you would need to create a separate -alias. +using @samp{alias grep '*grep $@@*'}, though this setting applies to +all of the built-in commands for which you would need to create a +separate alias. @item history @cmindex history @@@ -693,9 -675,10 +704,10 @@@ Alias to Emacs's @code{locate} function @command{locate} command and parses the results. @xref{Dired and Find, , , emacs, The GNU Emacs Manual}. + @vindex eshell-plain-locate-behavior If @code{eshell-plain-locate-behavior} is non-@code{nil}, then Emacs's internal @code{locate} is not used. This is the same as using -@samp{alias locate '*locate $*'}. +@samp{alias locate '*locate $@@*'}. @item ls @cmindex ls @@@ -1080,42 -1057,22 +1102,43 @@@ Tramp, may add extra information to thi @node Aliases @section Aliases -@vindex $* +@findex eshell-read-aliases-list + @vindex eshell-aliases-file Aliases are commands that expand to a longer input line. For example, -@command{ll} is a common alias for @code{ls -l}, and would be defined -with the command invocation @kbd{alias ll 'ls -l $*'}; with this defined, -running @samp{ll foo} in Eshell will actually run @samp{ls -l foo}. -Aliases defined (or deleted) by the @command{alias} command are -automatically written to the file named by @code{eshell-aliases-file}, -which you can also edit directly (although you will have to manually -reload it). - -@vindex $1, $2, @dots{} +@command{ll} is a common alias for @code{ls -l}. To define this alias +in Eshell, you can use the command invocation @kbd{alias ll 'ls -l +$@@*'}; with this defined, running @samp{ll foo} in Eshell will +actually run @samp{ls -l foo}. Aliases defined (or deleted) by the +@command{alias} command are automatically written to the file named by +@code{eshell-aliases-file}, which you can also edit directly. After +doing so, use @w{@kbd{M-x eshell-read-aliases-list}} to load the +edited aliases. + Note that unlike aliases in Bash, arguments must be handled -explicitly. Typically the alias definition would end in @samp{$*} to -pass all arguments along. More selective use of arguments via -@samp{$1}, @samp{$2}, etc., is also possible. For example, +explicitly. Within aliases, you can use the special variables +@samp{$*}, @samp{$0}, @samp{$1}, @samp{$2}, etc. to refer to the +arguments passed to the alias. + +@table @code + +@vindex $* +@item $* +This expands to the list of arguments passed to the alias. For +example, if you run @code{my-alias 1 2 3}, then @samp{$*} would be the +list @code{(1 2 3)}. Note that since this variable is a list, using +@samp{$*} in an alias will pass this list as a single argument to the +aliased command. Therefore, when defining an alias, you should +usually use @samp{$@@*} to pass all arguments along, splicing them +into your argument list (@pxref{Dollars Expansion}). + +@vindex $0 +@item $0 +This expands to the name of the alias currently being executed. + +@vindex $1, $2, @dots{}, $9 +@item $1, $2, @dots{}, $9 +These variables expand to the nth argument (starting at 1) passed to +the alias. This lets you selectively use an alias's arguments, so @kbd{alias mcd 'mkdir $1 && cd $1'} would cause @kbd{mcd foo} to create and switch to a directory called @samp{foo}. @@@ -1472,23 -1381,13 +1498,24 @@@ Eshell's globbing syntax is very simila coming from Bash can still use Bash-style globbing, as there are no incompatibilities. + @vindex eshell-glob-case-insensitive -By default, globs are case sensitive, except on MS-DOS/MS-Windows +@vindex eshell-glob-case-insensitive +Globs are case sensitive by default, except on MS-DOS/MS-Windows systems. You can control this behavior via the -@code{eshell-glob-case-insensitive} option. You can further customize -the syntax and behavior of globbing in Eshell via the Customize group -@code{eshell-glob} (@pxref{Easy Customization, , , emacs, The GNU -Emacs Manual}). +@code{eshell-glob-case-insensitive} option. + +@vindex eshell-glob-splice-results +By default, Eshell expands the results of a glob as a sublist into the +list of arguments. You can change this to splice the results in-place +by setting @code{eshell-glob-splice-results} to a non-@code{nil} +value. If you want to splice a glob in-place for just one use, you +can use a subcommand form like @samp{$@@@{listify @var{my-glob}@}}. +(Conversely, you can explicitly expand a glob as a sublist via +@samp{$@{listify @var{my-glob}@}}.) + +You can further customize the syntax and behavior of globbing in +Eshell via the Customize group @code{eshell-glob} (@pxref{Easy +Customization, , , emacs, The GNU Emacs Manual}). @table @samp @@@ -2075,11 -1978,12 +2106,12 @@@ mimic the bindings used in other shell input text. To enable this module, add @code{eshell-rebind} to @code{eshell-modules-list}. -For example, it binds @kbd{C-a} to move to the beginning of the input -text, @kbd{C-u} to kill the current input text, and @kbd{C-w} to -@code{backward-kill-word}. If the history module is enabled, it also -binds @kbd{C-p} and @kbd{C-n} to move through the input history. +For example, it binds @kbd{C-u} to kill the current input text and +@kbd{C-w} to @code{backward-kill-word}. If the history module is +enabled, it also binds @kbd{C-p} and @kbd{C-n} to move through the +input history. + @vindex eshell-confine-point-to-input If @code{eshell-confine-point-to-input} is non-@code{nil}, this module prevents certain commands from causing the point to leave the input area, such as @code{backward-word}, @code{previous-line}, etc.