comparison lisp/telnet.el @ 6738:91a5e1cd14c7

(telnet-initial-filter, read-password): Don't unnecessarily duplicate comint functionality.
author Karl Heuer <kwzh@gnu.org>
date Fri, 08 Apr 1994 00:18:37 +0000
parents 33dec33f382d
children cc7cd83ccf3f
comparison
equal deleted inserted replaced
6737:a3ef1108b7ff 6738:91a5e1cd14c7
125 (cond ((string-match "No such host" string) 125 (cond ((string-match "No such host" string)
126 (kill-buffer (process-buffer proc)) 126 (kill-buffer (process-buffer proc))
127 (error "No such host.")) 127 (error "No such host."))
128 ((string-match "passw" string) 128 ((string-match "passw" string)
129 (telnet-filter proc string) 129 (telnet-filter proc string)
130 (let* ((echo-keystrokes 0) 130 (setq telnet-count 0)
131 (password (read-password))) 131 (send-string proc (concat (comint-read-noecho "Password: " t)
132 (setq telnet-count 0) 132 telnet-new-line)))
133 (send-string proc (concat password telnet-new-line))))
134 (t (telnet-check-software-type-initialize string) 133 (t (telnet-check-software-type-initialize string)
135 (telnet-filter proc string) 134 (telnet-filter proc string)
136 (cond ((> telnet-count telnet-maximum-count) 135 (cond ((> telnet-count telnet-maximum-count)
137 (set-process-filter proc 'telnet-filter)) 136 (set-process-filter proc 'telnet-filter))
138 (t (setq telnet-count (1+ telnet-count))))))) 137 (t (setq telnet-count (1+ telnet-count)))))))
226 (switch-to-buffer (make-comint name telnet-rsh-program nil host)) 225 (switch-to-buffer (make-comint name telnet-rsh-program nil host))
227 (set-process-filter (get-process name) 'telnet-initial-filter) 226 (set-process-filter (get-process name) 'telnet-initial-filter)
228 (telnet-mode) 227 (telnet-mode)
229 (setq telnet-count -16))) 228 (setq telnet-count -16)))
230 229
231 (defun read-password ()
232 (let ((answ "") tem)
233 (message "Reading password...")
234 (while (prog1 (not (memq (setq tem (read-char)) '(?\C-m ?\n ?\C-g)))
235 (setq quit-flag nil))
236 (setq answ (concat answ (char-to-string tem))))
237 answ))
238
239 (provide 'telnet) 230 (provide 'telnet)
240 231
241 ;;; telnet.el ends here 232 ;;; telnet.el ends here