Commit f8f91c2b authored by Michael Albinus's avatar Michael Albinus

* net/tramp.el (tramp-set-completion-function, tramp-parse-rhosts)

(tramp-parse-shosts, tramp-parse-sconfig, tramp-parse-shostkeys)
(tramp-parse-hosts, tramp-parse-passwd, tramp-parse-netrc)
(tramp-parse-putty):
* net/tramp-sh.el (tramp-completion-function-alist-rsh)
(tramp-completion-function-alist-ssh)
(tramp-completion-function-alist-telnet)
(tramp-completion-function-alist-su)
(tramp-completion-function-alist-putty): Set `tramp-autoload'
cookie.

* net/tramp-ftp.el:
* net/tramp-sh.el:
* net/tramp-smb.el: Set `tramp-autoload' cookie, and eval after
load "tramp.el" `tramp-set-completion-function'.
parent e17d9003
2011-06-04 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (tramp-set-completion-function, tramp-parse-rhosts)
(tramp-parse-shosts, tramp-parse-sconfig, tramp-parse-shostkeys)
(tramp-parse-hosts, tramp-parse-passwd, tramp-parse-netrc)
(tramp-parse-putty):
* net/tramp-sh.el (tramp-completion-function-alist-rsh)
(tramp-completion-function-alist-ssh)
(tramp-completion-function-alist-telnet)
(tramp-completion-function-alist-su)
(tramp-completion-function-alist-putty): Set `tramp-autoload'
cookie.
* net/tramp-ftp.el:
* net/tramp-sh.el:
* net/tramp-smb.el: Set `tramp-autoload' cookie, and eval after
load "tramp.el" `tramp-set-completion-function'.
2011-06-04 Stefan Monnier <monnier@iro.umontreal.ca>
* shell.el: Require and use pcomplete.
......
......@@ -113,9 +113,11 @@ present for backward compatibility."
(list nil "\\`\\(anonymous\\|ftp\\)\\'" tramp-ftp-method)))
;; Add completion function for FTP method.
(tramp-set-completion-function
tramp-ftp-method
'((tramp-parse-netrc "~/.netrc")))
;;;###tramp-autoload
(eval-after-load 'tramp
'(tramp-set-completion-function
tramp-ftp-method
'((tramp-parse-netrc "~/.netrc"))))
;; If there is URL syntax, `substitute-in-file-name' needs special
;; handling.
......
......@@ -400,11 +400,13 @@ detected as prompt when being sent on echoing hosts, therefore.")
"\\'")
nil ,(user-login-name)))
;;;###tramp-autoload
(defconst tramp-completion-function-alist-rsh
'((tramp-parse-rhosts "/etc/hosts.equiv")
(tramp-parse-rhosts "~/.rhosts"))
"Default list of (FUNCTION FILE) pairs to be examined for rsh methods.")
;;;###tramp-autoload
(defconst tramp-completion-function-alist-ssh
'((tramp-parse-rhosts "/etc/hosts.equiv")
(tramp-parse-rhosts "/etc/shosts.equiv")
......@@ -420,47 +422,60 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-parse-sknownhosts "~/.ssh2/knownhosts"))
"Default list of (FUNCTION FILE) pairs to be examined for ssh methods.")
;;;###tramp-autoload
(defconst tramp-completion-function-alist-telnet
'((tramp-parse-hosts "/etc/hosts"))
"Default list of (FUNCTION FILE) pairs to be examined for telnet methods.")
;;;###tramp-autoload
(defconst tramp-completion-function-alist-su
'((tramp-parse-passwd "/etc/passwd"))
"Default list of (FUNCTION FILE) pairs to be examined for su methods.")
;;;###tramp-autoload
(defconst tramp-completion-function-alist-putty
'((tramp-parse-putty
"HKEY_CURRENT_USER\\Software\\SimonTatham\\PuTTY\\Sessions"))
"Default list of (FUNCTION REGISTRY) pairs to be examined for putty methods.")
(tramp-set-completion-function "rcp" tramp-completion-function-alist-rsh)
(tramp-set-completion-function "remcp" tramp-completion-function-alist-rsh)
(tramp-set-completion-function "scp" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "scp1" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "scp2" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "scpc" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "scpx" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "sftp" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "rsync" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "rsyncc" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "rsh" tramp-completion-function-alist-rsh)
(tramp-set-completion-function "remsh" tramp-completion-function-alist-rsh)
(tramp-set-completion-function "ssh" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "ssh1" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "ssh2" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "ssh1_old" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "ssh2_old" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "sshx" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "telnet" tramp-completion-function-alist-telnet)
(tramp-set-completion-function "su" tramp-completion-function-alist-su)
(tramp-set-completion-function "sudo" tramp-completion-function-alist-su)
(tramp-set-completion-function "ksu" tramp-completion-function-alist-su)
(tramp-set-completion-function "krlogin" tramp-completion-function-alist-rsh)
(tramp-set-completion-function "plink" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "plink1" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "plinkx" tramp-completion-function-alist-putty)
(tramp-set-completion-function "pscp" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "fcp" tramp-completion-function-alist-ssh)
;;;###tramp-autoload
(eval-after-load 'tramp
'(progn
(tramp-set-completion-function "rcp" tramp-completion-function-alist-rsh)
(tramp-set-completion-function "remcp" tramp-completion-function-alist-rsh)
(tramp-set-completion-function "scp" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "scp1" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "scp2" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "scpc" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "scpx" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "sftp" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "rsync" tramp-completion-function-alist-ssh)
(tramp-set-completion-function
"rsyncc" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "rsh" tramp-completion-function-alist-rsh)
(tramp-set-completion-function "remsh" tramp-completion-function-alist-rsh)
(tramp-set-completion-function "ssh" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "ssh1" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "ssh2" tramp-completion-function-alist-ssh)
(tramp-set-completion-function
"ssh1_old" tramp-completion-function-alist-ssh)
(tramp-set-completion-function
"ssh2_old" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "sshx" tramp-completion-function-alist-ssh)
(tramp-set-completion-function
"telnet" tramp-completion-function-alist-telnet)
(tramp-set-completion-function "su" tramp-completion-function-alist-su)
(tramp-set-completion-function "sudo" tramp-completion-function-alist-su)
(tramp-set-completion-function "ksu" tramp-completion-function-alist-su)
(tramp-set-completion-function
"krlogin" tramp-completion-function-alist-rsh)
(tramp-set-completion-function "plink" tramp-completion-function-alist-ssh)
(tramp-set-completion-function
"plink1" tramp-completion-function-alist-ssh)
(tramp-set-completion-function
"plinkx" tramp-completion-function-alist-putty)
(tramp-set-completion-function "pscp" tramp-completion-function-alist-ssh)
(tramp-set-completion-function "fcp" tramp-completion-function-alist-ssh)))
;; "getconf PATH" yields:
;; HP-UX: /usr/bin:/usr/ccs/bin:/opt/ansic/bin:/opt/langtools/bin:/opt/fortran/bin
......
......@@ -53,9 +53,11 @@
`(,(concat "\\`" tramp-smb-method "\\'") nil nil))
;; Add completion function for SMB method.
(tramp-set-completion-function
tramp-smb-method
'((tramp-parse-netrc "~/.netrc")))
;;;###tramp-autoload
(eval-after-load 'tramp
'(tramp-set-completion-function
tramp-smb-method
'((tramp-parse-netrc "~/.netrc"))))
(defcustom tramp-smb-program "smbclient"
"*Name of SMB client to run."
......
......@@ -1500,6 +1500,7 @@ letter into the file name. This function removes it."
;;; Config Manipulation Functions:
;;;###tramp-autoload
(defun tramp-set-completion-function (method function-list)
"Sets the list of completion functions for METHOD.
FUNCTION-LIST is a list of entries of the form (FUNCTION FILE).
......@@ -2366,6 +2367,7 @@ PARTIAL-USER must match USER, PARTIAL-HOST must match HOST."
(unless (zerop (+ (length user) (length host)))
(tramp-completion-make-tramp-file-name method user host nil)))
;;;###tramp-autoload
(defun tramp-parse-rhosts (filename)
"Return a list of (user host) tuples allowed to access.
Either user or host may be nil."
......@@ -2396,6 +2398,7 @@ Either user or host may be nil."
(forward-line 1)
result))
;;;###tramp-autoload
(defun tramp-parse-shosts (filename)
"Return a list of (user host) tuples allowed to access.
User is always nil."
......@@ -2425,6 +2428,7 @@ User is always nil."
(forward-line 1))
result))
;;;###tramp-autoload
(defun tramp-parse-sconfig (filename)
"Return a list of (user host) tuples allowed to access.
User is always nil."
......@@ -2454,6 +2458,7 @@ User is always nil."
(forward-line 1))
result))
;;;###tramp-autoload
(defun tramp-parse-shostkeys (dirname)
"Return a list of (user host) tuples allowed to access.
User is always nil."
......@@ -2485,6 +2490,7 @@ User is always nil."
(setq files (cdr files)))
result))
;;;###tramp-autoload
(defun tramp-parse-hosts (filename)
"Return a list of (user host) tuples allowed to access.
User is always nil."
......@@ -2519,6 +2525,7 @@ User is always nil."
;; as default. Unfortunately, we have no information whether any user name
;; has been typed already. So we use `tramp-current-user' as indication,
;; assuming it is set in `tramp-completion-handle-file-name-all-completions'.
;;;###tramp-autoload
(defun tramp-parse-passwd (filename)
"Return a list of (user host) tuples allowed to access.
Host is always \"localhost\"."
......@@ -2548,6 +2555,7 @@ Host is always \"localhost\"."
(forward-line 1)
result))
;;;###tramp-autoload
(defun tramp-parse-netrc (filename)
"Return a list of (user host) tuples allowed to access.
User may be nil."
......@@ -2578,6 +2586,7 @@ User may be nil."
(forward-line 1)
result))
;;;###tramp-autoload
(defun tramp-parse-putty (registry)
"Return a list of (user host) tuples allowed to access.
User is always nil."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment