1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-07 15:00:34 -08:00

* emacs-lisp/easy-mmode.el (define-minor-mode): Don't re-evaluate the

keymap expression.  Improve docstring.
This commit is contained in:
Stefan Monnier 2011-01-17 16:42:23 -05:00
parent 0514b4be51
commit 1a1fcbe13f
2 changed files with 9 additions and 3 deletions

View file

@ -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> 2011-01-15 Mark Diekhans <markd@soe.ucsc.edu>
* files.el (backup-buffer): Make last-resort backup file in * files.el (backup-buffer): Make last-resort backup file in

View file

@ -93,8 +93,9 @@ Optional INIT-VALUE is the initial value of the mode's variable.
Optional LIGHTER is displayed in the modeline when the mode is on. Optional LIGHTER is displayed in the modeline when the mode is on.
Optional KEYMAP is the default keymap bound to the mode keymap. 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), 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'. or an expression that returns either a keymap or a list of
If KEYMAP is a keymap or list, this also defines the variable MODE-map. 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. 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. It is executed after toggling the mode, and before running MODE-hook.
@ -256,7 +257,7 @@ With zero or negative ARG turn mode off.
(let ((m ,keymap)) (let ((m ,keymap))
(cond ((keymapp m) m) (cond ((keymapp m) m)
((listp m) (easy-mmode-define-keymap 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))) ,(format "Keymap for `%s'." mode-name)))
(add-minor-mode ',mode ',lighter (add-minor-mode ',mode ',lighter