From fe1c02d8498e443e5816bdd76402bd16df8ab1f7 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Thu, 4 Jun 2026 08:34:48 +0200 Subject: [PATCH] Fix Tramp distrobox integration * lisp/net/tramp.el (tramp-yesno-prompt-regexp): Fix docstring. (tramp-yn-prompt-regexp): Fix docstring. Extend. Add :version. * test/lisp/net/tramp-tests.el (tramp-test03-file-error): Adapt test. --- lisp/net/tramp.el | 10 +++++++--- test/lisp/net/tramp-tests.el | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index fc897fb2a7c..bbe44880fd1 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -801,19 +801,23 @@ The regexp should match at end of buffer." (? "/[fingerprint]") ")?" (* blank)) "Regular expression matching all yes/no queries which need to be confirmed. -The confirmation should be done with yes or no. +The confirmation should be done with \"yes\" or \"no\". The regexp should match at end of buffer. See also `tramp-yn-prompt-regexp'." :type 'regexp) (defcustom tramp-yn-prompt-regexp (rx (| (: "Store key in cache? (y/n" (* nonl) ")") - "Update cached key? (y/n, Return cancels connection)") + "Update cached key? (y/n, Return cancels connection)" + ;; distrobox. + (: "Error: no such container \"" (+ nonl) "\"\n" + "Create it now, out of image " (+ nonl) "? [Y/n]:")) (* blank)) "Regular expression matching all y/n queries which need to be confirmed. -The confirmation should be done with y or n. +The confirmation should be done with \"y\" or \"n\". The regexp should match at end of buffer. See also `tramp-yesno-prompt-regexp'." + :version "31.1" :type 'regexp) ;;;###tramp-autoload diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 4d11faf64de..3577388aa62 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -2299,6 +2299,7 @@ being the result.") (tramp-default-proxies-alist tramp-default-proxies-alist) (tramp-show-ad-hoc-proxies t)) (cl-letf* (((symbol-function #'read-string) #'ignore) ; Suppress password. + ((symbol-function #'y-or-n-p) #'ignore) ; distrobox. ((tramp-file-name-host vec) "example.com.invalid")) (should-error (file-exists-p (tramp-make-tramp-file-name vec))