Mercurial > emacs
diff lisp/emacs-lisp/easy-mmode.el @ 112345:32f10f475431
* emacs-lisp/easy-mmode.el (define-minor-mode): Don't re-evaluate the
keymap expression. Improve docstring.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Mon, 17 Jan 2011 16:42:23 -0500 |
parents | 376148b31b5e |
children | 67bea318ed68 |
line wrap: on
line diff
--- a/lisp/emacs-lisp/easy-mmode.el Sun Jan 16 10:40:47 2011 -0500 +++ b/lisp/emacs-lisp/easy-mmode.el Mon Jan 17 16:42:23 2011 -0500 @@ -93,8 +93,9 @@ Optional LIGHTER is displayed in the modeline when the mode is on. Optional KEYMAP is the default keymap bound to the mode keymap. If non-nil, it should be a variable name (whose value is a keymap), - a keymap, or a list of arguments for `easy-mmode-define-keymap'. - If KEYMAP is a keymap or list, this also defines the variable MODE-map. + or an expression that returns either a keymap or a list of + arguments for `easy-mmode-define-keymap'. If KEYMAP is not a symbol, + this also defines the variable MODE-map. BODY contains code to execute each time the mode is enabled or disabled. It is executed after toggling the mode, and before running MODE-hook. @@ -256,7 +257,7 @@ (let ((m ,keymap)) (cond ((keymapp m) m) ((listp m) (easy-mmode-define-keymap m)) - (t (error "Invalid keymap %S" ,keymap)))) + (t (error "Invalid keymap %S" m)))) ,(format "Keymap for `%s'." mode-name))) (add-minor-mode ',mode ',lighter