From 1ea21a8bdf2aa6152200498288cefc1f4cb5fd18 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 29 Dec 2024 12:26:05 +0100 Subject: [PATCH] Some minor Tramp changes * lisp/net/tramp-sh.el (tramp-sh-handle-process-file): Do proper quoting. * lisp/net/tramp.el (tramp-string-empty-or-nil-p): Declare `tramp-suppress-trace' property. (tramp-skeleton-make-symbolic-link): Drop volume letter when flushing. * test/lisp/net/tramp-tests.el (tramp-test39-make-lock-file-name): Adapt test. (tramp-test42-utf8): Do not run expensive tests on MS Windows. (cherry picked from commit 680906c136adfefda3a5d8be2b3ab7527521a449) --- lisp/net/tramp-sh.el | 5 ++--- lisp/net/tramp.el | 10 +++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 8660eabf24a..fb41cfdf32e 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3287,8 +3287,7 @@ will be used." (setq ret (tramp-send-command-and-check v (format "cd %s && %s" - (tramp-unquote-shell-quote-argument localname) - command) + (tramp-shell-quote-argument localname) command) t t t)) (unless (natnump ret) (setq ret 1)) ;; We should add the output anyway. @@ -5682,7 +5681,7 @@ Nonexistent directories are removed from spec." (dolist (cmd ;; Prefer GNU ls on *BSD and macOS. (if (tramp-check-remote-uname vec tramp-bsd-unames) - '( "gls" "ls" "gnuls") '("ls" "gnuls" "gls"))) + '("gls" "ls" "gnuls") '("ls" "gnuls" "gls"))) (let ((dl (tramp-get-remote-path vec)) result) (while (and dl (setq result (tramp-find-executable vec cmd dl t t))) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 0af6fe967ee..93c6aaa8d55 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1891,8 +1891,14 @@ See `tramp-dissect-file-name' for details." ;;;###tramp-autoload (defsubst tramp-string-empty-or-nil-p (string) "Check whether STRING is empty or nil." + ;; (declare (tramp-suppress-trace t)) (or (null string) (string= string ""))) +;; We cannot use the `declare' form for `tramp-suppress-trace' in +;; autoloaded functions, because the tramp-loaddefs.el generation +;; would fail. +(function-put #'tramp-string-empty-or-nil-p 'tramp-suppress-trace t) + (defun tramp-buffer-name (vec) "A name for the connection buffer VEC." (declare (tramp-suppress-trace t)) @@ -3712,7 +3718,9 @@ on the same host. Otherwise, TARGET is quoted." (setf ,target (tramp-file-local-name (expand-file-name ,target)))) ;; There could be a cyclic link. (tramp-flush-file-properties - v (expand-file-name ,target (tramp-file-local-name default-directory)))) + v (tramp-drop-volume-letter + (expand-file-name + ,target (tramp-file-local-name default-directory))))) ;; If TARGET is still remote, quote it. (if (tramp-tramp-file-p ,target) -- 2.39.5