bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#50387: Possible bug in Tramp or in completions


From: Gregory Heytings
Subject: bug#50387: Possible bug in Tramp or in completions
Date: Sun, 05 Sep 2021 00:43:59 +0000


With a ~/.ssh/config file containing two entries:

Host foo
  ...
Host bar
  ...

emacs -Q
M-: (setq tramp-default-method "ssh")
M-: (add-to-list 'completion-styles 'substring)
C-x C-x /ssh: TAB

displays "Sole completion". If, instead of having completion-styles set to:

(substring basic partial-completion emacs22)

it is set to:

(basic substring partial-completion emacs22)

then two completion candidates are shown (as expected): "ssh:foo:" and "ssh:bar:".

This happens because the "substring" completion mechanism is tried first by completion--some in completion--nth-completion, and returns (t . substring), because

(completion-substring-try-completion "/ssh:" #'completion-file-name-table #'file-exists-p 5)

returns t, because

(completion-substring--all-completions "/ssh:" #'completion-file-name-table #'file-exists-p 5) returns (("ssh:")

returns (prefix "ssh:") "/" "" 1), because

(completion-boundaries "/ssh:" #'completion-file-name-table #'file-exists-p "")

returns (1 . 0).

When the "basic" completion mechanism is tried first,

(completion-basic-try-completion "/ssh:" #'completion-file-name-table #'file-exists-p 5)

returns ("/ssh:" . 5).

It is not clear to me whether this is a bug (I always thought that the order of completion mechanisms in completion-styles did not matter, and in this case it does indeed make no difference with (setq tramp-default-method "scp")), and if so if it is a bug in Tramp, or in the completion functions.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]