]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix.
authorGlenn Morris <rgm@gnu.org>
Tue, 31 Jan 2012 04:52:29 +0000 (20:52 -0800)
committerGlenn Morris <rgm@gnu.org>
Tue, 31 Jan 2012 04:52:29 +0000 (20:52 -0800)
lisp/ChangeLog
lisp/emacs-lisp/easy-mmode.el

index 865bd7c36fb471c9643000f12e9ac0b6c9c0e73e..9ba62b56449ca4524b610d8f67f7f879b34eb521 100644 (file)
@@ -9,9 +9,9 @@
 
 2012-01-31  Glenn Morris  <rgm@gnu.org>
 
-       * emacs-lisp/easy-mmode.el (define-minor-mode):
+       * emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix.
        Fix :variable handling of mode a symbol not equal to modefun.
-       Allow named functions to be used as the cdr of variable:.
+       Allow named functions to be used as the cdr of :variable.
 
 2012-01-30  Glenn Morris  <rgm@gnu.org>
 
index 9e1a079df5c8898eedf7ec6570bc09b90f1e98ac..efd5ee45d9bcad19e68f55adb3aaae6bc188d0c7 100644 (file)
@@ -86,7 +86,8 @@ replacing its case-insensitive matches with the literal string in LIGHTER."
 ;;;###autoload
 (defmacro define-minor-mode (mode doc &optional init-value lighter keymap &rest body)
   "Define a new minor mode MODE.
-This defines the control variable MODE and the toggle command MODE.
+This defines the toggle command MODE and (by default) a control variable
+MODE (you can override this with the :variable keyword, see below).
 DOC is the documentation for the mode toggle command.
 
 Optional INIT-VALUE is the initial value of the mode's variable.
@@ -113,15 +114,19 @@ BODY contains code to execute each time the mode is enabled or disabled.
                buffer-local, so don't make the variable MODE buffer-local.
                By default, the mode is buffer-local.
 :init-value VAL        Same as the INIT-VALUE argument.
+               Not used if you also specify :variable.
 :lighter SPEC  Same as the LIGHTER argument.
 :keymap MAP    Same as the KEYMAP argument.
 :require SYM   Same as in `defcustom'.
-:variable PLACE        The location (as can be used with `setf') to use instead
-               of the variable MODE to store the state of the mode.  PLACE
-               can also be of the form (GET . SET) where GET is an expression
-               that returns the current state and SET is a function that takes
-               a new state and sets it.  If you specify a :variable, this
-               function assumes it is defined elsewhere.
+:variable PLACE        The location to use instead of the variable MODE to store
+               the state of the mode.  This can be simply a different
+               named variable, or more generally anything that can be used
+               with the CL macro `setf'.  PLACE can also be of the form
+               \(GET . SET), where GET is an expression that returns the
+               current state, and SET is a function that takes one argument,
+               the new state, and sets it.  If you specify a :variable,
+               this function does not define a MODE variable (nor any of
+               the terms used in :variable).
 
 For example, you could write
   (define-minor-mode foo-mode \"If enabled, foo on you!\"