comparison lisp/derived.el @ 29223:8abed1831e4f

Fix keywords. (define-derived-mode): Only define if needed.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 26 May 2000 00:42:30 +0000
parents f4e4d31c70f5
children 7f4f9332942e
comparison
equal deleted inserted replaced
29222:10f869e6566b 29223:8abed1831e4f
26 26
27 ;;; Commentary: 27 ;;; Commentary:
28 28
29 ;; Obsolete. 29 ;; Obsolete.
30 ;; Use the `derived-major-mode' provided by easy-mmode.el instead. 30 ;; Use the `derived-major-mode' provided by easy-mmode.el instead.
31 ;; It is only kept for backward compatibility with byte-compiled files 31 ;; It is only kept for backward compatibility with Emacs-20 byte-compiled
32 ;; which refer to `derived-mode-init-mode-variables' and other functions. 32 ;; files that refer to `derived-mode-init-mode-variables' and other functions.
33 33
34 34
35 35
36 ;; GNU Emacs is already, in a sense, object oriented -- each object 36 ;; GNU Emacs is already, in a sense, object oriented -- each object
37 ;; (buffer) belongs to a class (major mode), and that class defines 37 ;; (buffer) belongs to a class (major mode), and that class defines
102 ;;; Code: 102 ;;; Code:
103 103
104 ;; PUBLIC: define a new major mode which inherits from an existing one. 104 ;; PUBLIC: define a new major mode which inherits from an existing one.
105 105
106 ;; ;;;###autoload 106 ;; ;;;###autoload
107 ;; Don't override the definition provided by easy-mmode.el
108 (unless (fboundp 'define-derived-mode)
107 (defmacro define-derived-mode (child parent name &optional docstring &rest body) 109 (defmacro define-derived-mode (child parent name &optional docstring &rest body)
108 "Create a new mode as a variant of an existing mode. 110 "Create a new mode as a variant of an existing mode.
109 111
110 The arguments to this command are as follow: 112 The arguments to this command are as follow:
111 113
166 ;;; ; Run the setup function, if 168 ;;; ; Run the setup function, if
167 ;;; ; any -- this will soon be 169 ;;; ; any -- this will soon be
168 ;;; ; obsolete. 170 ;;; ; obsolete.
169 ;;; (derived-mode-run-setup-function (quote ,child)) 171 ;;; (derived-mode-run-setup-function (quote ,child))
170 ; Run the hooks, if any. 172 ; Run the hooks, if any.
171 (derived-mode-run-hooks (quote ,child))))) 173 (derived-mode-run-hooks (quote ,child))))))
172 174
173 175
174 ;; PUBLIC: find the ultimate class of a derived mode. 176 ;; PUBLIC: find the ultimate class of a derived mode.
175 177
176 (defun derived-mode-class (mode) 178 (defun derived-mode-class (mode)