emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-23 r100295: * net/tramp.el (tramp-act


From: Michael Albinus
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-23 r100295: * net/tramp.el (tramp-action-password, tramp-process-actions):
Date: Fri, 10 Dec 2010 05:14:57 +0100
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100295
committer: Michael Albinus <address@hidden>
branch nick: emacs-23
timestamp: Fri 2010-12-10 05:14:57 +0100
message:
  * net/tramp.el (tramp-action-password, tramp-process-actions):
  Revert patch from 2010-12-08.  Use `save-restriction'.
modified:
  lisp/ChangeLog
  lisp/net/tramp.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-12-09 18:53:17 +0000
+++ b/lisp/ChangeLog    2010-12-10 04:14:57 +0000
@@ -1,3 +1,8 @@
+2010-12-10  Michael Albinus  <address@hidden>
+
+       * net/tramp.el (tramp-action-password, tramp-process-actions):
+       Revert patch from 2010-12-08.  Use `save-restriction'.
+
 2010-12-09  Eli Zaretskii  <address@hidden>
 
        * menu-bar.el (menu-bar-frame-for-menubar, menu-bar-positive-p):

=== modified file 'lisp/net/tramp.el'
--- a/lisp/net/tramp.el 2010-12-08 20:07:25 +0000
+++ b/lisp/net/tramp.el 2010-12-10 04:14:57 +0000
@@ -6712,10 +6712,9 @@
   (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 @@
   (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.
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]