changeset 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 2ddd6386b5c9
children 9edbe481a40b
files lisp/net/telnet.el
diffstat 1 files changed, 4 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/net/telnet.el	Thu May 13 13:01:01 2004 +0000
+++ b/lisp/net/telnet.el	Thu May 13 14:30:22 2004 +0000
@@ -1,6 +1,6 @@
 ;;; telnet.el --- run a telnet session from within an Emacs buffer
 
-;; Copyright (C) 1985, 1988, 1992, 1994 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 88, 1992, 94, 2004  Free Software Foundation, Inc.
 
 ;; Author: William F. Schelter
 ;; Maintainer: FSF
@@ -240,22 +240,13 @@
 
 (put 'telnet-mode 'mode-class 'special)
 
-(defun telnet-mode ()
+(define-derived-mode telnet-mode comint-mode "Telnet"
   "This mode is for using telnet (or rsh) from a buffer to another host.
 It has most of the same commands as comint-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 RET is typed.
-
-\\{telnet-mode-map}
-"
-  (interactive)
-  (comint-mode)
-  (setq major-mode 'telnet-mode
-	mode-name "Telnet"
-	comint-prompt-regexp telnet-prompt-pattern)
-  (use-local-map telnet-mode-map)
-  (run-hooks 'telnet-mode-hook))
+Data is sent to the remote host when RET is typed."
+  (set (make-local-variable 'comint-prompt-regexp) telnet-prompt-pattern))
 
 ;;;###autoload (add-hook 'same-window-regexps "\\*rsh-[^-]*\\*\\(\\|<[0-9]*>\\)")