diff options
| author | Chong Yidong | 2007-02-03 17:11:39 +0000 |
|---|---|---|
| committer | Chong Yidong | 2007-02-03 17:11:39 +0000 |
| commit | 1608076d4346ac9871021f8c961408fff7bc8f7d (patch) | |
| tree | 2c9bd31883acdc7f4a5b1f064c077b5d7ed15ba2 | |
| parent | 632a4cc7099773926727cce256c61754fd023c98 (diff) | |
| download | emacs-1608076d4346ac9871021f8c961408fff7bc8f7d.tar.gz emacs-1608076d4346ac9871021f8c961408fff7bc8f7d.zip | |
(Defining Minor Modes): Document that a :require keyword or similar
may be required to make saved customization variables work.
| -rw-r--r-- | lispref/modes.texi | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/lispref/modes.texi b/lispref/modes.texi index 1d96568fc1d..3de0925283b 100644 --- a/lispref/modes.texi +++ b/lispref/modes.texi | |||
| @@ -1387,9 +1387,18 @@ written a @code{defgroup} to define that group properly. @xref{Group | |||
| 1387 | Definitions}. | 1387 | Definitions}. |
| 1388 | 1388 | ||
| 1389 | @item :global @var{global} | 1389 | @item :global @var{global} |
| 1390 | If non-@code{nil} specifies that the minor mode should be global. By | 1390 | If non-@code{nil}, this specifies that the minor mode should be global |
| 1391 | default, minor modes defined with @code{define-minor-mode} are | 1391 | rather than buffer-local. It defaults to @code{nil}. |
| 1392 | buffer-local. | 1392 | |
| 1393 | One of the effects of making a minor mode global is that the | ||
| 1394 | @var{mode} variable becomes a customization variable; toggling it | ||
| 1395 | through the Custom interface to turn the mode on and off, and its | ||
| 1396 | value can be saved for future Emacs sessions (@pxref{Saving | ||
| 1397 | Customizations,,, emacs, The GNU Emacs Manual}. For the saved | ||
| 1398 | variable to work, you should ensure that the @code{define-minor-mode} | ||
| 1399 | form is evaluated each time Emacs starts; for packages that are not | ||
| 1400 | part of Emacs, the easiest way to do this is to specify a | ||
| 1401 | @code{:require} keyword. | ||
| 1393 | 1402 | ||
| 1394 | @item :init-value @var{init-value} | 1403 | @item :init-value @var{init-value} |
| 1395 | This is equivalent to specifying @var{init-value} positionally. | 1404 | This is equivalent to specifying @var{init-value} positionally. |
| @@ -1479,7 +1488,7 @@ See the command \\[hungry-electric-delete]." | |||
| 1479 | :group 'hunger) | 1488 | :group 'hunger) |
| 1480 | @end smallexample | 1489 | @end smallexample |
| 1481 | 1490 | ||
| 1482 | @defmac define-global-minor-mode global-mode mode turn-on keyword-args@dots{} | 1491 | @defmac define-globalized-minor-mode global-mode mode turn-on keyword-args@dots{} |
| 1483 | This defines a global toggle named @var{global-mode} whose meaning is | 1492 | This defines a global toggle named @var{global-mode} whose meaning is |
| 1484 | to enable or disable the buffer-local minor mode @var{mode} in all | 1493 | to enable or disable the buffer-local minor mode @var{mode} in all |
| 1485 | buffers. To turn on the minor mode in a buffer, it uses the function | 1494 | buffers. To turn on the minor mode in a buffer, it uses the function |
| @@ -1491,6 +1500,12 @@ by visiting files, and buffers that use a major mode other than | |||
| 1491 | Fundamental mode; but it does not detect the creation of a new buffer | 1500 | Fundamental mode; but it does not detect the creation of a new buffer |
| 1492 | in Fundamental mode. | 1501 | in Fundamental mode. |
| 1493 | 1502 | ||
| 1503 | This defines the customization option @var{global-mode} (@pxref{Customization}), | ||
| 1504 | which can be toggled in the Custom interface to turn the minor mode on | ||
| 1505 | and off. As with @code{define-minor-mode}, you should ensure that the | ||
| 1506 | @code{define-globalized-minor-mode} form is evaluated each time Emacs | ||
| 1507 | starts, for example by providing a @code{:require} keyword. | ||
| 1508 | |||
| 1494 | Use @code{:group @var{group}} in @var{keyword-args} to specify the | 1509 | Use @code{:group @var{group}} in @var{keyword-args} to specify the |
| 1495 | custom group for the mode variable of the global minor mode. | 1510 | custom group for the mode variable of the global minor mode. |
| 1496 | @end defmac | 1511 | @end defmac |