aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2004-05-13 14:30:22 +0000
committerStefan Monnier2004-05-13 14:30:22 +0000
commit46554de4a0616bc5f7ab4d820a218352995f1de1 (patch)
tree16c346be7c8149675d2a3b90e2d1cadbb9612f07
parent64bd6fd115d9d29a385d4ff1de2aa85a95c1fd18 (diff)
downloademacs-46554de4a0616bc5f7ab4d820a218352995f1de1.tar.gz
emacs-46554de4a0616bc5f7ab4d820a218352995f1de1.zip
(telnet-mode): Use define-derived-mode.
Don't modify the global value of comint-prompt-regexp.
-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 @@
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
@@ -240,22 +240,13 @@ Normally input is edited in Emacs and sent a line at a time."
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.
245It has most of the same commands as comint-mode. 245It has most of the same commands as comint-mode.
246There is a variable ``telnet-interrupt-string'' which is the character 246There is a variable ``telnet-interrupt-string'' which is the character
247sent to try to stop execution of a job on the remote host. 247sent to try to stop execution of a job on the remote host.
248Data is sent to the remote host when RET is typed. 248Data 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