summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2010-12-10 05:14:57 +0100
committerMichael Albinus <michael.albinus@gmx.de>2010-12-10 05:14:57 +0100
commit158d59456887041e74cf0d8e0fa19bc65e6e4b1f (patch)
tree30244e646d4f3706cf53bf02192ee9443f69875a
parentffda048bfbfd66b55001574703be3aa31231b808 (diff)
downloademacs-158d59456887041e74cf0d8e0fa19bc65e6e4b1f.tar.gz
* net/tramp.el (tramp-action-password, tramp-process-actions):
Revert patch from 2010-12-08. Use `save-restriction'.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/net/tramp.el45
2 files changed, 28 insertions, 22 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8184473d035..55206c2c8ba 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2010-12-10 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-action-password, tramp-process-actions):
+ Revert patch from 2010-12-08. Use `save-restriction'.
+
2010-12-09 Eli Zaretskii <eliz@gnu.org>
* menu-bar.el (menu-bar-frame-for-menubar, menu-bar-positive-p):
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 0b7bae67082..babcc2ca250 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -6712,10 +6712,9 @@ file exists and nonzero exit status otherwise."
(with-current-buffer (process-buffer proc)
(tramp-check-for-regexp proc tramp-password-prompt-regexp)
(tramp-message vec 3 "Sending %s" (match-string 1))
- (tramp-message vec 6 "\n%s" (buffer-string)))
(tramp-enter-password proc)
- ;; Remove password prompt, in order not to find it next iteration.
- (delete-region (point-min) (point-max)))
+ ;; Hide password prompt.
+ (narrow-to-region (point-max) (point-max))))
(defun tramp-action-succeed (proc vec)
"Signal success in finding shell prompt."
@@ -6816,25 +6815,27 @@ The terminal type can be configured with `tramp-terminal-type'."
(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)
- (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.