lisp/emacs-lisp/derived.el: Don't warn about keymaps already `defconst'ed.
authorJuanma Barranquero <lekktu@gmail.com>
Tue, 22 Mar 2011 20:58:27 +0000 (21:58 +0100)
committerJuanma Barranquero <lekktu@gmail.com>
Tue, 22 Mar 2011 20:58:27 +0000 (21:58 +0100)
lisp/ChangeLog
lisp/emacs-lisp/derived.el

index 6b7dd5a..e508174 100644 (file)
@@ -1,3 +1,9 @@
+2011-03-22  Juanma Barranquero  <lekktu@gmail.com>
+
+       * emacs-lisp/derived.el (define-derived-mode): Wrap declaration of
+       keymap variable in `with-no-warnings' to avoid a warning when the
+       keymap has been already `defconst'ed.
+
 2011-03-22  Leo Liu  <sdl.web@gmail.com>
 
        * abbrev.el (write-abbrev-file): Use utf-8 for writing if it can
index 425a77e..1db98ac 100644 (file)
@@ -201,7 +201,7 @@ No problems result if this variable is not bound.
                       name))))
        (unless (boundp ',map)
         (put ',map 'definition-name ',child))
-       (defvar ,map (make-sparse-keymap))
+       (with-no-warnings (defvar ,map (make-sparse-keymap)))
        (unless (get ',map 'variable-documentation)
         (put ',map 'variable-documentation
              (purecopy ,(format "Keymap for `%s'." child))))