From 3d2bb233f27c00dac2bec0c70a569a6232f37c54 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sat, 23 May 2026 10:25:46 +0200 Subject: [PATCH] ; Minor Tramp changes * doc/misc/tramp.texi (Frequently Asked Questions): google-drive has been disabled in GNOME 50. * lisp/net/tramp-cmds.el (tramp-enable-method): Upcase prompt. * lisp/net/tramp-sh.el (tramp-sh-handle-make-process) (tramp-sh-handle-process-file): Improve setting of environment variables. * test/lisp/net/tramp-tests.el (tramp-methods) : Add `tramp-tmpdir'. Adapt `tramp-login-program'. (ert-remote-temporary-file-directory): Improve expansion. (tramp-test35-remote-path): Adapt test. --- doc/misc/tramp.texi | 7 +++++++ lisp/net/tramp-cmds.el | 2 +- lisp/net/tramp-sh.el | 18 +++++++++++++++--- test/lisp/net/tramp-tests.el | 12 +++++------- 4 files changed, 28 insertions(+), 11 deletions(-) diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index ae65cf2a620..6daa2b010cf 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -6435,6 +6435,13 @@ You can change this directory by setting the user option "XDG_RUNTIME_DIR")}. +@item +I get an error @samp{Method `gdrive' not supported by GVFS}. + +@samp{google-drive} has been disabled in @acronym{GNOME} 50. It is +not clear yet whether and when it will be reenabled. +@c @uref{https://discourse.gnome.org/t/google-drive-in-gnome-50/34417} + @item How to ignore errors when changing file attributes? diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el index 95e1c5ecad8..1fc77f0e80d 100644 --- a/lisp/net/tramp-cmds.el +++ b/lisp/net/tramp-cmds.el @@ -63,7 +63,7 @@ SYNTAX can be one of the symbols `default' (default), (interactive (list (completing-read - "method: " + "Method: " (tramp-compat-seq-keep (lambda (x) (when-let* ((name (symbol-name x)) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 7b90ae9c11b..8d4dc557676 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3107,6 +3107,11 @@ will be used." ,(concat "PS1=" (getenv-internal "PS1" env))))) (eenv (setenv-internal eenv "INSIDE_EMACS" nil nil)) (eenv (setenv-internal eenv "PS1" nil nil)) + vars + (eenv (dolist (item (reverse eenv) vars) + (setq item (split-string item "=" 'omit)) + (setcdr item (string-join (cdr item) "=")) + (push (format "%s %s" (car item) (cdr item)) vars))) (command (when (stringp program) (format "cd %s && %s exec %s %s env %s %s" @@ -3222,10 +3227,15 @@ will be used." (delete-region mark (point-max)) (narrow-to-region (point-max) (point-max)) ;; Send delayed environment. - (dolist (entry eenv) + (when eenv (tramp-send-command - v (format - "export %s" (tramp-shell-quote-argument entry)))) + v + (format + "while read var val; do export $var=\"$val\"; done <<'%s'\n%s\n%s" + tramp-end-of-heredoc + (string-join eenv "\n") + tramp-end-of-heredoc) + t)) ;; Now do it. (if command ;; Send the command. @@ -3350,6 +3360,8 @@ will be used." env "EMACSCLIENT_TRAMP" (tramp-make-tramp-file-name v 'noloc) 'keep))) (setq env (setenv-internal env "INSIDE_EMACS" (tramp-inside-emacs) 'keep)) + ;; Remove looong environment variables, for example from tramp-tests.el. + (setq env (seq-remove (lambda (x) (length> x 256)) env)) (when env (setq command (format diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index c0ad7205c5d..4d11faf64de 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -117,9 +117,10 @@ (t (add-to-list 'tramp-methods `("mock" - (tramp-login-program ,tramp-default-remote-shell) + (tramp-login-program ,tramp-encoding-shell) (tramp-login-args (("-i"))) (tramp-direct-async ("-c")) + (tramp-tmpdir ,temporary-file-directory) (tramp-remote-shell ,tramp-default-remote-shell) (tramp-remote-shell-args ("-c")) (tramp-connection-timeout 10))) @@ -225,7 +226,8 @@ auto-revert-use-notify t ert-batch-backtrace-right-margin nil ert-remote-temporary-file-directory - (expand-file-name ert-remote-temporary-file-directory) + (let ((tramp-show-ad-hoc-proxies t) (non-essential t)) + (expand-file-name ert-remote-temporary-file-directory)) password-cache-expiry nil remote-file-name-inhibit-cache nil tramp-allow-unsafe-temporary-files t @@ -6855,8 +6857,7 @@ INPUT, if non-nil, is a string sent to the process." "Check loooong `tramp-remote-path'." :tags '(:expensive-test) (skip-unless (tramp--test-enabled)) - (skip-unless (tramp--test-sh-p)) - (skip-unless (not (tramp--test-crypt-p))) + (skip-unless (tramp--test-supports-environment-variables-p)) (let* ((tmp-name1 (tramp--test-make-temp-name)) (default-directory ert-remote-temporary-file-directory) @@ -9330,9 +9331,6 @@ If INTERACTIVE is non-nil, the tests are run interactively." ;; Use `skip-when' starting with Emacs 30.1. -;; Starting with Emacs 29, use `ert-with-temp-file' and -;; `ert-with-temp-directory'. - (provide 'tramp-tests) ;;; tramp-tests.el ends here