unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#50387: Possible bug in Tramp or in completions
@ 2021-09-05  0:43 Gregory Heytings
  2021-09-05 12:49 ` Gregory Heytings
  0 siblings, 1 reply; 33+ messages in thread
From: Gregory Heytings @ 2021-09-05  0:43 UTC (permalink / raw)
  To: 50387


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.





^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2021-09-08 14:25 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-05  0:43 bug#50387: Possible bug in Tramp or in completions Gregory Heytings
2021-09-05 12:49 ` Gregory Heytings
2021-09-06  8:18   ` Michael Albinus
2021-09-06 16:34     ` Gregory Heytings
2021-09-06 16:59       ` Michael Albinus
2021-09-06 17:26         ` Gregory Heytings
2021-09-06 17:41           ` Michael Albinus
2021-09-06 18:22             ` Gregory Heytings
2021-09-06 19:39               ` Michael Albinus
2021-09-06 20:00                 ` Gregory Heytings
2021-09-06 20:31                   ` Michael Albinus
2021-09-06 20:55                     ` Gregory Heytings
2021-09-07 12:58                       ` Michael Albinus
2021-09-07 13:23                         ` Gregory Heytings
2021-09-07 13:30                           ` Gregory Heytings
2021-09-07 14:23                             ` Michael Albinus
2021-09-07 16:46                               ` Gregory Heytings
2021-09-07 17:31                                 ` Michael Albinus
2021-09-07 17:51                                   ` Gregory Heytings
2021-09-07 18:04                                     ` Michael Albinus
2021-09-07 19:02                                       ` Gregory Heytings
2021-09-07 19:41                                         ` Gregory Heytings
2021-09-08  7:28                                           ` Michael Albinus
2021-09-08  7:26                                         ` Michael Albinus
2021-09-08  7:57                                           ` Gregory Heytings
2021-09-08 14:25                                             ` Michael Albinus
2021-09-07 13:37                         ` Lars Ingebrigtsen
2021-09-07 14:31                           ` Michael Albinus
2021-09-06 20:41                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-06 20:49                   ` Michael Albinus
2021-09-06 21:39                   ` Gregory Heytings
2021-09-07  5:42                     ` Eli Zaretskii
2021-09-07 11:29                       ` Michael Albinus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).