From aa067441d65686e52c89733c65229e37fd609a9a Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sat, 25 Apr 2026 10:01:37 +0200 Subject: [PATCH] Some minor Tramp fixes * doc/misc/tramp.texi (Customizing Methods): Add comment. * lisp/net/tramp-sh.el (tramp-open-connection-setup-interactive-shell): Comment out setting `command-line-max-length', it doesn't work reliably. * test/lisp/net/tramp-tests.el (tramp-test03-file-error) (tramp-test26-file-name-completion-boundaries): Adapt tests. --- doc/misc/tramp.texi | 6 ++++++ lisp/net/tramp-sh.el | 22 ++++++++++++---------- test/lisp/net/tramp-tests.el | 4 +++- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 3aaa2e84982..8428109fde7 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -2042,6 +2042,12 @@ Access of a hadoop/hdfs file system. A file is accessed via the user that you want to use, and @samp{node} is the name of the hadoop server. +@c @cindex method @option{rpc} +@c @cindex @option{rpc} method +@c @item tramp-rpc +@c This is a @value{tramp} backend of its own. It uses a remote server +@c process to serve the requests, which gains better performance. + @cindex method @option{vagrant} @cindex @option{vagrant} method @item vagrant-tramp diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 079f82f556a..8cade9ce095 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -4688,20 +4688,22 @@ process to set up. VEC specifies the connection." (tramp-send-command vec (format "unset %s" (string-join unset " ")) t))) + ;; FIXME: This doesn't work with `tramp-test42-utf8' and "/ssh::tmp". ;; Set connection-local variable `command-line-max-length'. ;; `command-line-max-length' exists since Emacs 31. ;; `connection-local-profile-name-for-criteria' exists since Emacs 29.1. ;; We simulate it with `make-symbol'. - (when (boundp 'command-line-max-length) - (let* ((arg-max (tramp-get-remote-arg-max vec)) - (criteria (tramp-get-connection-local-criteria vec)) - (profile (if (fboundp 'connection-local-profile-name-for-criteria) - (connection-local-profile-name-for-criteria criteria) - (make-symbol "generated-profile-name")))) - (connection-local-set-profile-variables - profile - `((command-line-max-length . ,(if arg-max (floor arg-max 4) 4094)))) - (connection-local-set-profiles criteria profile))))) + ;; (when (boundp 'command-line-max-length) + ;; (let* ((arg-max (tramp-get-remote-arg-max vec)) + ;; (criteria (tramp-get-connection-local-criteria vec)) + ;; (profile (if (fboundp 'connection-local-profile-name-for-criteria) + ;; (connection-local-profile-name-for-criteria criteria) + ;; (make-symbol "generated-profile-name")))) + ;; (connection-local-set-profile-variables + ;; profile + ;; `((command-line-max-length . ,(if arg-max (floor arg-max 4) 4094)))) + ;; (connection-local-set-profiles criteria profile))))) + )) ;; Old text from documentation of tramp-methods: ;; Using a uuencode/uudecode inline method is discouraged, please use one diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 25e7870b5ce..a19a17dcecf 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -2287,6 +2287,8 @@ being the result.") (ert-deftest tramp-test03-file-error () "Check that Tramp signals an error in case of connection problems." + (skip-unless (tramp-file-name-p tramp-test-vec)) + ;; Connect to a non-existing host. (let ((vec (copy-tramp-file-name tramp-test-vec)) ;; Don't poison it. @@ -5394,7 +5396,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." ;; boundaries are always incorrect before that. (skip-unless (tramp--test-emacs31-p)) - (let ((remote (file-remote-p ert-remote-temporary-file-directory))) + (when-let* ((remote (file-remote-p ert-remote-temporary-file-directory))) (dolist (file `(,remote ,(concat remote "/~/") ,(concat remote "/usr//usr/") ,(concat remote remote "//usr/")))