From a7417c47fafb361af73c36e0f40d99437a19a7aa Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sat, 1 Nov 2025 10:01:43 +0100 Subject: [PATCH] ; Minor Tramp changes * doc/misc/tramp.texi (Frequently Asked Questions): Don't mention Windows 7/8, they are obsolete now. Improve "speed up" item. * lisp/net/tramp-sh.el (tramp-expand-script): Handle "%%" format specifier better. --- doc/misc/tramp.texi | 5 +++-- lisp/net/tramp-sh.el | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 7ddf6758ae5..1193167ffc4 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -5366,7 +5366,7 @@ The package works successfully on @w{Emacs 28}, @w{Emacs 29}, @w{Emacs While Unix and Unix-like systems are the primary remote targets, @value{tramp} has equal success connecting to other platforms, such as -MS Windows 7/8/10. +MS Windows 10/11. @item @@ -5381,7 +5381,8 @@ responsiveness slows down. Some suggestions within the scope of @itemize @minus @item Use an external method, such as @option{scp}, which are faster than -internal methods for large files. +internal methods for large files. Set +@code{tramp-use-scp-direct-remote-copying} to non-@code{nil}. @item Keep the file @code{tramp-persistency-file-name}, which is where diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 61f64e4c024..aa0f6f72c9a 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -4054,10 +4054,11 @@ and \"%y\" format specifiers are replaced by the respective `awk', `hexdump', `ls', `test', od', `perl', `test -e', `readlink', `stat' and `python' commands. \"%n\" is replaced by \"2>/dev/null\", and \"%t\" is replaced by a temporary file name. If VEC is nil, the respective local -commands are used. If there is a format specifier which cannot be -expanded, this function returns nil." - (if (not (string-match-p - (rx (| bol (not "%")) "%" (any "ahlmnopqrsty")) script)) +commands are used. +\"%%\" is replaced by \"%\". If one of the format specifiers cannot be +expanded, this function returns nil. If there are only other format +specifiers, SCRIPT is returned unchanged." + (if (not (string-match-p (rx "%" (any "ahlmnopqrsty%")) script)) script (catch 'wont-work (let ((awk (when (string-match-p (rx (| bol (not "%")) "%a") script)