comparison lisp/net/telnet.el @ 55569:36845b719feb

(telnet-mode): Use define-derived-mode. Don't modify the global value of comint-prompt-regexp.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 13 May 2004 14:30:22 +0000
parents 8a79e0869c62
children df55e63482c4 4c90ffeb71c5
comparison
equal deleted inserted replaced
55568:2ddd6386b5c9 55569:36845b719feb
1 ;;; telnet.el --- run a telnet session from within an Emacs buffer 1 ;;; telnet.el --- run a telnet session from within an Emacs buffer
2 2
3 ;; Copyright (C) 1985, 1988, 1992, 1994 Free Software Foundation, Inc. 3 ;; Copyright (C) 1985, 88, 1992, 94, 2004 Free Software Foundation, Inc.
4 4
5 ;; Author: William F. Schelter 5 ;; Author: William F. Schelter
6 ;; Maintainer: FSF 6 ;; Maintainer: FSF
7 ;; Keywords: unix, comm 7 ;; Keywords: unix, comm
8 8
238 (setq comint-input-sender 'telnet-simple-send) 238 (setq comint-input-sender 'telnet-simple-send)
239 (setq telnet-count telnet-initial-count)))) 239 (setq telnet-count telnet-initial-count))))
240 240
241 (put 'telnet-mode 'mode-class 'special) 241 (put 'telnet-mode 'mode-class 'special)
242 242
243 (defun telnet-mode () 243 (define-derived-mode telnet-mode comint-mode "Telnet"
244 "This mode is for using telnet (or rsh) from a buffer to another host. 244 "This mode is for using telnet (or rsh) from a buffer to another host.
245 It has most of the same commands as comint-mode. 245 It has most of the same commands as comint-mode.
246 There is a variable ``telnet-interrupt-string'' which is the character 246 There is a variable ``telnet-interrupt-string'' which is the character
247 sent to try to stop execution of a job on the remote host. 247 sent to try to stop execution of a job on the remote host.
248 Data is sent to the remote host when RET is typed. 248 Data is sent to the remote host when RET is typed."
249 249 (set (make-local-variable 'comint-prompt-regexp) telnet-prompt-pattern))
250 \\{telnet-mode-map}
251 "
252 (interactive)
253 (comint-mode)
254 (setq major-mode 'telnet-mode
255 mode-name "Telnet"
256 comint-prompt-regexp telnet-prompt-pattern)
257 (use-local-map telnet-mode-map)
258 (run-hooks 'telnet-mode-hook))
259 250
260 ;;;###autoload (add-hook 'same-window-regexps "\\*rsh-[^-]*\\*\\(\\|<[0-9]*>\\)") 251 ;;;###autoload (add-hook 'same-window-regexps "\\*rsh-[^-]*\\*\\(\\|<[0-9]*>\\)")
261 252
262 ;;;###autoload 253 ;;;###autoload
263 (defun rsh (host) 254 (defun rsh (host)