[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] /srv/bzr/emacs/trunk r103075: * lisp/simple.el (specia

From: Stefan Monnier
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r103075: * lisp/simple.el (special-mode-map): Bind "h" to `describe-mode';
Date: Mon, 07 Feb 2011 10:15:21 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

>> This change, along with other similar ones you made in the above commit
>> is wrong.  Keymaps need to be defined within their `defvar'.
>> The use of define-derived-mode makes no difference to it.

> I am confused.
> (macroexpand '(define-derived-mode child-mode parent-mode "mode name"))
> clearly shows
> (defvar child-mode-map (make-sparse-keymap))
> why do I need a separate defvar?

Because this (defvar child-mode-map (make-sparse-keymap)) is only there
for those rare derived modes that don't bother to define their own
mode map.  In 99% of the cases, this defvar will be a no-op.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]