aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/emacs-lisp/derived.el19
1 files changed, 14 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el
index 8b2bb8ca861..347140e41f4 100644
--- a/lisp/emacs-lisp/derived.el
+++ b/lisp/emacs-lisp/derived.el
@@ -1,8 +1,8 @@
1;;; derived.el --- allow inheritance of major modes 1;;; derived.el --- allow inheritance of major modes
2;; (formerly mode-clone.el) 2;; (formerly mode-clone.el)
3 3
4;; Copyright (C) 1993, 1994, 1999, 2001, 2002, 2003, 2004, 4;; Copyright (C) 1993, 1994, 1999, 2001, 2002, 2003, 2004, 2005, 2006,
5;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 5;; 2007, 2008, 2009 Free Software Foundation, Inc.
6 6
7;; Author: David Megginson (dmeggins@aix1.uottawa.ca) 7;; Author: David Megginson (dmeggins@aix1.uottawa.ca)
8;; Maintainer: FSF 8;; Maintainer: FSF
@@ -193,7 +193,7 @@ See Info node `(elisp)Derived Modes' for more details."
193 parent child docstring syntax abbrev)) 193 parent child docstring syntax abbrev))
194 194
195 `(progn 195 `(progn
196 (unless (get ',hook 'variable-documentation) 196 (unless (get ',hook 'variable-documentation)
197 (put ',hook 'variable-documentation 197 (put ',hook 'variable-documentation
198 ,(format "Hook run when entering %s mode. 198 ,(format "Hook run when entering %s mode.
199No problems result if this variable is not bound. 199No problems result if this variable is not bound.
@@ -202,16 +202,25 @@ No problems result if this variable is not bound.
202 (unless (boundp ',map) 202 (unless (boundp ',map)
203 (put ',map 'definition-name ',child)) 203 (put ',map 'definition-name ',child))
204 (defvar ,map (make-sparse-keymap)) 204 (defvar ,map (make-sparse-keymap))
205 (unless (get ',map 'variable-documentation)
206 (put ',map 'variable-documentation
207 ,(format "Keymap for `%s'." child)))
205 ,(if declare-syntax 208 ,(if declare-syntax
206 `(progn 209 `(progn
207 (unless (boundp ',syntax) 210 (unless (boundp ',syntax)
208 (put ',syntax 'definition-name ',child)) 211 (put ',syntax 'definition-name ',child))
209 (defvar ,syntax (make-syntax-table)))) 212 (defvar ,syntax (make-syntax-table))
213 (unless (get ',syntax 'variable-documentation)
214 (put ',syntax 'variable-documentation
215 ,(format "Syntax table for `%s'." child)))))
210 ,(if declare-abbrev 216 ,(if declare-abbrev
211 `(progn 217 `(progn
212 (put ',abbrev 'definition-name ',child) 218 (put ',abbrev 'definition-name ',child)
213 (defvar ,abbrev 219 (defvar ,abbrev
214 (progn (define-abbrev-table ',abbrev nil) ,abbrev)))) 220 (progn (define-abbrev-table ',abbrev nil) ,abbrev)
221 (unless (get ',abbrev 'variable-documentation)
222 (put ',abbrev 'variable-documentation
223 ,(format "Abbrev table for `%s'." child))))))
215 (put ',child 'derived-mode-parent ',parent) 224 (put ',child 'derived-mode-parent ',parent)
216 ,(if group `(put ',child 'custom-mode-group ,group)) 225 ,(if group `(put ',child 'custom-mode-group ,group))
217 226