]> code.delx.au - gnu-emacs/blobdiff - lisp/net/tramp.el
* net/dbus.el (dbus-register-property): Use `dont-register' keyword.
[gnu-emacs] / lisp / net / tramp.el
index f7d3b81039eb8b32bbcec4311d359cb53bbf4cb8..c198d9e082d5e3062027568984b6bbf0158065b7 100644 (file)
@@ -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
    "\\`"
@@ -603,6 +606,7 @@ It shall be used in combination with `generate-new-buffer-name'.")
   "File name of a persistent local temporary file.
 Useful for \"rsync\" like methods.")
 (make-variable-buffer-local 'tramp-temp-buffer-file-name)
+(put 'tramp-temp-buffer-file-name 'permanent-local t)
 
 ;; XEmacs is distributed with few Lisp packages.  Further packages are
 ;; installed using EFS.  If we use a unified filename format, then
@@ -665,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.
@@ -2842,8 +2848,8 @@ User is always nil."
                       (t (file-local-copy filename)))))
 
              ;; When the file is not readable for the owner, it
-             ;; cannot be inserted, even it is redable for the group
-             ;; or for everybody.
+             ;; cannot be inserted, even if it is readable for the
+             ;; group or for everybody.
              (set-file-modes local-copy (tramp-compat-octal-to-decimal "0600"))
 
              (when (and (null remote-copy)
@@ -2851,8 +2857,7 @@ User is always nil."
                          method 'tramp-copy-keep-tmpfile))
                ;; We keep the local file for performance reasons,
                ;; useful for "rsync".
-               (setq tramp-temp-buffer-file-name local-copy)
-               (put 'tramp-temp-buffer-file-name 'permanent-local t))
+               (setq tramp-temp-buffer-file-name local-copy))
 
              (with-progress-reporter
                  v 3 (format "Inserting local temp file `%s'" local-copy)
@@ -3077,26 +3082,27 @@ The terminal type can be configured with `tramp-terminal-type'."
   (tramp-compat-with-temp-message ""
     ;; Enable auth-source and password-cache.
     (tramp-set-connection-property vec "first-password-request" t)
-    (let (exit)
-      (while (not exit)
-       (tramp-message proc 3 "Waiting for prompts from remote shell")
-       (setq exit
-             (catch 'tramp-action
-               (if timeout
-                   (with-timeout (timeout)
-                     (tramp-process-one-action proc vec actions))
-                 (tramp-process-one-action proc vec actions)))))
-      (with-current-buffer (tramp-get-connection-buffer vec)
-       (widen)
-       (tramp-message vec 6 "\n%s" (buffer-string)))
-      (unless (eq exit 'ok)
-       (tramp-clear-passwd vec)
-       (tramp-error-with-buffer
-        nil vec 'file-error
-        (cond
-         ((eq exit 'permission-denied) "Permission denied")
-         ((eq exit 'process-died) "Process died")
-         (t "Login failed")))))))
+    (save-restriction
+      (let (exit)
+       (while (not exit)
+         (tramp-message proc 3 "Waiting for prompts from remote shell")
+         (setq exit
+               (catch 'tramp-action
+                 (if timeout
+                     (with-timeout (timeout)
+                       (tramp-process-one-action proc vec actions))
+                   (tramp-process-one-action proc vec actions)))))
+       (with-current-buffer (tramp-get-connection-buffer vec)
+         (widen)
+         (tramp-message vec 6 "\n%s" (buffer-string)))
+       (unless (eq exit 'ok)
+         (tramp-clear-passwd vec)
+         (tramp-error-with-buffer
+          nil vec 'file-error
+          (cond
+           ((eq exit 'permission-denied) "Permission denied")
+           ((eq exit 'process-died) "Process died")
+           (t "Login failed"))))))))
 
 :;; Utility functions: