; 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) <mock>:
Add `tramp-tmpdir'.  Adapt `tramp-login-program'.
(ert-remote-temporary-file-directory): Improve expansion.
(tramp-test35-remote-path): Adapt test.
This commit is contained in:
Michael Albinus 2026-05-23 10:25:46 +02:00
parent f6281d757d
commit 3d2bb233f2
4 changed files with 28 additions and 11 deletions

View file

@ -6435,6 +6435,13 @@ You can change this directory by setting the user option
"XDG_RUNTIME_DIR")}. "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 @item
How to ignore errors when changing file attributes? How to ignore errors when changing file attributes?

View file

@ -63,7 +63,7 @@ SYNTAX can be one of the symbols `default' (default),
(interactive (interactive
(list (list
(completing-read (completing-read
"method: " "Method: "
(tramp-compat-seq-keep (tramp-compat-seq-keep
(lambda (x) (lambda (x)
(when-let* ((name (symbol-name x)) (when-let* ((name (symbol-name x))

View file

@ -3107,6 +3107,11 @@ will be used."
,(concat "PS1=" (getenv-internal "PS1" env))))) ,(concat "PS1=" (getenv-internal "PS1" env)))))
(eenv (setenv-internal eenv "INSIDE_EMACS" nil nil)) (eenv (setenv-internal eenv "INSIDE_EMACS" nil nil))
(eenv (setenv-internal eenv "PS1" 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 (command
(when (stringp program) (when (stringp program)
(format "cd %s && %s exec %s %s env %s %s" (format "cd %s && %s exec %s %s env %s %s"
@ -3222,10 +3227,15 @@ will be used."
(delete-region mark (point-max)) (delete-region mark (point-max))
(narrow-to-region (point-max) (point-max)) (narrow-to-region (point-max) (point-max))
;; Send delayed environment. ;; Send delayed environment.
(dolist (entry eenv) (when eenv
(tramp-send-command (tramp-send-command
v (format v
"export %s" (tramp-shell-quote-argument entry)))) (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. ;; Now do it.
(if command (if command
;; Send the command. ;; Send the command.
@ -3350,6 +3360,8 @@ will be used."
env "EMACSCLIENT_TRAMP" env "EMACSCLIENT_TRAMP"
(tramp-make-tramp-file-name v 'noloc) 'keep))) (tramp-make-tramp-file-name v 'noloc) 'keep)))
(setq env (setenv-internal env "INSIDE_EMACS" (tramp-inside-emacs) '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 (when env
(setq command (setq command
(format (format

View file

@ -117,9 +117,10 @@
(t (add-to-list (t (add-to-list
'tramp-methods 'tramp-methods
`("mock" `("mock"
(tramp-login-program ,tramp-default-remote-shell) (tramp-login-program ,tramp-encoding-shell)
(tramp-login-args (("-i"))) (tramp-login-args (("-i")))
(tramp-direct-async ("-c")) (tramp-direct-async ("-c"))
(tramp-tmpdir ,temporary-file-directory)
(tramp-remote-shell ,tramp-default-remote-shell) (tramp-remote-shell ,tramp-default-remote-shell)
(tramp-remote-shell-args ("-c")) (tramp-remote-shell-args ("-c"))
(tramp-connection-timeout 10))) (tramp-connection-timeout 10)))
@ -225,7 +226,8 @@
auto-revert-use-notify t auto-revert-use-notify t
ert-batch-backtrace-right-margin nil ert-batch-backtrace-right-margin nil
ert-remote-temporary-file-directory 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 password-cache-expiry nil
remote-file-name-inhibit-cache nil remote-file-name-inhibit-cache nil
tramp-allow-unsafe-temporary-files t 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'." "Check loooong `tramp-remote-path'."
:tags '(:expensive-test) :tags '(:expensive-test)
(skip-unless (tramp--test-enabled)) (skip-unless (tramp--test-enabled))
(skip-unless (tramp--test-sh-p)) (skip-unless (tramp--test-supports-environment-variables-p))
(skip-unless (not (tramp--test-crypt-p)))
(let* ((tmp-name1 (tramp--test-make-temp-name)) (let* ((tmp-name1 (tramp--test-make-temp-name))
(default-directory ert-remote-temporary-file-directory) (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. ;; 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) (provide 'tramp-tests)
;;; tramp-tests.el ends here ;;; tramp-tests.el ends here