Subject: bug#79173: 30.1; TRAMP simplified syntax produces empty completing-read candidates

From: Michael Albinus <[email-masked]>
Date: Tue, 05 Aug 2025 14:21:14 +0200

Reuben Thomas <[email-masked]> writes:

Hi Reuben,

> I have a question: presumably the latest version of TRAMP still
> generates empty completion-read candidates. I think the question still
> needs answering: is this valid? If not, then whatever has changed in
> Emacs 31 is just masking a bug that still exists in TRAMP.

Good point. Could you pls check the appended patch? Since this touches a
macro, you must recompile first tramp.el, and afterwards tramp-sh.el.

Best regards, Michael.

diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index e0e080021c7..c72ebf890d5 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -2863,7 +2863,7 @@ tramp-skeleton-file-name-all-completions
 BODY is the backend specific code."
   (declare (indent 2) (debug t))
   `(ignore-error file-missing
-     (delete-dups (delq nil
+     (delete-dups (delq nil (delete ""
        (let* ((case-fold-search read-file-name-completion-ignore-case)
 	      (result (progn ,@body)))
 	 ;; Some storage systems do not return "." and "..".
@@ -2880,7 +2880,7 @@ tramp-skeleton-file-name-all-completions
 		    (dolist (elt completion-regexp-list x)
 		      (unless (string-match-p elt x) (throw 'match nil))))))
 	      result)
-	   result))))))
+	   result)))))))
 
 (defvar tramp--last-hop-directory nil
   "Tracks the directory from which to run login programs.")