]> git.eshelyaron.com Git - emacs.git/commitdiff
Document locally disabling globalized minor modes in the lispref
authorGlenn Morris <rgm@gnu.org>
Wed, 1 Feb 2012 08:32:31 +0000 (00:32 -0800)
committerGlenn Morris <rgm@gnu.org>
Wed, 1 Feb 2012 08:32:31 +0000 (00:32 -0800)
* doc/lispref/modes.texi (Defining Minor Modes):
Mention disabling global minor modes on a per-major-mode basis.

* etc/NEWS: Clarify entry.

doc/lispref/ChangeLog
doc/lispref/modes.texi
etc/NEWS

index e2ea774fd48bda0c3395241c85c27657d585ad9a..6a8b7750f0b32c52fb43c4f74b0a9de2df5369ce 100644 (file)
@@ -1,3 +1,8 @@
+2012-02-01  Glenn Morris  <rgm@gnu.org>
+
+       * modes.texi (Defining Minor Modes):
+       Mention disabling global minor modes on a per-major-mode basis.
+
 2012-01-31  Chong Yidong  <cyd@gnu.org>
 
        * syntax.texi (Parsing Expressions): Clarify intro (Bug#10657).
index 5536006ecbeb5d74951e7a559189149e12b50529..6f99ddc397214013f4daeed9a8ecd0634e8add6e 100644 (file)
@@ -1521,8 +1521,15 @@ starts, for example by providing a @code{:require} keyword.
 
 Use @code{:group @var{group}} in @var{keyword-args} to specify the
 custom group for the mode variable of the global minor mode.
+
+When you define a globalized minor mode, you should generally also
+define a non-globalized version to toggle the mode on an individual
+buffer basis.  This allows users to disable a globally enabled minor
+mode in a specific major mode if they wish, by deactivating the local
+minor mode in the major mode's hook.
 @end defmac
 
+
 @node Mode Line Format
 @section Mode-Line Format
 @cindex mode line
index 8a588f397cb11091aa1a2955dfa514a97b8c6331..73862f6a961655beeb6a4852f8d5581d1adcdba5 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1290,8 +1290,9 @@ on-the-fly spell checking for comments and strings.
 *** New hook `change-major-mode-after-body-hook', run by
 `run-mode-hooks' just before any other mode hooks.
 
-*** Enabled globalized minor modes can be disabled in specific modes,
-by running (FOO-mode-hook 0) via a mode hook.
+*** Enabled globalized minor modes can be disabled in specific major modes.
+If the global mode is global-FOO-mode, then run (FOO-mode -1) in the
+major mode's hook, where FOO-mode toggles the mode on a per-buffer basis.
 
 +++
 *** `define-minor-mode' accepts a new keyword :variable.