diff options
| author | Richard M. Stallman | 2005-05-14 13:59:41 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2005-05-14 13:59:41 +0000 |
| commit | cbb8b77d19659d71935728011e2ac39411f229dd (patch) | |
| tree | 48f157483a610b4b06919b6222bb2cba65589274 | |
| parent | a61d42f160ba901bc39d42ca056752f83d6779b6 (diff) | |
| download | emacs-cbb8b77d19659d71935728011e2ac39411f229dd.tar.gz emacs-cbb8b77d19659d71935728011e2ac39411f229dd.zip | |
(Defining Minor Modes): Define define-global-minor-mode.
| -rw-r--r-- | lispref/modes.texi | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lispref/modes.texi b/lispref/modes.texi index 4e6085566c4..c3247b4ca57 100644 --- a/lispref/modes.texi +++ b/lispref/modes.texi | |||
| @@ -1184,8 +1184,9 @@ written a @code{defgroup} to define that group properly. @xref{Group | |||
| 1184 | Definitions}. | 1184 | Definitions}. |
| 1185 | 1185 | ||
| 1186 | @item :global @var{global} | 1186 | @item :global @var{global} |
| 1187 | If non-@code{nil} specifies that the minor mode should be global. | 1187 | If non-@code{nil} specifies that the minor mode should be global. By |
| 1188 | By default, minor modes are buffer-local. | 1188 | default, minor modes defined with @code{define-minor-mode} are |
| 1189 | buffer-local. | ||
| 1189 | 1190 | ||
| 1190 | @item :init-value @var{init-value} | 1191 | @item :init-value @var{init-value} |
| 1191 | This is equivalent to specifying @var{init-value} positionally. | 1192 | This is equivalent to specifying @var{init-value} positionally. |
| @@ -1266,6 +1267,17 @@ See the command \\[hungry-electric-delete]." | |||
| 1266 | :group 'hunger) | 1267 | :group 'hunger) |
| 1267 | @end smallexample | 1268 | @end smallexample |
| 1268 | 1269 | ||
| 1270 | @defmac define-global-minor-mode global-mode mode turn-on keyword-args... | ||
| 1271 | This defines a global minor mode named @var{global-mode} whose meaning | ||
| 1272 | is to enable the buffer-local minor mode @var{mode} in every buffer. | ||
| 1273 | To turn on the minor mode in a buffer, it uses the function | ||
| 1274 | @var{turn-on}; to turn off the minor mode, it calls @code{mode} with | ||
| 1275 | @minus{}1 as argument. | ||
| 1276 | |||
| 1277 | Use @code{:group @var{group}} in @var{keyword-args} to specify the | ||
| 1278 | custom group for the mode variable of the global minor mode. | ||
| 1279 | @end defmac | ||
| 1280 | |||
| 1269 | @node Mode Line Format | 1281 | @node Mode Line Format |
| 1270 | @section Mode-Line Format | 1282 | @section Mode-Line Format |
| 1271 | @cindex mode line | 1283 | @cindex mode line |