Subject: Re: bug#79236: 30.1; file-directory-p in read-file-name prevents TRAMP protocol, user, and host completions

From: Dmitry Gutov <[email-masked]>
Date: Fri, 15 Aug 2025 04:44:05 +0300

Timothy, thanks for the report.

Michael, what do you think? Could this be fixed in Tramp's completion, 
or is there maybe a better way to use read-directory-name from 
project-prompt-project-dir?

On 14/08/2025 16:34, Timothy J. Miller wrote:
>  From `emacs -Q`:
> 
> (require 'tramp)
> (read-file-name "With file-directory-p: " default-directory nil t
> nil 'file-directory-p)
> 
> - Type "/<TAB>" at the prompt. TRAMP protocols are missing from
>   the completions list.
> 
> - Type "/ssh:<TAB>" at the prompt. TRAMP username & hostname are
>   missing from the completion list.
> 
> By way of contrast:
> 
> (read-file-name "Without file-directory-p: " default-directory nil
> t nil nil)
> 
> Repeating the two test cases above, TRAMP suggestions are present.
> 
> read-directory-name calls read-file-name with file-directory-p as
> the match predicate, and project.el project-prompt-project-dir
> loads new projects with read-directory-name. This bug prevents
> easy selection of projects on remote servers. Because find-file
> works correctly with the same emacs configuration, this breaks
> user expectations.