From b191c9d952321d72a39937847eabb8ff492cbde0 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Thu, 30 Dec 2010 10:04:15 +0100 Subject: [PATCH] * net/tramp.el (tramp-default-method-alist) (tramp-default-user-alist) (tramp-local-host-regexp, tramp-prefix-domain-format) (tramp-prefix-domain-regexp): Set tramp-autoload cookie. * net/tramp-ftp.el: * net/tramp-gvfs.el: * net/tramp-gw.el: * net/tramp-imap.el: * net/tramp-sh.el: * net/tramp-smb.el: Add tramp-autoload cookie for initialisation code of `tramp-default-method-alist' and `tramp-default-user-alist'. --- lisp/ChangeLog | 15 +++++++++++++++ lisp/net/tramp-ftp.el | 12 ++++++------ lisp/net/tramp-gvfs.el | 1 + lisp/net/tramp-gw.el | 1 + lisp/net/tramp-imap.el | 1 + lisp/net/tramp-sh.el | 3 +++ lisp/net/tramp-smb.el | 2 ++ lisp/net/tramp.el | 5 +++++ 8 files changed, 34 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3e9a7d09647..85a2b2114ec 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,18 @@ +2010-12-30 Michael Albinus + + * net/tramp.el (tramp-default-method-alist) + (tramp-default-user-alist) + (tramp-local-host-regexp, tramp-prefix-domain-format) + (tramp-prefix-domain-regexp): Set tramp-autoload cookie. + + * net/tramp-ftp.el: + * net/tramp-gvfs.el: + * net/tramp-gw.el: + * net/tramp-imap.el: + * net/tramp-sh.el: + * net/tramp-smb.el: Add tramp-autoload cookie for initialisation + code of `tramp-default-method-alist' and `tramp-default-user-alist'. + 2010-12-29 Karl Fogel * saveplace.el (save-place-alist-to-file): Save list sorted and diff --git a/lisp/net/tramp-ftp.el b/lisp/net/tramp-ftp.el index a0db0199412..b6a3cffa211 100644 --- a/lisp/net/tramp-ftp.el +++ b/lisp/net/tramp-ftp.el @@ -105,13 +105,13 @@ present for backward compatibility." ;; ... and add it to the method list. ;;;###tramp-autoload (unless (featurep 'xemacs) - (add-to-list 'tramp-methods (cons tramp-ftp-method nil))) + (add-to-list 'tramp-methods (cons tramp-ftp-method nil)) -;; Add some defaults for `tramp-default-method-alist'. -(add-to-list 'tramp-default-method-alist - (list "\\`ftp\\." nil tramp-ftp-method)) -(add-to-list 'tramp-default-method-alist - (list nil "\\`\\(anonymous\\|ftp\\)\\'" tramp-ftp-method)) + ;; Add some defaults for `tramp-default-method-alist'. + (add-to-list 'tramp-default-method-alist + (list "\\`ftp\\." nil tramp-ftp-method)) + (add-to-list 'tramp-default-method-alist + (list nil "\\`\\(anonymous\\|ftp\\)\\'" tramp-ftp-method))) ;; Add completion function for FTP method. (tramp-set-completion-function diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index a87b58a42c2..0fb14657f94 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -124,6 +124,7 @@ ;; Add a default for `tramp-default-user-alist'. Rule: For the SYNCE ;; method, no user is chosen. +;;;###tramp-autoload (add-to-list 'tramp-default-user-alist '("\\`synce\\'" nil nil)) (defcustom tramp-gvfs-zeroconf-domain "local" diff --git a/lisp/net/tramp-gw.el b/lisp/net/tramp-gw.el index 0fac3935d73..543e4277d06 100644 --- a/lisp/net/tramp-gw.el +++ b/lisp/net/tramp-gw.el @@ -72,6 +72,7 @@ (list "Default server" "socks" tramp-gw-default-socks-port 5)) ;; Add a default for `tramp-default-user-alist'. Default is the local user. +;;;###tramp-autoload (add-to-list 'tramp-default-user-alist (list (concat "\\`" diff --git a/lisp/net/tramp-imap.el b/lisp/net/tramp-imap.el index d71583bcd85..e4490019531 100644 --- a/lisp/net/tramp-imap.el +++ b/lisp/net/tramp-imap.el @@ -96,6 +96,7 @@ (list tramp-imaps-method '(tramp-default-port 993)))) ;; Add a default for `tramp-default-user-alist'. Default is the local user. +;;;###tramp-autoload (add-to-list 'tramp-default-user-alist (list (concat "\\`" diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index d5fa4eb76e8..86948bbc69b 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -380,13 +380,16 @@ detected as prompt when being sent on echoing hosts, therefore.") (tramp-copy-args (("%k" "-p"))) (tramp-copy-keep-date t))) +;;;###tramp-autoload (add-to-list 'tramp-default-method-alist `(,tramp-local-host-regexp "\\`root\\'" "su")) +;;;###tramp-autoload (add-to-list 'tramp-default-user-alist `(,(concat "\\`" (regexp-opt '("su" "sudo" "ksu")) "\\'") nil "root")) ;; Do not add "ssh" based methods, otherwise ~/.ssh/config would be ignored. +;;;###tramp-autoload (add-to-list 'tramp-default-user-alist `(,(concat "\\`" diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index b54bbf1fa56..0c1a1f8dcf4 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -43,11 +43,13 @@ ;; Add a default for `tramp-default-method-alist'. Rule: If there is ;; a domain in USER, it must be the SMB method. +;;;###tramp-autoload (add-to-list 'tramp-default-method-alist `(nil ,tramp-prefix-domain-regexp ,tramp-smb-method)) ;; Add a default for `tramp-default-user-alist'. Rule: For the SMB method, ;; the anonymous user is chosen. +;;;###tramp-autoload (add-to-list 'tramp-default-user-alist `(,(concat "\\`" tramp-smb-method "\\'") nil nil)) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 79f184efc25..c198d9e082d 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -318,6 +318,7 @@ Also see `tramp-default-method-alist'." :group 'tramp :type 'string) +;;;###tramp-autoload (defcustom tramp-default-method-alist nil "*Default method to use for specific host/user pairs. This is an alist of items (HOST USER METHOD). The first matching item @@ -344,6 +345,7 @@ This variable is regarded as obsolete, and will be removed soon." :group 'tramp :type '(choice (const nil) string)) +;;;###tramp-autoload (defcustom tramp-default-user-alist nil "*Default user to use for specific method/host pairs. This is an alist of items (METHOD HOST USER). The first matching item @@ -384,6 +386,7 @@ interpreted as a regular expression which always matches." (choice :tag "User regexp" regexp sexp) (choice :tag " Proxy name" string (const nil))))) +;;;###tramp-autoload (defconst tramp-local-host-regexp (concat "\\`" @@ -666,9 +669,11 @@ Derived from `tramp-postfix-method-format'.") (defconst tramp-user-regexp "[^:/ \t]+" "*Regexp matching user names.") +;;;###tramp-autoload (defconst tramp-prefix-domain-format "%" "*String matching delimeter between user and domain names.") +;;;###tramp-autoload (defconst tramp-prefix-domain-regexp (regexp-quote tramp-prefix-domain-format) "*Regexp matching delimeter between user and domain names. -- 2.39.5