Subject: bug#63359: Fwd: bug#63359: 30.0.50; Lack of ssh hosts completion in Tramp using Fido mode

From: Michael Albinus <[email-masked]>
Date: Tue, 09 May 2023 16:32:51 +0200

Forwarding for the archives

Subject: Re: bug#63359: 30.0.50; Lack of ssh hosts completion in Tramp using Fido mode
From: Michael Albinus <[email-masked]>
Date: Tue, 09 May 2023 13:43:29 +0200

Bartosz Kaczyński <[email-masked]> writes:

> Hi Michael,

Hi Bartosz,

>> Have you tried this recipe?
>
> Yes, I have. Here is my TRAMP configuration:
>
> (use-package tramp
>   :config
>     ---snip---
>   (with-eval-after-load 'tramp
>     (tramp-set-completion-function
>      "ssh" (append (tramp-get-completion-function "ssh")
>                    (mapcar (lambda (file) `(tramp-parse-sconfig ,file))
>                            (directory-files
>                             "~/.ssh/conf.d/"
>                             'full directory-files-no-dot-files-regexp))))
>     (tramp-set-completion-function
>      "scp" (append (tramp-get-completion-function "scp")
>                    (mapcar (lambda (file) `(tramp-parse-sconfig ,file))
>                            (directory-files
>                             "~/.ssh/conf.d/"
>                             'full directory-files-no-dot-files-regexp)))))
>     ---snip---
> )
>
> And I confirm this solution works for Icomplete but for some reasons it
> doesn't work for Fido.

I cannot reproduce it. Here's my test setup:

I have created a new directory /tmp/tmp with the following files:

--8<---------------cut here---------------start------------->8---
# ll /tmp/tmp
total 8
-rw-r--r--. 1 albinus albinus 47 May  9 13:27 xxx
-rw-r--r--. 1 albinus albinus 47 May  9 13:27 yyy
# cat /tmp/tmp/*
Host xxx-63359
     Hostname xxx-63359.invalid
Host yyy-63359
     Hostname yyy-63359.invalid
--8<---------------cut here---------------end--------------->8---

I have created a file /tmp/tmp.el with the following contents:

--8<---------------cut here---------------start------------->8---
# cat /tmp/tmp.el
(use-package tramp
  :config
  (with-eval-after-load 'tramp
    (tramp-set-completion-function
     "ssh" (append (tramp-get-completion-function "ssh")
                   (mapcar (lambda (file) `(tramp-parse-sconfig ,file))
                           (directory-files
                            "/tmp/tmp/"
                            'full directory-files-no-dot-files-regexp))))))
--8<---------------cut here---------------end--------------->8---

Then I have tested

--8<---------------cut here---------------start------------->8---
# emacs -Q -l /tmp/tmp.el -f icomplete-mode
# emacs -Q -l /tmp/tmp.el -f fido-mode
--8<---------------cut here---------------end--------------->8---

After typing 'C-x C-f /ssh: TAB' I have seen the candidates 'xxx-63359:'
and 'yyy-63359:', in both tests.

Looks like there is something odd with your config? Could you please try
my recipe, whether it also works for you? Then you can add step by step
your config, and check what's wrong?

> Regards, bartk

Best regards, Michael.