commit 118582efb3003e72e99e1e096d0323d6f9e23108 (HEAD, refs/remotes/origin/master) Author: Jim Porter Date: Fri Jul 7 18:19:08 2023 -0700 ; * doc/misc/eshell.texi: Fix typos and clean up unclear wording. diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index 185f7638a85..5972d2834b0 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi @@ -65,10 +65,10 @@ Top Eshell is a shell-like command interpreter implemented in Emacs Lisp. It invokes no external processes except for those requested by the user. It is intended to be an alternative to the IELM (@pxref{Lisp -Interaction, Emacs Lisp Interaction, , emacs, The Emacs Editor}) -REPL@footnote{Short for ``Read-Eval-Print Loop''.} for Emacs -@emph{and} with an interface similar to command shells such as -@command{bash}, @command{zsh}, @command{rc}, or @command{4dos}. +Interaction, , , emacs, The Emacs Editor}) REPL@footnote{Short for +``Read-Eval-Print Loop''.} for Emacs @emph{and} with an interface +similar to command shells such as @command{bash}, @command{zsh}, +@command{rc}, or @command{4dos}. @c This manual is updated to release 2.4 of Eshell. @insertcopying @@ -217,7 +217,7 @@ Invocation @section Invocation Eshell is both a command shell and an Emacs Lisp @acronym{REPL}. As a result, you can invoke commands in two different ways: in @dfn{command -form} or in @dfn{lisp form}. +form} or in @dfn{Lisp form}. You can use the semicolon (@code{;}) to separate multiple command invocations on a single line, executing each in turn. You can also @@ -313,9 +313,9 @@ Arguments (1 2 3) @end example -Additionally, many built-in Eshell commands (@pxref{Built-ins, Eshell -commands}) will flatten the arguments they receive, so passing a list -as an argument will ``spread'' the elements into multiple arguments: +Additionally, many built-in Eshell commands (@pxref{Built-ins}) will +flatten the arguments they receive, so passing a list as an argument +will ``spread'' the elements into multiple arguments: @example ~ $ printnl (list 1 2) 3 @@ -393,17 +393,20 @@ Arguments @item # Return the process named @var{name}. This is equivalent to -@samp{$(get-process "@var{name}")} (@pxref{Process Information, , , +@samp{$(get-process "@var{name}")} (@pxref{Process Information, , , elisp, The Emacs Lisp Reference Manual}). @end table @node Built-ins @section Built-in commands -Several commands are built-in in Eshell. In order to call the -external variant of a built-in command @code{foo}, you could call -@code{*foo}. Usually, this should not be necessary. You can check -what will be applied by the @code{which} command: +Eshell provides a number of built-in commands, many of them +implementing common command-line utilities, but enhanced for Eshell. +(These built-in commands are just ordinary Lisp functions whose names +begin with @code{eshell/}.) In order to call the external variant of +a built-in command @code{foo}, you could call @code{*foo}. Usually, +this should not be necessary. You can check what will be applied by +the @code{which} command: @example ~ $ which ls @@ -1027,7 +1030,9 @@ Variables @item $INSIDE_EMACS This variable indicates to external commands that they are being invoked from within Emacs so they can adjust their behavior if -necessary. Its value is @code{@var{emacs-version},eshell}. +necessary. By default, its value is +@code{@var{emacs-version},eshell}. Other parts of Emacs, such as +Tramp, may add extra information to this value. @end table @@ -1132,11 +1137,11 @@ Completion for the built-in functions and some common external commands, and you can define your own for any command. -Eshell completion also works for lisp forms and glob patterns. If the point is -on a lisp form, then @key{TAB} will behave similarly to completion in -@code{elisp-mode} and @code{lisp-interaction-mode}. For glob patterns, the -pattern will be removed from the input line, and replaced by the -completion. +Eshell completion also works for Lisp forms and glob patterns. If the +point is on a Lisp form, then @key{TAB} will behave similarly to +completion in @code{elisp-mode} and @code{lisp-interaction-mode}. For +glob patterns, the pattern will be removed from the input line, and +replaced by the completion. If you want to see the entire list of possible completions (e.g. when it's below the @code{completion-cycle-threshold}), press @kbd{M-?}. @@ -1155,7 +1160,7 @@ Completion @node Control Flow @section Control Flow -Because Eshell commands can not (easily) be combined with lisp forms, +Because Eshell commands can not (easily) be combined with Lisp forms, Eshell provides command-oriented control flow statements for convenience. @@ -1307,9 +1312,9 @@ Dollars Expansion @item a sequence Expands to the element at the (zero-based) index @var{i} of the -sequence (@pxref{Sequences Arrays Vectors, Sequences, , elisp, The -Emacs Lisp Reference Manual}). If @var{i} is negative, @var{i} counts -from the end, so -1 refers to the last element of the sequence. +sequence (@pxref{Sequences Arrays Vectors, , , elisp, The Emacs Lisp +Reference Manual}). If @var{i} is negative, @var{i} counts from the +end, so -1 refers to the last element of the sequence. If @var{i} is a range like @code{@var{start}..@var{end}}, this expands to a subsequence from the indices @var{start} to @var{end}, where @@ -1397,8 +1402,8 @@ Globbing 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 -``eshell-glob'' (@pxref{Easy Customization, , , emacs, The GNU Emacs -Manual}). +@code{eshell-glob} (@pxref{Easy Customization, , , emacs, The GNU +Emacs Manual}). @table @samp @@ -1496,7 +1501,7 @@ Argument Predication and Modification @code{[@dots{}]}, @code{<@dots{}>}, or @code{@{@dots{}@}}. You can customize the syntax and behavior of predicates and modifiers -in Eshell via the Customize group ``eshell-pred'' (@pxref{Easy +in Eshell via the Customize group @code{eshell-pred} (@pxref{Easy Customization, , , emacs, The GNU Emacs Manual}). @menu @@ -1792,26 +1797,26 @@ Redirection Redirect output to @var{dest}, appending it to the existing contents of @var{dest}. -@item >>> @var{buffer} -@itemx @var{fd}>>> @var{buffer} +@item >>> @var{dest} +@itemx @var{fd}>>> @var{dest} Redirect output to @var{dest}, inserting it at the current mark if @var{dest} is a buffer, at the beginning of the file if @var{dest} is a file, or otherwise behaving the same as @code{>>}. -@item &> @var{file} -@itemx >& @var{file} +@item &> @var{dest} +@itemx >& @var{dest} Redirect both standard output and standard error to @var{dest}, overwriting its contents with the new output. -@item &>> @var{file} -@itemx >>& @var{file} +@item &>> @var{dest} +@itemx >>& @var{dest} Redirect both standard output and standard error to @var{dest}, appending it to the existing contents of @var{dest}. -@item &>>> @var{file} -@itemx >>>& @var{file} +@item &>>> @var{dest} +@itemx >>>& @var{dest} Redirect both standard output and standard error to @var{dest}, -inserting it like with @code{>>> @var{file}}. +inserting it like with @code{>>> @var{dest}}. @item >&@var{other-fd} @itemx @var{fd}>&@var{other-fd} @@ -2430,10 +2435,6 @@ Bugs and ideas @item Support zsh's ``Parameter Expansion'' syntax, i.e., @samp{$@{@var{name}:-@var{val}@}} -@item Write an @command{info} alias that can take arguments - -So that the user can enter @samp{info chmod}, for example. - @item Create a mode @code{eshell-browse} It would treat the Eshell buffer as an outline. Collapsing the outline commit f7a899d7ca073991d4d43acb219d4c16b158e42b Author: Jim Porter Date: Fri Jul 7 17:30:26 2023 -0700 Document some missing Eshell commands * doc/misc/eshell.texi (Built-ins): Document 'eshell-debug'. (Extra built-in commands): Document 'count', 'ff', and 'gf'. diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index 0e2f5e02973..185f7638a85 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi @@ -575,6 +575,14 @@ Built-ins command does not yet support running commands with a modified environment. +@item eshell-debug +@cmindex eshell-debug +Toggle debugging information for Eshell itself. You can pass this +command the argument @code{errors} to enable/disable Eshell trapping +errors when evaluating commands, or the argument @code{commands} to +show/hide command execution progress in the buffer @code{*eshell last +cmd*}. + @item exit @cmindex exit Exit Eshell and save the history. By default, this command kills the @@ -2118,11 +2126,27 @@ Extra built-in commands @table @code +@item count +@cmindex count +A wrapper around the function @code{cl-count} (@pxref{Searching +Sequences,,, cl, GNU Emacs Common Lisp Emulation}). This command can +be used for comparing lists of strings. + @item expr @cmindex expr An implementation of @command{expr} using the Calc package. @xref{Top,,, calc, The GNU Emacs Calculator}. +@item ff +@cmindex ff +Shorthand for the the function @code{find-name-dired} (@pxref{Dired +and Find, , , elisp, The Emacs Lisp Reference Manual}). + +@item gf +@cmindex gf +Shorthand for the the function @code{find-grep-dired} (@pxref{Dired +and Find, , , elisp, The Emacs Lisp Reference Manual}). + @item intersection @cmindex intersection A wrapper around the function @code{cl-intersection} (@pxref{Lists as commit 37101780243d083e8773c255242aa26614f22a14 Author: Stefan Monnier Date: Fri Jul 7 12:09:50 2023 -0400 * lisp/emacs-lisp/bytecomp.el (byte-compile-eval): Fix bug#64232 diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 262c658e258..489a9724fc4 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1128,7 +1128,8 @@ byte-compile-eval ;; we arguably should add it to b-c-noruntime-functions, ;; but it's not clear it's worth the trouble ;; trying to recognize that case. - (unless (get f 'function-history) + (unless (or (get f 'function-history) + (assq f byte-compile-function-environment)) (push f byte-compile-noruntime-functions))))))))))))) (defun byte-compile-eval-before-compile (form) commit 51807e12dacbc1abc238ebafb4ba20e27f4bcc81 Author: Juri Linkov Date: Fri Jul 7 10:18:43 2023 +0300 * lisp/tab-bar.el: Fix tab-bar-tab-name-current for active minibuffer. (tab-bar-tab-name-current): Use get-mru-window in the active minibuffer when minibuffer-selected-window is nil after switching to another tab. (tab-bar-tab-name-current-with-count) (tab-bar-tab-name-truncated): Use tab-bar-tab-name-current. diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index f47c4a7bb6c..14b340f6183 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -618,13 +618,18 @@ tab-bar-tab-name-function (defun tab-bar-tab-name-current () "Generate tab name from the buffer of the selected window." - (buffer-name (window-buffer (minibuffer-selected-window)))) + ;; `minibuffer-selected-window' loses its original window + ;; after switching to another tab while the minibuffer was active, + ;; so get the most recently used non-minibuffer window. + (buffer-name (window-buffer (or (minibuffer-selected-window) + (and (window-minibuffer-p) + (get-mru-window)))))) (defun tab-bar-tab-name-current-with-count () "Generate tab name from the buffer of the selected window. Also add the number of windows in the window configuration." (let ((count (length (window-list-1 nil 'nomini))) - (name (window-buffer (minibuffer-selected-window)))) + (name (tab-bar-tab-name-current))) (if (> count 1) (format "%s (%d)" name count) (format "%s" name)))) @@ -651,7 +656,7 @@ tab-bar-tab-name-truncated "Generate tab name from the buffer of the selected window. Truncate it to the length specified by `tab-bar-tab-name-truncated-max'. Append ellipsis `tab-bar-tab-name-ellipsis' in this case." - (let ((tab-name (buffer-name (window-buffer (minibuffer-selected-window))))) + (let ((tab-name (tab-bar-tab-name-current))) (if (< (length tab-name) tab-bar-tab-name-truncated-max) tab-name (propertize (truncate-string-to-width