tramp-completion-function-alist is intended to
customize which files are taken into account for user and host name
completion (see File name completion). For every method, it keeps
a set of configuration files, accompanied by a Lisp function able to
parse that file. Entries in
have the form (method pair1 pair2 …).
Each pair is composed of (function file). function is responsible to extract user names and host names from file for completion. There are two functions which access this variable:
This function returns the list of completion functions for method.
(tramp-get-completion-function "rsh") ⇒ ((tramp-parse-rhosts "/etc/hosts.equiv") (tramp-parse-rhosts "~/.rhosts"))
This function sets function-list as list of completion functions for method.
(tramp-set-completion-function "ssh" '((tramp-parse-sconfig "/etc/ssh_config") (tramp-parse-sconfig "~/.ssh/config"))) ⇒ ((tramp-parse-sconfig "/etc/ssh_config") (tramp-parse-sconfig "~/.ssh/config"))
The following predefined functions parsing configuration files exist:
This function parses files which are syntactical equivalent to ~/.rhosts. It returns both host names and user names, if specified.
This function parses files which are syntactical equivalent to ~/.ssh/known_hosts. Since there are no user names specified in such files, it can return host names only.
This function returns the host nicknames defined by
in ~/.ssh/config style files.
SSH2 parsing of directories /etc/ssh2/hostkeys/* and
~/ssh2/hostkeys/*. Hosts are coded in file names
hostkey_portnumber_host-name.pub. User names
Another SSH2 style parsing of directories like
/etc/ssh2/knownhosts/* and ~/ssh2/knownhosts/*. This
case, hosts names are coded in file names
host-name.algorithm.pub. User names are always
A function dedicated to /etc/hosts style files. It returns host names only.
A function which parses /etc/passwd like files. Obviously, it can return user names only.
Finally, a function which parses ~/.netrc like files. This includes also ~/.authinfo-style files.
If you want to keep your own data in a file, with your own structure, you might provide such a function as well. This function must meet the following conventions:
file must be either a file name on your host, or
The function must return a list of (user host), which are
taken as candidates for user and host name completion.
(my-tramp-parse "~/.my-tramp-hosts") ⇒ ((nil "toto") ("daniel" "melancholia"))