changeset 19817:2b1a8f775e09

(telnet-initial-filter): Temporarily go to proper buffer.
author Richard M. Stallman <rms@gnu.org>
date Mon, 08 Sep 1997 10:27:58 +0000
parents 902043a3c18a
children 0db6ba06cd1c
files lisp/telnet.el
diffstat 1 files changed, 15 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/telnet.el	Mon Sep 08 10:09:15 1997 +0000
+++ b/lisp/telnet.el	Mon Sep 08 10:27:58 1997 +0000
@@ -131,20 +131,22 @@
 
 (defun telnet-initial-filter (proc string)
   ;For reading up to and including password; also will get machine type.
-  (let ((case-fold-search t))
-    (cond ((string-match "No such host" string)
-	   (kill-buffer (process-buffer proc))
-	   (error "No such host"))
-	  ((string-match "passw" string)
-	   (telnet-filter proc string)
-	   (setq telnet-count 0)
-	   (send-string proc (concat (comint-read-noecho "Password: " t)
-				     telnet-new-line)))
-	  (t (telnet-check-software-type-initialize string)
+  (save-current-buffer
+    (set-buffer (process-buffer proc))
+    (let ((case-fold-search t))
+      (cond ((string-match "No such host" string)
+	     (kill-buffer (process-buffer proc))
+	     (error "No such host"))
+	    ((string-match "passw" string)
 	     (telnet-filter proc string)
-	     (cond ((> telnet-count telnet-maximum-count)
-		    (set-process-filter proc 'telnet-filter))
-		   (t (setq telnet-count (1+ telnet-count))))))))
+	     (setq telnet-count 0)
+	     (send-string proc (concat (comint-read-noecho "Password: " t)
+				       telnet-new-line)))
+	    (t (telnet-check-software-type-initialize string)
+	       (telnet-filter proc string)
+	       (cond ((> telnet-count telnet-maximum-count)
+		      (set-process-filter proc 'telnet-filter))
+		     (t (setq telnet-count (1+ telnet-count)))))))))
 
 ;; Identical to comint-simple-send, except that it sends telnet-new-line
 ;; instead of "\n".