[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: |
Sam Steingold |
Subject: |
Re: [Emacs-diffs] /srv/bzr/emacs/trunk r103075: * lisp/simple.el (special-mode-map): Bind "h" to `describe-mode'; |
Date: |
Sat, 19 Feb 2011 20:50:43 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
> * Stefan Monnier <address@hidden> [2011-02-07 10:15:21 -0500]:
>
>>> 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.
you probably mean "modify the mode map", not "define".
however, this still does not explain why there should be two (defvar
child-mode-map) forms in the same file.
--
Sam Steingold (http://sds.podval.org/) on Ubuntu 10.04 (lucid)
http://jihadwatch.org http://openvotingconsortium.org
http://camera.org http://dhimmi.com http://thereligionofpeace.com
Beliefs divide, doubts unite.