[Top][All Lists]

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

Re: caps-mode.el

From: Kevin Rodgers
Subject: Re: caps-mode.el
Date: Mon, 09 Aug 2004 11:33:47 -0600
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv: Gecko/20020406 Netscape6/6.2.2

Kevin Rodgers wrote:
> Note this recommendation in define-minor-mode's doc string:
> | Optional KEYMAP is the default (defvar) keymap bound to the mode keymap.
> |   If it is a list, it is passed to `easy-mmode-define-keymap'
> |   in order to build a valid keymap.  It's generally better to use
> |   a separate MODE-map variable than to use this argument.
> So eliminate the :keymap LIST altogether:
> (defvar caps-mode-keymap
>   (let ((map (make-sparse-keymap)))
>     (mapc (lambda (char)
>             (define-key map 'caps-mode-self-insert-command))
>           "abcdefghijklmnopqrstuvwxyz")
>     map))

Oops, also from define-minor-mode's doc string:

| This function defines the associated control variable MODE, keymap MODE-map,
| toggle command MODE, and hook MODE-hook.

So that should be: (defvar caps-mode-map ...)

Kevin Rodgers

reply via email to

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