summaryrefslogtreecommitdiff
path: root/lisp/net/telnet.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2004-05-13 14:30:22 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2004-05-13 14:30:22 +0000
commit46554de4a0616bc5f7ab4d820a218352995f1de1 (patch)
tree16c346be7c8149675d2a3b90e2d1cadbb9612f07 /lisp/net/telnet.el
parent64bd6fd115d9d29a385d4ff1de2aa85a95c1fd18 (diff)
downloademacs-46554de4a0616bc5f7ab4d820a218352995f1de1.tar.gz
emacs-46554de4a0616bc5f7ab4d820a218352995f1de1.tar.bz2
emacs-46554de4a0616bc5f7ab4d820a218352995f1de1.zip
(telnet-mode): Use define-derived-mode.
Don't modify the global value of comint-prompt-regexp.
Diffstat (limited to 'lisp/net/telnet.el')
-rw-r--r--lisp/net/telnet.el17
1 files changed, 4 insertions, 13 deletions
diff --git a/lisp/net/telnet.el b/lisp/net/telnet.el
index d42c4335daa..40a28494774 100644
--- a/lisp/net/telnet.el
+++ b/lisp/net/telnet.el
@@ -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 @@ Normally input is edited in Emacs and sent a line at a time."
(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]*>\\)")