]> code.delx.au - gnu-emacs/blobdiff - lisp/derived.el
(sgml-tag-alist): Doc fix.
[gnu-emacs] / lisp / derived.el
index 25b65bb1b1a720c0d8b5552ff1fd799e41a0446b..3586affe216448ac04b093d779833ae6b6786fbe 100644 (file)
@@ -124,7 +124,7 @@ NAME:      a string which will appear in the status line (e.g. \"Hypertext\")
 DOCSTRING: an optional documentation string--if you do not supply one,
            the function will attempt to invent something useful.
 BODY:      forms to execute just before running the
-           hooks for the new mode.
+           hooks for the new mode.  Do not use `interactive' here.
 
 Here is how you could define LaTeX-Thesis mode as a variant of LaTeX mode:
 
@@ -161,8 +161,8 @@ been generated automatically, with a reference to the keymap."
     `(progn
        (defvar ,map (make-sparse-keymap))
        (defvar ,syntax (make-syntax-table))
-       (defvar ,abbrev)
-       (define-abbrev-table ',abbrev nil)
+       (defvar ,abbrev
+        (progn (define-abbrev-table ',abbrev nil) ,abbrev))
        (put ',child 'derived-mode-parent ',parent)
 
        (defun ,child ()
@@ -203,17 +203,6 @@ been generated automatically, with a reference to the keymap."
                                        ; Run the hooks, if any.
         (run-mode-hooks ',hook)))))
 
-;; PUBLIC: find if the current mode derives from another.
-
-;;; ;;;###autoload
-(defun derived-mode-p (&rest modes)
-  "Non-nil if the current major mode is derived from one of MODES.
-Uses the `derived-mode-parent' property of the symbol to trace backwards."
-  (let ((parent major-mode))
-    (while (and (not (memq parent modes))
-               (setq parent (get parent 'derived-mode-parent))))
-    parent))
-
 ;; PUBLIC: find the ultimate class of a derived mode.
 
 (defun derived-mode-class (mode)