(require 'comint)
-(defvar telnet-host-properties
+(defvar telnet-host-properties ()
"Specify which telnet program to use for particular hosts.
Each element has the form (HOSTNAME PROGRAM [LOGIN-NAME])
HOSTNAME says which machine the element applies to.
(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))
+ (clear-this-command-keys))
+ (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".
(ws (and w (window-start w))))
(goto-char last-insertion)
(insert-before-markers string)
+ (set-marker comint-last-output-start last-insertion)
(set-marker (process-mark proc) (point))
(if ws (set-window-start w ws t))
(if ie (set-marker comint-last-input-end ie))