From: Michael Albinus Date: Wed, 30 Jan 2013 09:16:16 +0000 (+0100) Subject: * net/tramp.el (tramp-process-connection-type): Fix docstring. X-Git-Tag: emacs-24.3.90~173^2~7^2~199 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8bc8712eddbac53649ce3b5b0d1ce5852bca394f;p=emacs.git * net/tramp.el (tramp-process-connection-type): Fix docstring. (tramp-completion-reread-directory-timeout): Fix type. (tramp-connection-min-time-diff): New defcustom. * net/tramp-sh.el (tramp-maybe-open-connection): Use it. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d4a0fe6782e..348df715c70 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2013-01-30 Michael Albinus + + * net/tramp.el (tramp-process-connection-type): Fix docstring. + (tramp-completion-reread-directory-timeout): Fix type. + (tramp-connection-min-time-diff): New defcustom. + + * net/tramp-sh.el (tramp-maybe-open-connection): Use it. + 2013-01-30 Glenn Morris * imenu.el (imenu-default-create-index-function): diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 63e966b91b2..a06d64d400a 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -4357,7 +4357,7 @@ connection if a previous connection has died for some reason." (car tramp-current-connection))) (> (tramp-time-diff (current-time) (cdr tramp-current-connection)) - 5)) + (or tramp-connection-min-time-diff 0))) (throw 'suppress 'suppress)) ;; If too much time has passed since last command was sent, look diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 045304cbc4f..ea3b5d56a38 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1018,11 +1018,25 @@ this variable to be set as well." ;; for an override of the system default. (defcustom tramp-process-connection-type t "Overrides `process-connection-type' for connections from Tramp. -Tramp binds process-connection-type to the value given here before +Tramp binds `process-connection-type' to the value given here before opening a connection to a remote host." :group 'tramp :type '(choice (const nil) (const t) (const pty))) +(defcustom tramp-connection-min-time-diff 5 + "Defines seconds between two consecutive connection attempts. +This is necessary as self defense mechanism, in order to avoid +yo-yo connection attempts when the remote host is unavailable. + +A value of 0 or `nil' suppresses this check. This might be +necessary, when several out-of-order copy operations are +performed, or when several asynchronous processes will be started +in a short time frame. In those cases it is recommended to +let-bind this variable." + :group 'tramp + :version "24.4" + :type '(choice (const nil) integer)) + (defcustom tramp-completion-reread-directory-timeout 10 "Defines seconds since last remote command before rereading a directory. A remote directory might have changed its contents. In order to @@ -1033,7 +1047,7 @@ have been gone since last remote command execution. A value of `t' would require an immediate reread during filename completion, `nil' means to use always cached values for the directory contents." :group 'tramp - :type '(choice (const nil) integer)) + :type '(choice (const nil) (const t) integer)) ;;; Internal Variables: