aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2011-04-25 20:10:17 +0200
committerMichael Albinus2011-04-25 20:10:17 +0200
commitbfd31217eac63c0b8a5470f67af9a733713ee126 (patch)
tree31268f6e8bc1ed380521c5f8c3039febf1ba7274
parent850256b5e9fa9f03008b843e58b1b338d86877f5 (diff)
downloademacs-bfd31217eac63c0b8a5470f67af9a733713ee126.tar.gz
emacs-bfd31217eac63c0b8a5470f67af9a733713ee126.zip
* net/tramp.el (tramp-process-actions): Add POS argument. Delete
region between POS and (pos). * net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band): Use `nil' position in `tramp-process-actions' call. (tramp-maybe-open-connection): Call `tramp-process-actions' with pos. * net/tramp-smb.el (tramp-smb-maybe-open-connection): Use `nil' position in `tramp-process-actions' call. * net/trampver.el: Update release number.
-rw-r--r--lisp/ChangeLog14
-rw-r--r--lisp/net/tramp-sh.el8
-rw-r--r--lisp/net/tramp-smb.el2
-rw-r--r--lisp/net/tramp.el12
-rw-r--r--lisp/net/trampver.el4
5 files changed, 31 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 13c6bfa2d4c..34e2cc4f56e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,17 @@
12011-04-25 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/tramp.el (tramp-process-actions): Add POS argument. Delete
4 region between POS and (pos).
5
6 * net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band): Use
7 `nil' position in `tramp-process-actions' call.
8 (tramp-maybe-open-connection): Call `tramp-process-actions' with pos.
9
10 * net/tramp-smb.el (tramp-smb-maybe-open-connection): Use `nil'
11 position in `tramp-process-actions' call.
12
13 * net/trampver.el: Update release number.
14
12011-04-25 Stefan Monnier <monnier@iro.umontreal.ca> 152011-04-25 Stefan Monnier <monnier@iro.umontreal.ca>
2 16
3 * custom.el (defcustom): Obey lexical-binding. 17 * custom.el (defcustom): Obey lexical-binding.
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index cb4aca12edb..81e955ebbf8 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -2336,7 +2336,8 @@ The method used must be an out-of-band method."
2336 orig-vec 6 "%s" 2336 orig-vec 6 "%s"
2337 (mapconcat 'identity (process-command p) " ")) 2337 (mapconcat 'identity (process-command p) " "))
2338 (tramp-compat-set-process-query-on-exit-flag p nil) 2338 (tramp-compat-set-process-query-on-exit-flag p nil)
2339 (tramp-process-actions p v tramp-actions-copy-out-of-band))) 2339 (tramp-process-actions
2340 p v nil tramp-actions-copy-out-of-band)))
2340 2341
2341 ;; Reset the transfer process properties. 2342 ;; Reset the transfer process properties.
2342 (tramp-message orig-vec 6 "%s" (buffer-string)) 2343 (tramp-message orig-vec 6 "%s" (buffer-string))
@@ -4212,7 +4213,8 @@ connection if a previous connection has died for some reason."
4212 (catch 'uname-changed 4213 (catch 'uname-changed
4213 (let ((p (tramp-get-connection-process vec)) 4214 (let ((p (tramp-get-connection-process vec))
4214 (process-name (tramp-get-connection-property vec "process-name" nil)) 4215 (process-name (tramp-get-connection-property vec "process-name" nil))
4215 (process-environment (copy-sequence process-environment))) 4216 (process-environment (copy-sequence process-environment))
4217 (pos (with-current-buffer (tramp-get-connection-buffer vec) (point))))
4216 4218
4217 ;; If too much time has passed since last command was sent, look 4219 ;; If too much time has passed since last command was sent, look
4218 ;; whether process is still alive. If it isn't, kill it. When 4220 ;; whether process is still alive. If it isn't, kill it. When
@@ -4366,7 +4368,7 @@ connection if a previous connection has died for some reason."
4366 ;; Send the command. 4368 ;; Send the command.
4367 (tramp-message vec 3 "Sending command `%s'" command) 4369 (tramp-message vec 3 "Sending command `%s'" command)
4368 (tramp-send-command vec command t t) 4370 (tramp-send-command vec command t t)
4369 (tramp-process-actions p vec tramp-actions-before-shell 60) 4371 (tramp-process-actions p vec pos tramp-actions-before-shell 60)
4370 (tramp-message 4372 (tramp-message
4371 vec 3 "Found remote shell prompt on `%s'" l-host)) 4373 vec 3 "Found remote shell prompt on `%s'" l-host))
4372 ;; Next hop. 4374 ;; Next hop.
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 36477f7b439..5a62b71bda1 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -1314,7 +1314,7 @@ connection if a previous connection has died for some reason."
1314 1314
1315 ;; Play login scenario. 1315 ;; Play login scenario.
1316 (tramp-process-actions 1316 (tramp-process-actions
1317 p vec 1317 p vec nil
1318 (if share 1318 (if share
1319 tramp-smb-actions-with-share 1319 tramp-smb-actions-with-share
1320 tramp-smb-actions-without-share)) 1320 tramp-smb-actions-without-share))
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index fc167d6e62e..693e082ecc8 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3098,8 +3098,11 @@ The terminal type can be configured with `tramp-terminal-type'."
3098 (setq found (funcall action proc vec))))) 3098 (setq found (funcall action proc vec)))))
3099 found)) 3099 found))
3100 3100
3101(defun tramp-process-actions (proc vec actions &optional timeout) 3101(defun tramp-process-actions (proc vec pos actions &optional timeout)
3102 "Perform actions until success or TIMEOUT." 3102 "Perform ACTIONS until success or TIMEOUT.
3103PROC and VEC indicate the remote connection to be used. POS, if
3104set, is the starting point of the region to be deleted in the
3105connection buffer."
3103 ;; Preserve message for `progress-reporter'. 3106 ;; Preserve message for `progress-reporter'.
3104 (tramp-compat-with-temp-message "" 3107 (tramp-compat-with-temp-message ""
3105 ;; Enable auth-source and password-cache. 3108 ;; Enable auth-source and password-cache.
@@ -3124,7 +3127,10 @@ The terminal type can be configured with `tramp-terminal-type'."
3124 (cond 3127 (cond
3125 ((eq exit 'permission-denied) "Permission denied") 3128 ((eq exit 'permission-denied) "Permission denied")
3126 ((eq exit 'process-died) "Process died") 3129 ((eq exit 'process-died) "Process died")
3127 (t "Login failed")))))))) 3130 (t "Login failed"))))
3131 (when (numberp pos)
3132 (with-current-buffer (tramp-get-connection-buffer vec)
3133 (let (buffer-read-only) (delete-region pos (point)))))))))
3128 3134
3129:;; Utility functions: 3135:;; Utility functions:
3130 3136
diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el
index 462b8f11397..7b4c6fd75b1 100644
--- a/lisp/net/trampver.el
+++ b/lisp/net/trampver.el
@@ -31,7 +31,7 @@
31;; should be changed only there. 31;; should be changed only there.
32 32
33;;;###tramp-autoload 33;;;###tramp-autoload
34(defconst tramp-version "2.2.1" 34(defconst tramp-version "2.2.2-pre"
35 "This version of Tramp.") 35 "This version of Tramp.")
36 36
37;;;###tramp-autoload 37;;;###tramp-autoload
@@ -44,7 +44,7 @@
44 (= emacs-major-version 21) 44 (= emacs-major-version 21)
45 (>= emacs-minor-version 4))) 45 (>= emacs-minor-version 4)))
46 "ok" 46 "ok"
47 (format "Tramp 2.2.1 is not fit for %s" 47 (format "Tramp 2.2.2-pre is not fit for %s"
48 (when (string-match "^.*$" (emacs-version)) 48 (when (string-match "^.*$" (emacs-version))
49 (match-string 0 (emacs-version))))))) 49 (match-string 0 (emacs-version)))))))
50 (unless (string-match "\\`ok\\'" x) (error "%s" x))) 50 (unless (string-match "\\`ok\\'" x) (error "%s" x)))