(define-derived-mode): Put `definition-name'
authorJuri Linkov <juri@jurta.org>
Sun, 4 Dec 2005 02:33:41 +0000 (02:33 +0000)
committerJuri Linkov <juri@jurta.org>
Sun, 4 Dec 2005 02:33:41 +0000 (02:33 +0000)
properties on the constructed variable names.

lisp/emacs-lisp/derived.el

index e595ff9..899c404 100644 (file)
@@ -200,12 +200,19 @@ See Info node `(elisp)Derived Modes' for more details."
 No problems result if this variable is not bound.
 `add-hook' automatically binds it.  (This is true for all hook variables.)"
                       name)))
+       (unless (boundp ',map)
+        (put ',map 'definition-name ',child))
        (defvar ,map (make-sparse-keymap))
        ,(if declare-syntax
-           `(defvar ,syntax (make-syntax-table)))
+           `(progn
+              (unless (boundp ',syntax)
+                (put ',syntax 'definition-name ',child))
+              (defvar ,syntax (make-syntax-table))))
        ,(if declare-abbrev
-           `(defvar ,abbrev
-              (progn (define-abbrev-table ',abbrev nil) ,abbrev)))
+           `(progn
+              (put ',abbrev 'definition-name ',child)
+              (defvar ,abbrev
+                (progn (define-abbrev-table ',abbrev nil) ,abbrev))))
        (put ',child 'derived-mode-parent ',parent)
        ,(if group `(put ',child 'custom-mode-group ,group))