emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r107027: Document define-minor-mode's


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107027: Document define-minor-mode's new :variable keyword in the lispref.
Date: Mon, 30 Jan 2012 21:03:09 -0800
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107027
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Mon 2012-01-30 21:03:09 -0800
message:
  Document define-minor-mode's new :variable keyword in the lispref.
  
  * doc/lispref/modes.texi (Defining Minor Modes):
  Document define-minor-mode's new :variable keyword.
  * etc/NEWS: Markup.
modified:
  doc/lispref/ChangeLog
  doc/lispref/modes.texi
  etc/NEWS
=== modified file 'doc/lispref/ChangeLog'
--- a/doc/lispref/ChangeLog     2012-01-29 07:35:58 +0000
+++ b/doc/lispref/ChangeLog     2012-01-31 05:03:09 +0000
@@ -1,3 +1,8 @@
+2012-01-31  Glenn Morris  <address@hidden>
+
+       * modes.texi (Defining Minor Modes):
+       Document define-minor-mode's new :variable keyword.
+
 2012-01-29  Chong Yidong  <address@hidden>
 
        * syntax.texi (Syntax Class Table): Tweak description of newline

=== modified file 'doc/lispref/modes.texi'
--- a/doc/lispref/modes.texi    2012-01-28 03:49:22 +0000
+++ b/doc/lispref/modes.texi    2012-01-31 05:03:09 +0000
@@ -1351,11 +1351,11 @@
 @defmac define-minor-mode mode doc [init-value [lighter [keymap]]] 
address@hidden address@hidden
 This macro defines a new minor mode whose name is @var{mode} (a
 symbol).  It defines a command named @var{mode} to toggle the minor
-mode, with @var{doc} as its documentation string.  It also defines a
-variable named @var{mode}, which is set to @code{t} or @code{nil} by
-enabling or disabling the mode.  The variable is initialized to
address@hidden  Except in unusual circumstances (see below), this
-value must be @code{nil}.
+mode, with @var{doc} as its documentation string.  By default, it also
+defines a variable named @var{mode}, which is set to @code{t} or
address@hidden by enabling or disabling the mode.  The variable is
+initialized to @var{init-value}.  Except in unusual circumstances (see
+below), this value must be @code{nil}.
 
 The string @var{lighter} says what to display in the mode line
 when the mode is enabled; if it is @code{nil}, the mode is not displayed
@@ -1410,6 +1410,17 @@
 
 @item :keymap @var{keymap}
 This is equivalent to specifying @var{keymap} positionally.
+
address@hidden :variable @var{place}
+This replaces the default variable @var{mode}, used to store the state
+of the mode.  If you specify this, the @var{mode} variable is not
+defined, and any @var{init-value} argument is unused.  @var{place}
+can be a different named variable (which you must define yourself), or
+anything that can be used with the @code{setf} function
+(@pxref{Generalized Variables,,, cl, Common Lisp Extensions}).
address@hidden can also be a cons @code{(@var{get} . @var{set})},
+where @var{get} is an expression that returns the current state,
+and @var{set} is a function of one argument (a state) that sets it.
 @end table
 
 Any other keyword arguments are passed directly to the

=== modified file 'etc/NEWS'
--- a/etc/NEWS  2012-01-31 01:01:30 +0000
+++ b/etc/NEWS  2012-01-31 05:03:09 +0000
@@ -1293,6 +1293,7 @@
 *** Enabled globalized minor modes can be disabled in specific modes,
 by running (FOO-mode-hook 0) via a mode hook.
 
++++
 *** `define-minor-mode' accepts a new keyword :variable.
 
 +++


reply via email to

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