diff options
| author | Michael Albinus | 2011-06-04 15:58:37 +0200 |
|---|---|---|
| committer | Michael Albinus | 2011-06-04 15:58:37 +0200 |
| commit | f8f91c2ba836b2b2f9b7f9c3768e39d76a8895c9 (patch) | |
| tree | 5f2fcede9acc62b6099821b4a9a017b8f028aacd | |
| parent | e17d9003618cef75852a0b88334cea66a5c4b016 (diff) | |
| download | emacs-f8f91c2ba836b2b2f9b7f9c3768e39d76a8895c9.tar.gz emacs-f8f91c2ba836b2b2f9b7f9c3768e39d76a8895c9.zip | |
* 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'.
| -rw-r--r-- | lisp/ChangeLog | 18 | ||||
| -rw-r--r-- | lisp/net/tramp-ftp.el | 8 | ||||
| -rw-r--r-- | lisp/net/tramp-sh.el | 71 | ||||
| -rw-r--r-- | lisp/net/tramp-smb.el | 8 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 9 |
5 files changed, 80 insertions, 34 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2d42d38f834..75ab96c57a0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,21 @@ | |||
| 1 | 2011-06-04 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/tramp.el (tramp-set-completion-function, tramp-parse-rhosts) | ||
| 4 | (tramp-parse-shosts, tramp-parse-sconfig, tramp-parse-shostkeys) | ||
| 5 | (tramp-parse-hosts, tramp-parse-passwd, tramp-parse-netrc) | ||
| 6 | (tramp-parse-putty): | ||
| 7 | * net/tramp-sh.el (tramp-completion-function-alist-rsh) | ||
| 8 | (tramp-completion-function-alist-ssh) | ||
| 9 | (tramp-completion-function-alist-telnet) | ||
| 10 | (tramp-completion-function-alist-su) | ||
| 11 | (tramp-completion-function-alist-putty): Set `tramp-autoload' | ||
| 12 | cookie. | ||
| 13 | |||
| 14 | * net/tramp-ftp.el: | ||
| 15 | * net/tramp-sh.el: | ||
| 16 | * net/tramp-smb.el: Set `tramp-autoload' cookie, and eval after | ||
| 17 | load "tramp.el" `tramp-set-completion-function'. | ||
| 18 | |||
| 1 | 2011-06-04 Stefan Monnier <monnier@iro.umontreal.ca> | 19 | 2011-06-04 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 20 | ||
| 3 | * shell.el: Require and use pcomplete. | 21 | * shell.el: Require and use pcomplete. |
diff --git a/lisp/net/tramp-ftp.el b/lisp/net/tramp-ftp.el index d42a6f57ea9..71b3eacccea 100644 --- a/lisp/net/tramp-ftp.el +++ b/lisp/net/tramp-ftp.el | |||
| @@ -113,9 +113,11 @@ present for backward compatibility." | |||
| 113 | (list nil "\\`\\(anonymous\\|ftp\\)\\'" tramp-ftp-method))) | 113 | (list nil "\\`\\(anonymous\\|ftp\\)\\'" tramp-ftp-method))) |
| 114 | 114 | ||
| 115 | ;; Add completion function for FTP method. | 115 | ;; Add completion function for FTP method. |
| 116 | (tramp-set-completion-function | 116 | ;;;###tramp-autoload |
| 117 | tramp-ftp-method | 117 | (eval-after-load 'tramp |
| 118 | '((tramp-parse-netrc "~/.netrc"))) | 118 | '(tramp-set-completion-function |
| 119 | tramp-ftp-method | ||
| 120 | '((tramp-parse-netrc "~/.netrc")))) | ||
| 119 | 121 | ||
| 120 | ;; If there is URL syntax, `substitute-in-file-name' needs special | 122 | ;; If there is URL syntax, `substitute-in-file-name' needs special |
| 121 | ;; handling. | 123 | ;; handling. |
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index a25877abe90..4ac523a2a17 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -400,11 +400,13 @@ detected as prompt when being sent on echoing hosts, therefore.") | |||
| 400 | "\\'") | 400 | "\\'") |
| 401 | nil ,(user-login-name))) | 401 | nil ,(user-login-name))) |
| 402 | 402 | ||
| 403 | ;;;###tramp-autoload | ||
| 403 | (defconst tramp-completion-function-alist-rsh | 404 | (defconst tramp-completion-function-alist-rsh |
| 404 | '((tramp-parse-rhosts "/etc/hosts.equiv") | 405 | '((tramp-parse-rhosts "/etc/hosts.equiv") |
| 405 | (tramp-parse-rhosts "~/.rhosts")) | 406 | (tramp-parse-rhosts "~/.rhosts")) |
| 406 | "Default list of (FUNCTION FILE) pairs to be examined for rsh methods.") | 407 | "Default list of (FUNCTION FILE) pairs to be examined for rsh methods.") |
| 407 | 408 | ||
| 409 | ;;;###tramp-autoload | ||
| 408 | (defconst tramp-completion-function-alist-ssh | 410 | (defconst tramp-completion-function-alist-ssh |
| 409 | '((tramp-parse-rhosts "/etc/hosts.equiv") | 411 | '((tramp-parse-rhosts "/etc/hosts.equiv") |
| 410 | (tramp-parse-rhosts "/etc/shosts.equiv") | 412 | (tramp-parse-rhosts "/etc/shosts.equiv") |
| @@ -420,47 +422,60 @@ detected as prompt when being sent on echoing hosts, therefore.") | |||
| 420 | (tramp-parse-sknownhosts "~/.ssh2/knownhosts")) | 422 | (tramp-parse-sknownhosts "~/.ssh2/knownhosts")) |
| 421 | "Default list of (FUNCTION FILE) pairs to be examined for ssh methods.") | 423 | "Default list of (FUNCTION FILE) pairs to be examined for ssh methods.") |
| 422 | 424 | ||
| 425 | ;;;###tramp-autoload | ||
| 423 | (defconst tramp-completion-function-alist-telnet | 426 | (defconst tramp-completion-function-alist-telnet |
| 424 | '((tramp-parse-hosts "/etc/hosts")) | 427 | '((tramp-parse-hosts "/etc/hosts")) |
| 425 | "Default list of (FUNCTION FILE) pairs to be examined for telnet methods.") | 428 | "Default list of (FUNCTION FILE) pairs to be examined for telnet methods.") |
| 426 | 429 | ||
| 430 | ;;;###tramp-autoload | ||
| 427 | (defconst tramp-completion-function-alist-su | 431 | (defconst tramp-completion-function-alist-su |
| 428 | '((tramp-parse-passwd "/etc/passwd")) | 432 | '((tramp-parse-passwd "/etc/passwd")) |
| 429 | "Default list of (FUNCTION FILE) pairs to be examined for su methods.") | 433 | "Default list of (FUNCTION FILE) pairs to be examined for su methods.") |
| 430 | 434 | ||
| 435 | ;;;###tramp-autoload | ||
| 431 | (defconst tramp-completion-function-alist-putty | 436 | (defconst tramp-completion-function-alist-putty |
| 432 | '((tramp-parse-putty | 437 | '((tramp-parse-putty |
| 433 | "HKEY_CURRENT_USER\\Software\\SimonTatham\\PuTTY\\Sessions")) | 438 | "HKEY_CURRENT_USER\\Software\\SimonTatham\\PuTTY\\Sessions")) |
| 434 | "Default list of (FUNCTION REGISTRY) pairs to be examined for putty methods.") | 439 | "Default list of (FUNCTION REGISTRY) pairs to be examined for putty methods.") |
| 435 | 440 | ||
| 436 | (tramp-set-completion-function "rcp" tramp-completion-function-alist-rsh) | 441 | ;;;###tramp-autoload |
| 437 | (tramp-set-completion-function "remcp" tramp-completion-function-alist-rsh) | 442 | (eval-after-load 'tramp |
| 438 | (tramp-set-completion-function "scp" tramp-completion-function-alist-ssh) | 443 | '(progn |
| 439 | (tramp-set-completion-function "scp1" tramp-completion-function-alist-ssh) | 444 | (tramp-set-completion-function "rcp" tramp-completion-function-alist-rsh) |
| 440 | (tramp-set-completion-function "scp2" tramp-completion-function-alist-ssh) | 445 | (tramp-set-completion-function "remcp" tramp-completion-function-alist-rsh) |
| 441 | (tramp-set-completion-function "scpc" tramp-completion-function-alist-ssh) | 446 | (tramp-set-completion-function "scp" tramp-completion-function-alist-ssh) |
| 442 | (tramp-set-completion-function "scpx" tramp-completion-function-alist-ssh) | 447 | (tramp-set-completion-function "scp1" tramp-completion-function-alist-ssh) |
| 443 | (tramp-set-completion-function "sftp" tramp-completion-function-alist-ssh) | 448 | (tramp-set-completion-function "scp2" tramp-completion-function-alist-ssh) |
| 444 | (tramp-set-completion-function "rsync" tramp-completion-function-alist-ssh) | 449 | (tramp-set-completion-function "scpc" tramp-completion-function-alist-ssh) |
| 445 | (tramp-set-completion-function "rsyncc" tramp-completion-function-alist-ssh) | 450 | (tramp-set-completion-function "scpx" tramp-completion-function-alist-ssh) |
| 446 | (tramp-set-completion-function "rsh" tramp-completion-function-alist-rsh) | 451 | (tramp-set-completion-function "sftp" tramp-completion-function-alist-ssh) |
| 447 | (tramp-set-completion-function "remsh" tramp-completion-function-alist-rsh) | 452 | (tramp-set-completion-function "rsync" tramp-completion-function-alist-ssh) |
| 448 | (tramp-set-completion-function "ssh" tramp-completion-function-alist-ssh) | 453 | (tramp-set-completion-function |
| 449 | (tramp-set-completion-function "ssh1" tramp-completion-function-alist-ssh) | 454 | "rsyncc" tramp-completion-function-alist-ssh) |
| 450 | (tramp-set-completion-function "ssh2" tramp-completion-function-alist-ssh) | 455 | (tramp-set-completion-function "rsh" tramp-completion-function-alist-rsh) |
| 451 | (tramp-set-completion-function "ssh1_old" tramp-completion-function-alist-ssh) | 456 | (tramp-set-completion-function "remsh" tramp-completion-function-alist-rsh) |
| 452 | (tramp-set-completion-function "ssh2_old" tramp-completion-function-alist-ssh) | 457 | (tramp-set-completion-function "ssh" tramp-completion-function-alist-ssh) |
| 453 | (tramp-set-completion-function "sshx" tramp-completion-function-alist-ssh) | 458 | (tramp-set-completion-function "ssh1" tramp-completion-function-alist-ssh) |
| 454 | (tramp-set-completion-function "telnet" tramp-completion-function-alist-telnet) | 459 | (tramp-set-completion-function "ssh2" tramp-completion-function-alist-ssh) |
| 455 | (tramp-set-completion-function "su" tramp-completion-function-alist-su) | 460 | (tramp-set-completion-function |
| 456 | (tramp-set-completion-function "sudo" tramp-completion-function-alist-su) | 461 | "ssh1_old" tramp-completion-function-alist-ssh) |
| 457 | (tramp-set-completion-function "ksu" tramp-completion-function-alist-su) | 462 | (tramp-set-completion-function |
| 458 | (tramp-set-completion-function "krlogin" tramp-completion-function-alist-rsh) | 463 | "ssh2_old" tramp-completion-function-alist-ssh) |
| 459 | (tramp-set-completion-function "plink" tramp-completion-function-alist-ssh) | 464 | (tramp-set-completion-function "sshx" tramp-completion-function-alist-ssh) |
| 460 | (tramp-set-completion-function "plink1" tramp-completion-function-alist-ssh) | 465 | (tramp-set-completion-function |
| 461 | (tramp-set-completion-function "plinkx" tramp-completion-function-alist-putty) | 466 | "telnet" tramp-completion-function-alist-telnet) |
| 462 | (tramp-set-completion-function "pscp" tramp-completion-function-alist-ssh) | 467 | (tramp-set-completion-function "su" tramp-completion-function-alist-su) |
| 463 | (tramp-set-completion-function "fcp" tramp-completion-function-alist-ssh) | 468 | (tramp-set-completion-function "sudo" tramp-completion-function-alist-su) |
| 469 | (tramp-set-completion-function "ksu" tramp-completion-function-alist-su) | ||
| 470 | (tramp-set-completion-function | ||
| 471 | "krlogin" tramp-completion-function-alist-rsh) | ||
| 472 | (tramp-set-completion-function "plink" tramp-completion-function-alist-ssh) | ||
| 473 | (tramp-set-completion-function | ||
| 474 | "plink1" tramp-completion-function-alist-ssh) | ||
| 475 | (tramp-set-completion-function | ||
| 476 | "plinkx" tramp-completion-function-alist-putty) | ||
| 477 | (tramp-set-completion-function "pscp" tramp-completion-function-alist-ssh) | ||
| 478 | (tramp-set-completion-function "fcp" tramp-completion-function-alist-ssh))) | ||
| 464 | 479 | ||
| 465 | ;; "getconf PATH" yields: | 480 | ;; "getconf PATH" yields: |
| 466 | ;; HP-UX: /usr/bin:/usr/ccs/bin:/opt/ansic/bin:/opt/langtools/bin:/opt/fortran/bin | 481 | ;; HP-UX: /usr/bin:/usr/ccs/bin:/opt/ansic/bin:/opt/langtools/bin:/opt/fortran/bin |
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index a43e99c1206..eb456298c1a 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el | |||
| @@ -53,9 +53,11 @@ | |||
| 53 | `(,(concat "\\`" tramp-smb-method "\\'") nil nil)) | 53 | `(,(concat "\\`" tramp-smb-method "\\'") nil nil)) |
| 54 | 54 | ||
| 55 | ;; Add completion function for SMB method. | 55 | ;; Add completion function for SMB method. |
| 56 | (tramp-set-completion-function | 56 | ;;;###tramp-autoload |
| 57 | tramp-smb-method | 57 | (eval-after-load 'tramp |
| 58 | '((tramp-parse-netrc "~/.netrc"))) | 58 | '(tramp-set-completion-function |
| 59 | tramp-smb-method | ||
| 60 | '((tramp-parse-netrc "~/.netrc")))) | ||
| 59 | 61 | ||
| 60 | (defcustom tramp-smb-program "smbclient" | 62 | (defcustom tramp-smb-program "smbclient" |
| 61 | "*Name of SMB client to run." | 63 | "*Name of SMB client to run." |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 178f057a66c..8f1095a0486 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -1500,6 +1500,7 @@ letter into the file name. This function removes it." | |||
| 1500 | 1500 | ||
| 1501 | ;;; Config Manipulation Functions: | 1501 | ;;; Config Manipulation Functions: |
| 1502 | 1502 | ||
| 1503 | ;;;###tramp-autoload | ||
| 1503 | (defun tramp-set-completion-function (method function-list) | 1504 | (defun tramp-set-completion-function (method function-list) |
| 1504 | "Sets the list of completion functions for METHOD. | 1505 | "Sets the list of completion functions for METHOD. |
| 1505 | FUNCTION-LIST is a list of entries of the form (FUNCTION FILE). | 1506 | 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." | |||
| 2366 | (unless (zerop (+ (length user) (length host))) | 2367 | (unless (zerop (+ (length user) (length host))) |
| 2367 | (tramp-completion-make-tramp-file-name method user host nil))) | 2368 | (tramp-completion-make-tramp-file-name method user host nil))) |
| 2368 | 2369 | ||
| 2370 | ;;;###tramp-autoload | ||
| 2369 | (defun tramp-parse-rhosts (filename) | 2371 | (defun tramp-parse-rhosts (filename) |
| 2370 | "Return a list of (user host) tuples allowed to access. | 2372 | "Return a list of (user host) tuples allowed to access. |
| 2371 | Either user or host may be nil." | 2373 | Either user or host may be nil." |
| @@ -2396,6 +2398,7 @@ Either user or host may be nil." | |||
| 2396 | (forward-line 1) | 2398 | (forward-line 1) |
| 2397 | result)) | 2399 | result)) |
| 2398 | 2400 | ||
| 2401 | ;;;###tramp-autoload | ||
| 2399 | (defun tramp-parse-shosts (filename) | 2402 | (defun tramp-parse-shosts (filename) |
| 2400 | "Return a list of (user host) tuples allowed to access. | 2403 | "Return a list of (user host) tuples allowed to access. |
| 2401 | User is always nil." | 2404 | User is always nil." |
| @@ -2425,6 +2428,7 @@ User is always nil." | |||
| 2425 | (forward-line 1)) | 2428 | (forward-line 1)) |
| 2426 | result)) | 2429 | result)) |
| 2427 | 2430 | ||
| 2431 | ;;;###tramp-autoload | ||
| 2428 | (defun tramp-parse-sconfig (filename) | 2432 | (defun tramp-parse-sconfig (filename) |
| 2429 | "Return a list of (user host) tuples allowed to access. | 2433 | "Return a list of (user host) tuples allowed to access. |
| 2430 | User is always nil." | 2434 | User is always nil." |
| @@ -2454,6 +2458,7 @@ User is always nil." | |||
| 2454 | (forward-line 1)) | 2458 | (forward-line 1)) |
| 2455 | result)) | 2459 | result)) |
| 2456 | 2460 | ||
| 2461 | ;;;###tramp-autoload | ||
| 2457 | (defun tramp-parse-shostkeys (dirname) | 2462 | (defun tramp-parse-shostkeys (dirname) |
| 2458 | "Return a list of (user host) tuples allowed to access. | 2463 | "Return a list of (user host) tuples allowed to access. |
| 2459 | User is always nil." | 2464 | User is always nil." |
| @@ -2485,6 +2490,7 @@ User is always nil." | |||
| 2485 | (setq files (cdr files))) | 2490 | (setq files (cdr files))) |
| 2486 | result)) | 2491 | result)) |
| 2487 | 2492 | ||
| 2493 | ;;;###tramp-autoload | ||
| 2488 | (defun tramp-parse-hosts (filename) | 2494 | (defun tramp-parse-hosts (filename) |
| 2489 | "Return a list of (user host) tuples allowed to access. | 2495 | "Return a list of (user host) tuples allowed to access. |
| 2490 | User is always nil." | 2496 | User is always nil." |
| @@ -2519,6 +2525,7 @@ User is always nil." | |||
| 2519 | ;; as default. Unfortunately, we have no information whether any user name | 2525 | ;; as default. Unfortunately, we have no information whether any user name |
| 2520 | ;; has been typed already. So we use `tramp-current-user' as indication, | 2526 | ;; has been typed already. So we use `tramp-current-user' as indication, |
| 2521 | ;; assuming it is set in `tramp-completion-handle-file-name-all-completions'. | 2527 | ;; assuming it is set in `tramp-completion-handle-file-name-all-completions'. |
| 2528 | ;;;###tramp-autoload | ||
| 2522 | (defun tramp-parse-passwd (filename) | 2529 | (defun tramp-parse-passwd (filename) |
| 2523 | "Return a list of (user host) tuples allowed to access. | 2530 | "Return a list of (user host) tuples allowed to access. |
| 2524 | Host is always \"localhost\"." | 2531 | Host is always \"localhost\"." |
| @@ -2548,6 +2555,7 @@ Host is always \"localhost\"." | |||
| 2548 | (forward-line 1) | 2555 | (forward-line 1) |
| 2549 | result)) | 2556 | result)) |
| 2550 | 2557 | ||
| 2558 | ;;;###tramp-autoload | ||
| 2551 | (defun tramp-parse-netrc (filename) | 2559 | (defun tramp-parse-netrc (filename) |
| 2552 | "Return a list of (user host) tuples allowed to access. | 2560 | "Return a list of (user host) tuples allowed to access. |
| 2553 | User may be nil." | 2561 | User may be nil." |
| @@ -2578,6 +2586,7 @@ User may be nil." | |||
| 2578 | (forward-line 1) | 2586 | (forward-line 1) |
| 2579 | result)) | 2587 | result)) |
| 2580 | 2588 | ||
| 2589 | ;;;###tramp-autoload | ||
| 2581 | (defun tramp-parse-putty (registry) | 2590 | (defun tramp-parse-putty (registry) |
| 2582 | "Return a list of (user host) tuples allowed to access. | 2591 | "Return a list of (user host) tuples allowed to access. |
| 2583 | User is always nil." | 2592 | User is always nil." |