summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-09-08 10:27:58 +0000
committerRichard M. Stallman <rms@gnu.org>1997-09-08 10:27:58 +0000
commit24a3b48d905ded3074590dc2e29dae1583385a67 (patch)
treed9db0cf5c7e489c9fefd67b4d5094741a2dd07bf
parent55b405c779348dc0216f82d153d0e36933db563c (diff)
downloademacs-24a3b48d905ded3074590dc2e29dae1583385a67.tar.gz
(telnet-initial-filter): Temporarily go to proper buffer.
-rw-r--r--lisp/telnet.el28
1 files changed, 15 insertions, 13 deletions
diff --git a/lisp/telnet.el b/lisp/telnet.el
index 034c0341a6f..caecf8e368d 100644
--- a/lisp/telnet.el
+++ b/lisp/telnet.el
@@ -131,20 +131,22 @@ rejecting one login and prompting again for a username and password.")
(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".