changeset 67292:ada17aff9ef8

(define-derived-mode): Put `definition-name' properties on the constructed variable names.
author Juri Linkov <juri@jurta.org>
date Sun, 04 Dec 2005 02:33:41 +0000
parents cf5b42f7a962
children 32fa638322e0
files lisp/emacs-lisp/derived.el
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/derived.el	Sun Dec 04 02:32:35 2005 +0000
+++ b/lisp/emacs-lisp/derived.el	Sun Dec 04 02:33:41 2005 +0000
@@ -200,12 +200,19 @@
 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))