
(defvar telnet-new-line "

(defvar telnet-mode-map nil)

(defvar telnet-prompt-pattern "^[^#$%>]*[#$%>] *")

(defvar telnet-interrupt-string "" "\
String sent by C-c.")

(defvar telnet-count 0)

(defvar telnet-replace-c-g nil)

(defvar telnet-remote-echoes nil)

(defun telnet-interrupt-subjob nil (interactive) (byte-code "?^AA	\"+" [nil telnet-interrupt-string "Interrupt the program running through telnet on the remote host." send-string] 3))

(defun telnet-c-z nil (interactive) (byte-code "?AAA\"+" [nil send-string ""] 3))

(defun send-process-next-char nil (interactive) (byte-code "?AAAAr?^)!\"+" [nil inhibit-quit t quit-flag send-string char-to-string] 6))

(setq telnet-mode-map (make-sparse-keymap))

(progn (define-key telnet-mode-map "
" (quote telnet-send-input)) (define-key telnet-mode-map "" (quote shell-send-eof)) (define-key telnet-mode-map "" (quote send-process-next-char)) (define-key telnet-mode-map "" (quote telnet-interrupt-subjob)) (define-key telnet-mode-map "" (quote telnet-c-z)) (define-key telnet-mode-map "" (quote kill-shell-input)) (define-key telnet-mode-map "" (quote backward-kill-word)) (define-key telnet-mode-map "" (quote kill-output-from-shell)) (define-key telnet-mode-map "" (quote show-output-from-shell)))

(defun telnet-check-software-type-initialize (string) "\
Tries to put correct initializations in.  Needs work." (byte-code "AA\"f
%^?,5
" "tops-20" "[@>]*" "its" "^[^*>]*[*>] *" "explorer" 10] 6))

(defun telnet-initial-filter (proc string) (byte-code "CE\"f

(defun telnet-filter (proc string) (byte-code "SC!q^db^`
c^E	`EE$^.

(defun delete-char-or-send-eof (arg killp) "\
At end of buffer, send eof to subshell.  Otherwise delete character." (interactive "p
P") (byte-code "^m.

(defun telnet-send-input nil "\
Send input to remote host
At end of buffer, sends all text after last output
as input to the telnet, including a telnet-new-line inserted at the end.
Not at end, copies current line to the end of the buffer and sends it,
after first attempting to discard any prompt at the beginning of the line
by matching the regexp that is the value of telnet-prompt-pattern if possible." (interactive) (byte-code "?AE ^mf
`\",C
`\")^S	b^Ip!O	
#^?._

(defun telnet (arg) "\
Open a network login connection to host named HOST (a string).
Communication with HOST is recorded in a buffer *HOST-telnet*.
Normally input is edited in Emacs and sent a line at a time." (interactive "sOpen telnet connection to host: ") (byte-code "EAA!^	APCEE\"!^EE!I\"^IE!!^I ^ID	NQ\"^O ^?)+" [name arg telnet-count nil require shell "-telnet" switch-to-buffer make-shell "telnet" set-process-filter get-process telnet-initial-filter accept-process-output erase-buffer send-string "open " "
" telnet-mode -16] 13))

(defun read-password nil (byte-code "AAr%A>?E^.

(defun telnet-mode nil "\
This mode is for use during telnet from a buffer to another
host. It has most of the same commands as shell mode.
There is a variable `telnet-interrupt-string' which is the character
sent to try to stop execution of a job on the remote host.
Data is sent to the remote host when `return' is typed.
Thus if you may need to edit the data before sending you
should use c-n to move down a line.  Then you can return
to alter a previous line.  Of course you should not use this
mode of telnet if you want to run emacs like programs on the
remote host (at least not yet!).

The following commands imitate the usual Unix interrupt and
editing control characters:
\\{telnet-mode-map}

Bugs:
--Replace 
--For Unix interacts poorly with tcsh although csh,sh,ksh are ok." (interactive) (byte-code "?I ^?^?^?^OE!^O!^
^OI!^?+" [major-mode mode-name mode-line-process telnet-mode-map tem telnet-prompt-pattern telnet-interrupt-string telnet-new-line last-input-start last-input-end telnet-remote-echoes t telnet-replace-c-g nil kill-all-local-variables telnet-mode "Telnet" (": %s") make-local-variable use-local-map "" "
.
