]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/derived.el
* lisp/emacs-lisp/smie.el (smie-prec2->grammar): Fix corner case problem.
[gnu-emacs] / lisp / emacs-lisp / derived.el
index f4b79eb3016a0c72200d6ffcdf092e769fc5659a..52da4c99eafc862bb5b0dac04112a1d19b02f92e 100644 (file)
@@ -1,10 +1,11 @@
 ;;; derived.el --- allow inheritance of major modes
 ;; (formerly mode-clone.el)
 
-;; Copyright (C) 1993-1994, 1999, 2001-2012  Free Software Foundation, Inc.
+;; Copyright (C) 1993-1994, 1999, 2001-2015 Free Software Foundation,
+;; Inc.
 
 ;; Author: David Megginson (dmeggins@aix1.uottawa.ca)
-;; Maintainer: FSF
+;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: extensions
 ;; Package: emacs
 
@@ -161,7 +162,8 @@ The new mode runs the hook constructed by the function
 See Info node `(elisp)Derived Modes' for more details."
   (declare (debug (&define name symbolp sexp [&optional stringp]
                           [&rest keywordp sexp] def-body))
-          (doc-string 4))
+          (doc-string 4)
+           (indent 3))
 
   (when (and docstring (not (stringp docstring)))
     ;; Some trickiness, since what appears to be the docstring may really be
@@ -191,12 +193,11 @@ See Info node `(elisp)Derived Modes' for more details."
                     parent child docstring syntax abbrev))
 
     `(progn
-       (unless (get ',hook 'variable-documentation)
-        (put ',hook 'variable-documentation
-             (purecopy ,(format "Hook run when entering %s mode.
+       (defvar ,hook nil
+         ,(format "Hook run after entering %s mode.
 No problems result if this variable is not bound.
 `add-hook' automatically binds it.  (This is true for all hook variables.)"
-                      name))))
+                  name))
        (unless (boundp ',map)
         (put ',map 'definition-name ',child))
        (with-no-warnings (defvar ,map (make-sparse-keymap)))