master 5172d275c05 2/4: Merge from origin/emacs-31

Eli Zaretskii <[email protected]> Sat, 18 Jul 2026 06:00:09 -0400 (EDT)
Newsgroups gmane.emacs.diffs
Message-ID <[email protected]>
branch: master
commit 5172d275c0568a5e5f427e09298d8ba9387e5a78
Merge: 036a2e7efcd 39e1e9c3677
Author: Eli Zaretskii <[email protected]>
Commit: Eli Zaretskii <[email protected]>

    Merge from origin/emacs-31
    
    39e1e9c3677 ; * doc/lispref/keymaps.texi (Changing Key Bindings): Fix...
    3b4cba3b68f Fix `with-tramp-local-environment'
---
 doc/lispref/keymaps.texi | 28 ++++++++++++----------------
 lisp/net/tramp.el        |  1 +
 2 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi
index 8ef6b77c178..97d496b8df2 100644
--- a/doc/lispref/keymaps.texi
+++ b/doc/lispref/keymaps.texi
@@ -133,14 +133,14 @@ A three key sequence of the keys @kbd{S}, @kbd{o} and @kbd{m}.
 A two key sequence of the keys @kbd{c} with the control modifier and
 then the key @kbd{o}
 
-@item H-<left>
-The key named @kbd{left} with the hyper modifier.
+@item H-@key{LEFT}
+The key named @key{LEFT} with the hyper modifier.
 
-@item M-RET
-The @kbd{return} key with a meta modifier.
+@item M-@key{RET}
+The @key{RET} or @key{Return} key with a meta modifier.
 
-@item C-M-<space>
-The @kbd{space} key with both the control and meta modifiers.
+@item C-M-@key{SPC}
+The @key{SPC} key with both the control and meta modifiers.
 @end table
 
 The only keys that have a special shorthand syntax are @kbd{NUL},
@@ -151,16 +151,12 @@ The modifiers have to be specified in alphabetical order:
 
 @findex keymap-set
 @defun keymap-set keymap key binding
-This function sets the binding for @var{key} in @var{keymap}.  (If
-@var{key} is more than one event long, the change is actually made
-in another keymap reached from @var{keymap}.)  The argument
-@var{binding} can be any Lisp object, but only certain types are
-meaningful.  (For a list of meaningful types, see @ref{Key Lookup}.)
-The value returned by @code{keymap-set} is @var{binding}.
-
-If @var{key} is @kbd{<t>}, this sets the default binding in
-@var{keymap}.  When an event has no binding of its own, the Emacs
-command loop uses the keymap's default binding, if there is one.
+This function sets the binding for @var{key} in @var{keymap}.  The
+argument @var{key} is a string that must satisfy @code{key-valid-p}
+(@pxref{Key Sequences}).  The argument @var{binding} can be any Lisp
+object, but only certain types are meaningful.  (For a list of
+meaningful types, see @ref{Key Lookup}.)  The value returned by
+@code{keymap-set} is @var{binding}.
 
 @cindex invalid prefix key error
 @cindex key sequence error
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 78e1d34ebab..41dcffd8b19 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -7228,6 +7228,7 @@ might have improper values."
 	  (mapcar #'car tramp-connection-local-default-system-variables))))
     `(let* ((default-directory tramp-compat-temporary-file-directory)
 	    (temporary-file-directory tramp-compat-temporary-file-directory)
+	    (process-environment (copy-sequence process-environment))
             ,@bindings)
        (setenv "TERM" tramp-terminal-type)
        (setenv "PROMPT_COMMAND")