emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r107025: * lisp/emacs-lisp/easy-mmode


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107025: * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix.
Date: Mon, 30 Jan 2012 20:50:04 -0800
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107025
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Mon 2012-01-30 20:50:04 -0800
message:
  * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix.
modified:
  lisp/ChangeLog
  lisp/emacs-lisp/easy-mmode.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-01-31 04:35:57 +0000
+++ b/lisp/ChangeLog    2012-01-31 04:50:04 +0000
@@ -9,9 +9,9 @@
 
 2012-01-31  Glenn Morris  <address@hidden>
 
-       * 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  <address@hidden>
 

=== modified file 'lisp/emacs-lisp/easy-mmode.el'
--- a/lisp/emacs-lisp/easy-mmode.el     2012-01-31 04:35:57 +0000
+++ b/lisp/emacs-lisp/easy-mmode.el     2012-01-31 04:50:04 +0000
@@ -86,7 +86,8 @@
 ;;;###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.
@@ -116,12 +117,15 @@
 :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!\"


reply via email to

[Prev in Thread] Current Thread [Next in Thread]