diff options
| author | Michael Albinus | 2013-02-21 15:23:12 +0100 |
|---|---|---|
| committer | Michael Albinus | 2013-02-21 15:23:12 +0100 |
| commit | d20e6e9093f74ce2e435a3dac948df200e767405 (patch) | |
| tree | 2c95f1db937851ae229fec83ffe19b5982ac9d11 | |
| parent | 886bae77f01a92cb2f40425197e48ea40582c1be (diff) | |
| download | emacs-d20e6e9093f74ce2e435a3dac948df200e767405.tar.gz emacs-d20e6e9093f74ce2e435a3dac948df200e767405.zip | |
* net/tramp.el (tramp-ssh-controlmaster-template): Make it a
defconst. Apply independent check for ControlPersist.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 18 |
2 files changed, 16 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9ecf7ebddd7..4210740791f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2013-02-21 Michael Albinus <michael.albinus@gmx.de> | 1 | 2013-02-21 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 2 | ||
| 3 | * net/tramp.el (tramp-ssh-controlmaster-template): Make it a | ||
| 4 | defconst. Apply independent check for ControlPersist. | ||
| 5 | |||
| 3 | * net/tramp-sh.el (tramp-sh-handle-set-file-times): Set $UTC only | 6 | * net/tramp-sh.el (tramp-sh-handle-set-file-times): Set $UTC only |
| 4 | temporarily, via "env". | 7 | temporarily, via "env". |
| 5 | 8 | ||
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 89648b0e9a9..5305484e920 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -281,16 +281,24 @@ started on the local host. You should specify a remote host | |||
| 281 | useful only in combination with `tramp-default-proxies-alist'.") | 281 | useful only in combination with `tramp-default-proxies-alist'.") |
| 282 | 282 | ||
| 283 | ;;;###tramp-autoload | 283 | ;;;###tramp-autoload |
| 284 | (defvar tramp-ssh-controlmaster-template | 284 | (defconst tramp-ssh-controlmaster-template |
| 285 | (let (result) | ||
| 285 | (ignore-errors | 286 | (ignore-errors |
| 286 | (with-temp-buffer | 287 | (with-temp-buffer |
| 287 | (call-process "ssh" nil t nil "-o" "ControlMaster") | 288 | (call-process "ssh" nil t nil "-o" "ControlMaster") |
| 288 | (goto-char (point-min)) | 289 | (goto-char (point-min)) |
| 289 | (when (search-forward-regexp "Missing ControlMaster argument" nil t) | 290 | (when (search-forward-regexp "Missing ControlMaster argument" nil t) |
| 290 | '("-o" "ControlPath=%t.%%r@%%h:%%p" | 291 | (setq result |
| 291 | "-o" "ControlMaster=auto" | 292 | '("-o" "ControlPath=%t.%%r@%%h:%%p" |
| 292 | "-o" "ControlPersist=no")))) | 293 | "-o" "ControlMaster=auto")))) |
| 293 | "Call ssh to detect whether it supports the ControlMaster argument. | 294 | (when result |
| 295 | (with-temp-buffer | ||
| 296 | (call-process "ssh" nil t nil "-o" "ControlPersist") | ||
| 297 | (goto-char (point-min)) | ||
| 298 | (when (search-forward-regexp "Missing ControlPersist argument" nil t) | ||
| 299 | (setq result (append result '("-o" "ControlPersist=no"))))))) | ||
| 300 | result) | ||
| 301 | "Call ssh to detect whether it supports the Control* arguments. | ||
| 294 | Return a template to be used in `tramp-methods'.") | 302 | Return a template to be used in `tramp-methods'.") |
| 295 | 303 | ||
| 296 | (defcustom tramp-default-method | 304 | (defcustom tramp-default-method |