Mercurial > emacs
changeset 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 | 7c2cdabbc4a9 |
children | a3e090c3eecb |
files | lisp/ChangeLog lisp/emacs-lisp/easy-mmode.el |
diffstat | 2 files changed, 9 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Sun Jan 16 10:40:47 2011 -0500 +++ b/lisp/ChangeLog Mon Jan 17 16:42:23 2011 -0500 @@ -1,3 +1,8 @@ +2011-01-17 Stefan Monnier <monnier@iro.umontreal.ca> + + * emacs-lisp/easy-mmode.el (define-minor-mode): Don't re-evaluate the + keymap expression. Improve docstring. + 2011-01-15 Mark Diekhans <markd@soe.ucsc.edu> * files.el (backup-buffer): Make last-resort backup file in
--- 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