commit 1b622ff66e32e09fb679b4d371c3be951bf7f000 (HEAD, refs/remotes/origin/master) Author: Andrea Corallo Date: Thu May 16 07:42:14 2024 +0200 * Fix bootstrap with checking enabled * lisp/emacs-lisp/comp.el (comp--limplify-top-level): Set function safety. diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 83ca480616f..4c76f95a0e9 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -1669,7 +1669,8 @@ into the C code forwarding the compilation unit." ;; the last function being ;; registered. :frame-size 2 - :speed (comp-ctxt-speed comp-ctxt))) + :speed (comp-ctxt-speed comp-ctxt) + :safety (comp-ctxt-safety comp-ctxt))) (comp-func func) (comp-pass (make-comp-limplify :curr-block (make--comp-block-lap -1 0 'top-level) commit 59b889885d1f18b9325bd0db3458d3537e6b5f2a Author: Jim Porter Date: Wed May 15 22:22:56 2024 -0700 ; * lisp/eshell/esh-ext.el (eshell-remote-command): Improve last change. diff --git a/lisp/eshell/esh-ext.el b/lisp/eshell/esh-ext.el index c1f2d6d14ac..df8f7198917 100644 --- a/lisp/eshell/esh-ext.el +++ b/lisp/eshell/esh-ext.el @@ -217,7 +217,7 @@ file; if COMMAND is a local file name, run it locally." ;; "cat" as the result. (command-localname (or (file-remote-p command 'localname 'never) command))) - (eshell-external-command command-localname args))) + (eshell-connection-local-command command-localname args))) (defun eshell-connection-local-command (command args) "Insert output from an external COMMAND, using ARGS. commit e260bf1be7b03c21988a2090cde31970bd6bbfc9 Author: Jim Porter Date: Fri May 10 12:22:52 2024 -0700 Use "/local:" prefix in Eshell to run local commands when cwd is remote * lisp/eshell/esh-ext.el (eshell-explicit-remote-commands) (eshell-explicit-command): Update docstrings. (eshell--local-prefix): New constant. (eshell-handle-remote-command): Remove. (eshell-quoted-file-command): New function... (eshell-ext-initialize): ... add it as a hook. (eshell-remote-command): Support running commands on localhost. (eshell-connection-local-command): Rename from 'eshell-external-command'. (eshell-external-command): New implementation calling 'eshell-remote-command' or 'eshell-connection-local-command' as appropriate. * test/lisp/eshell/esh-ext-tests.el (esh-ext-test/explicitly-local-command): Update test. * doc/misc/eshell.texi (Remote Access): Update documentation. * etc/NEWS: Update announcement. diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index 30c85da795b..8cb73d4077b 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi @@ -1535,13 +1535,18 @@ slash module (@pxref{Electric forward slash}). When running commands, you can also make them explicitly remote by prefixing the command name with a remote identifier, e.g.@: @samp{/ssh:user@@remote:whoami}. This runs the command @code{whoami} -over the SSH connection for @code{user@@remote}, no matter your -current directory. If you want to explicitly run a @emph{local} -command even when in a remote directory, you can prefix the command -name with @kbd{/:}, like @samp{/:whoami}. In either case, you can +over the SSH connection for @code{user@@remote}, no matter your current +directory. If you want to explicitly run a command on your @emph{local} +machine even when in a remote directory, you can prefix the command name +with @kbd{/local:}, like @samp{/local:whoami}. In either case, you can also specify the absolute path to the program, e.g.@: -@samp{/ssh:user@@remote:/usr/bin/whoami}. To disable this syntax, set -the option @code{eshell-explicit-remote-commands} to @code{nil}. +@samp{/ssh:user@@remote:/usr/bin/whoami}. If you need to refer to a +program whose file name would be interpreted as an explicitly-remote +command, you can use @kbd{/:} to quote the name, e.g.@: +@samp{/:/ssh:user@@remote:whoami} (@pxref{Quoted File Names,,, emacs, +The GNU Emacs Manual}). To disable explicity-remote commands entirely, +you can set the option @code{eshell-explicit-remote-commands} to +@code{nil}. @node History @section History diff --git a/etc/NEWS b/etc/NEWS index 34052764f5f..77b2749fe43 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -915,7 +915,7 @@ By prefixing a command name in Eshell with a remote identifier, like "/ssh:user@remote:whoami", you can now run commands on a particular host no matter your current directory. Likewise, you can run a command on your local system no matter your current directory via -"/:whoami". For more information, see the "(eshell) Remote Access" +"/local:whoami". For more information, see the "(eshell) Remote Access" node in the Eshell manual. +++ diff --git a/lisp/eshell/esh-ext.el b/lisp/eshell/esh-ext.el index b4fce7a82a2..c1f2d6d14ac 100644 --- a/lisp/eshell/esh-ext.el +++ b/lisp/eshell/esh-ext.el @@ -167,23 +167,23 @@ external version." (defcustom eshell-explicit-remote-commands t "If non-nil, support explicitly-remote commands. These are commands with a full remote file name, such as -\"/ssh:host:whoami\". If this is enabled, you can also run -explicitly-local commands by using a quoted file name, like -\"/:whoami\"." +\"/ssh:host:whoami\". If this is enabled, you can also explicitly run +commands on your local host by using the \"/local:\" prefix, like +\"/local:whoami\"." :type 'boolean :group 'eshell-ext) ;;; Functions: +(defconst eshell--local-prefix "/local:") + (defun eshell-ext-initialize () ;Called from `eshell-mode' via intern-soft! "Initialize the external command handling code." - (add-hook 'eshell-named-command-hook #'eshell-explicit-command nil t) - (when eshell-explicit-remote-commands - (add-hook 'eshell-named-command-hook - #'eshell-handle-remote-command nil t))) + (add-hook 'eshell-named-command-hook #'eshell-quoted-file-command nil t) + (add-hook 'eshell-named-command-hook #'eshell-explicit-command nil t)) (defun eshell-explicit-command (command args) - "If a command name begins with `*', call it externally always. + "If a command name begins with \"*\", always call it externally. This bypasses all Lisp functions and aliases." (when (and (> (length command) 1) (eq (aref command 0) eshell-explicit-command-char)) @@ -194,39 +194,35 @@ This bypasses all Lisp functions and aliases." (error "%s: external command not found" (substring command 1)))))) -(defun eshell-handle-remote-command (command args) - "Handle remote (or quoted) COMMAND names, using ARGS. -This calls the appropriate function for commands that aren't on -the connection associated with `default-directory'. (See -`eshell-explicit-remote-commands'.)" - (if (file-name-quoted-p command) - (let ((default-directory (if (file-remote-p default-directory) - (expand-file-name "~") - default-directory))) - (eshell-external-command (file-name-unquote command) args)) - (when (file-remote-p command) - (eshell-remote-command command args)))) +(defun eshell-quoted-file-command (command args) + "If a command name begins with \"/:\", always call it externally. +Similar to `eshell-explicit-command', this bypasses all Lisp functions +and aliases, but it also ignores file name handlers." + (when (file-name-quoted-p command) + (eshell-external-command (file-name-unquote command) args))) (defun eshell-remote-command (command args) "Insert output from a remote COMMAND, using ARGS. -A remote command is something that executes on a different machine. -An external command simply means external to Emacs." +A \"remote\" command in Eshell is something that executes on a different +machine. If COMMAND is a remote file name, run it on the host for that +file; if COMMAND is a local file name, run it locally." (let* ((cwd-connection (file-remote-p default-directory)) (command-connection (file-remote-p command)) (default-directory (if (equal cwd-connection command-connection) default-directory - command-connection)) + (or command-connection (expand-file-name "~")))) ;; Never use the remote connection here. We don't want to ;; expand the local name! Instead, we want it as the user ;; typed, so that if COMMAND is "/ssh:host:cat", we just get ;; "cat" as the result. - (command-localname (file-remote-p command 'localname 'never))) - (unless command-connection - (error "%s: not a remote command" command)) + (command-localname (or (file-remote-p command 'localname 'never) + command))) (eshell-external-command command-localname args))) -(defun eshell-external-command (command args) - "Insert output from an external COMMAND, using ARGS." +(defun eshell-connection-local-command (command args) + "Insert output from an external COMMAND, using ARGS. +This always runs COMMAND using the connection associated with the +current working directory." (setq args (eshell-stringify-list (flatten-tree args))) (let ((interp (eshell-find-interpreter command @@ -243,6 +239,19 @@ An external command simply means external to Emacs." (eshell-gather-process-output (car interp) (append (cdr interp) args))))) +(defun eshell-external-command (command args) + "Insert output from an external COMMAND, using ARGS." + (cond + ((and eshell-explicit-remote-commands + (file-remote-p command)) + (eshell-remote-command command args)) + ((and eshell-explicit-remote-commands + (string-prefix-p eshell--local-prefix command)) + (eshell-remote-command + (substring command (length eshell--local-prefix)) args)) + (t + (eshell-connection-local-command command args)))) + (defun eshell/addpath (&rest args) "Add a set of paths to PATH." (eshell-eval-using-options diff --git a/test/lisp/eshell/esh-ext-tests.el b/test/lisp/eshell/esh-ext-tests.el index 8abbd74f737..ce958d788cc 100644 --- a/test/lisp/eshell/esh-ext-tests.el +++ b/test/lisp/eshell/esh-ext-tests.el @@ -102,7 +102,7 @@ ;; Check the value of $INSIDE_EMACS using `sh' in order to ;; delay variable expansion. (eshell-match-command-output - (format "/:%s -c 'echo $INSIDE_EMACS'" cmd) + (format "/local:%s -c 'echo $INSIDE_EMACS'" cmd) "eshell\n")))))) ;; esh-ext-tests.el ends here commit c85294a6132e57bc0d24e39589b2c6163c11ca87 Author: Sean Whitton Date: Wed May 15 14:50:18 2024 -0400 (eglot--managed-mode): Avoid calling track-changes unregistered * lisp/progmodes/eglot.el (eglot--managed-mode): Unregister from track-changes after `eglot-shutdown` since that function may call `eglot--signal-textDocument/didChange`. (bug#70927) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 57a019e126d..0ba69f66f0d 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -2022,9 +2022,6 @@ Use `eglot-managed-p' to determine if current buffer is managed.") (eldoc-mode 1)) (cl-pushnew (current-buffer) (eglot--managed-buffers (eglot-current-server)))) (t - (when eglot--track-changes - (track-changes-unregister eglot--track-changes) - (setq eglot--track-changes nil)) (remove-hook 'kill-buffer-hook #'eglot--managed-mode-off t) (remove-hook 'kill-buffer-hook #'eglot--signal-textDocument/didClose t) (remove-hook 'before-revert-hook #'eglot--signal-textDocument/didClose t) @@ -2053,7 +2050,10 @@ Use `eglot-managed-p' to determine if current buffer is managed.") (delq (current-buffer) (eglot--managed-buffers server))) (when (and eglot-autoshutdown (null (eglot--managed-buffers server))) - (eglot-shutdown server))))))) + (eglot-shutdown server)))) + (when eglot--track-changes + (track-changes-unregister eglot--track-changes) + (setq eglot--track-changes nil))))) (defun eglot--managed-mode-off () "Turn off `eglot--managed-mode' unconditionally." commit 5900cf92ea27f56bd0e35b818332d9d415f4d6fc Author: Sean Whitton Date: Wed May 15 19:04:03 2024 +0100 vc-git-root-log-format: Explicitly match periods * lisp/vc/vc-git.el (vc-git-root-log-format): Explicity match periods, rather than matching them only because '.' matches any chars. diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index b23a5ca95a1..0541b16d625 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -187,7 +187,7 @@ the staging area." ;; The first shy group matches the characters drawn by --graph. ;; We use numbered groups because `log-view-message-re' wants the ;; revision number to be group 1. - "^\\(?:[*/\\| ]+ \\)?\\(?2: ([^)]+)\\)?\\(?1:[0-9a-z]+\\)..: \ + "^\\(?:[*/\\| ]+ \\)?\\(?2: ([^)]+)\\)?\\(?1:[0-9a-z]+\\)\\.\\.: \ \\(?3:.*?\\)[ \t]+\\(?4:[0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\)" ((1 'log-view-message) (2 'change-log-list nil lax) commit fea8d54c48094c528527e91c1598f9d115967812 Author: Stefan Monnier Date: Wed May 15 13:57:11 2024 -0400 control.texi: Be a bit more explicit about the behavior of `pcase-let` * doc/lispref/control.texi (Destructuring with pcase Patterns): Clarify the kind of "unspecified" behavior that can occur when the destructing pattern does not match the value. diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi index 8b74b7cec5b..58063ecf8db 100644 --- a/doc/lispref/control.texi +++ b/doc/lispref/control.texi @@ -1318,11 +1318,18 @@ example: does the same as the previous example, except that it directly tries to extract @code{x} and @code{y} from @code{my-list} without first verifying if @code{my-list} is a list which has the right number of -elements and has @code{add} as its first element. The precise -behavior when the object does not actually match the pattern is -undefined, although the body will not be silently skipped: either an -error is signaled or the body is run with some of the variables -potentially bound to arbitrary values like @code{nil}. +elements and has @code{add} as its first element. + +The precise behavior when the object does not actually match the pattern +depends on the types, although the body will not be silently skipped: +either an error is signaled or the body is run with some of the +variables bound to arbitrary values like @code{nil}. +For example, the above pattern will result in @var{x} and @var{y} +being extracted with operations like @code{car} or @code{nth}, so they +will get value @code{nil} when @var{my-list} is too short. In contrast, +with a pattern like @code{`[add ,x ,y]}, those same variables would +be extracted using @code{aref} which would signal an error if +@var{my-list} is not an array or is too short. The pcase patterns that are useful for destructuring bindings are generally those described in @ref{Backquote Patterns}, since they commit 12988a359daf798f1bf2781e7f54003630c48cdd Author: Andrea Corallo Date: Wed May 15 19:17:30 2024 +0200 * admin/MAINTAINERS: Add myself in (co-)maintainers. diff --git a/admin/MAINTAINERS b/admin/MAINTAINERS index 4fa65a8df24..c15401ddeb2 100644 --- a/admin/MAINTAINERS +++ b/admin/MAINTAINERS @@ -9,6 +9,7 @@ The (co-)maintainers of Emacs are: Eli Zaretskii Stefan Kangas + Andrea Corallo ============================================================================== 1. Areas that someone wants to be maintaining (i.e. has a particularly commit 3a0fc5bb3f49772effa2090372ea42c3561d3aa6 Author: Mattias EngdegÄrd Date: Wed May 15 15:23:18 2024 +0200 ; * lisp/gnus/mml-smime.el: Need cl-lib at runtime now. diff --git a/lisp/gnus/mml-smime.el b/lisp/gnus/mml-smime.el index 9218bc079db..07d72edf3a3 100644 --- a/lisp/gnus/mml-smime.el +++ b/lisp/gnus/mml-smime.el @@ -24,8 +24,7 @@ ;;; Code: -(eval-when-compile (require 'cl-lib)) - +(require 'cl-lib) (require 'smime) (require 'mm-decode) (require 'mml-sec) commit 38fe837f83448338b6ce5aaf771811ce6755d00a Author: Martin Rudalics Date: Wed May 15 09:49:14 2024 +0200 ; * doc/lispref/windows.texi (Buffer Display Action Functions): Fix wording. diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 104420235df..34f7b260a52 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -2809,7 +2809,7 @@ Windows}). @defun display-buffer-use-least-recent-window buffer alist This function is similar to @code{display-buffer-use-some-window}, but -will try harder to not use the a recently used window. In particular, +will try harder to not use a recently used window. In particular, it does not use the selected window. In addition, it will first try to reuse a window that shows @var{buffer} already, base the decision whether it should use a window showing another buffer on that window's