]> git.eshelyaron.com Git - emacs.git/commitdiff
* net/tramp.el (tramp-ssh-controlmaster-template): Make it a
authorMichael Albinus <michael.albinus@gmx.de>
Thu, 21 Feb 2013 14:23:12 +0000 (15:23 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Thu, 21 Feb 2013 14:23:12 +0000 (15:23 +0100)
defconst.  Apply independent check for ControlPersist.

lisp/ChangeLog
lisp/net/tramp.el

index 9ecf7ebddd7ec0533881cc859cc4f5bda91b934e..4210740791f5dc395dcd1e575af215306a657b31 100644 (file)
@@ -1,5 +1,8 @@
 2013-02-21  Michael Albinus  <michael.albinus@gmx.de>
 
+       * net/tramp.el (tramp-ssh-controlmaster-template): Make it a
+       defconst.  Apply independent check for ControlPersist.
+
        * net/tramp-sh.el (tramp-sh-handle-set-file-times): Set $UTC only
        temporarily, via "env".
 
index 89648b0e9a91cf9020d12555cfbeaaa40c4510c9..5305484e9209ed12ed35a389c74fc90b3a03c156 100644 (file)
@@ -281,16 +281,24 @@ started on the local host.  You should specify a remote host
 useful only in combination with `tramp-default-proxies-alist'.")
 
 ;;;###tramp-autoload
-(defvar tramp-ssh-controlmaster-template
+(defconst tramp-ssh-controlmaster-template
+  (let (result)
     (ignore-errors
       (with-temp-buffer
        (call-process "ssh" nil t nil "-o" "ControlMaster")
        (goto-char (point-min))
        (when (search-forward-regexp "Missing ControlMaster argument" nil t)
-         '("-o" "ControlPath=%t.%%r@%%h:%%p"
-           "-o" "ControlMaster=auto"
-           "-o" "ControlPersist=no"))))
-    "Call ssh to detect whether it supports the ControlMaster argument.
+         (setq result
+               '("-o" "ControlPath=%t.%%r@%%h:%%p"
+                 "-o" "ControlMaster=auto"))))
+      (when result
+       (with-temp-buffer
+         (call-process "ssh" nil t nil "-o" "ControlPersist")
+         (goto-char (point-min))
+         (when (search-forward-regexp "Missing ControlPersist argument" nil t)
+           (setq result (append result '("-o" "ControlPersist=no")))))))
+    result)
+    "Call ssh to detect whether it supports the Control* arguments.
 Return a template to be used in `tramp-methods'.")
 
 (defcustom tramp-default-method