# HG changeset patch # User Stefan Monnier # Date 1295300543 18000 # Node ID 32f10f475431dd9dc0cc1a5834aa239e65215d96 # Parent 7c2cdabbc4a934797b41bdb0fd29e15bf31e8e10 * emacs-lisp/easy-mmode.el (define-minor-mode): Don't re-evaluate the keymap expression. Improve docstring. diff -r 7c2cdabbc4a9 -r 32f10f475431 lisp/ChangeLog --- 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 + + * emacs-lisp/easy-mmode.el (define-minor-mode): Don't re-evaluate the + keymap expression. Improve docstring. + 2011-01-15 Mark Diekhans * files.el (backup-buffer): Make last-resort backup file in diff -r 7c2cdabbc4a9 -r 32f10f475431 lisp/emacs-lisp/easy-mmode.el --- 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