aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorNoam Postavsky2017-01-04 20:35:13 -0500
committerNoam Postavsky2017-01-07 09:30:00 -0500
commita2a20739331a216826b9c76d49b0aa2abd68deee (patch)
treef880ce4da04fb77a1468d383e72ec80ba6705c96 /doc
parentfc38671988d2d9c3ddb865bdc3a44e827fdb23ed (diff)
downloademacs-a2a20739331a216826b9c76d49b0aa2abd68deee.tar.gz
emacs-a2a20739331a216826b9c76d49b0aa2abd68deee.zip
Clarify major mode switching
* doc/emacs/modes.texi (Major Modes): * doc/lispref/modes.texi (Modes, Major Modes): Explictly say that each buffer has exactly one major mode and can't be "turned off", only switched away from (Bug#25357).
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/modes.texi5
-rw-r--r--doc/lispref/modes.texi26
2 files changed, 19 insertions, 12 deletions
diff --git a/doc/emacs/modes.texi b/doc/emacs/modes.texi
index 0acb82dc914..be893403012 100644
--- a/doc/emacs/modes.texi
+++ b/doc/emacs/modes.texi
@@ -66,7 +66,10 @@ process (@pxref{Interactive Shell}).
66first visit a file or create a buffer (@pxref{Choosing Modes}). You 66first visit a file or create a buffer (@pxref{Choosing Modes}). You
67can explicitly select a new major mode by using an @kbd{M-x} command. 67can explicitly select a new major mode by using an @kbd{M-x} command.
68Take the name of the mode and add @code{-mode} to get the name of the 68Take the name of the mode and add @code{-mode} to get the name of the
69command to select that mode (e.g., @kbd{M-x lisp-mode} enters Lisp mode). 69command to select that mode (e.g., @kbd{M-x lisp-mode} enters Lisp
70mode). Since every buffer has exactly one major mode, there is no way
71to ``turn off'' a major mode; instead you must switch to a different
72one.
70 73
71@vindex major-mode 74@vindex major-mode
72 The value of the buffer-local variable @code{major-mode} is a symbol 75 The value of the buffer-local variable @code{major-mode} is a symbol
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index b24ab3603da..0015a9f318d 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -7,11 +7,12 @@
7@chapter Major and Minor Modes 7@chapter Major and Minor Modes
8@cindex mode 8@cindex mode
9 9
10 A @dfn{mode} is a set of definitions that customize Emacs and can be 10 A @dfn{mode} is a set of definitions that customize Emacs behavior
11turned on and off while you edit. There are two varieties of modes: 11in useful ways. There are two varieties of modes: @dfn{minor modes},
12@dfn{major modes}, which are mutually exclusive and used for editing 12which provide features that users can turn on and off while editing;
13particular kinds of text, and @dfn{minor modes}, which provide features 13and @dfn{major modes}, which are used for editing or interacting with
14that users can enable individually. 14a particular kind of text. Each buffer has exactly one @dfn{major
15mode} at a time.
15 16
16 This chapter describes how to write both major and minor modes, how to 17 This chapter describes how to write both major and minor modes, how to
17indicate them in the mode line, and how they run hooks supplied by the 18indicate them in the mode line, and how they run hooks supplied by the
@@ -196,12 +197,15 @@ from the buffer-local hook list instead of from the global hook list.
196@cindex major mode 197@cindex major mode
197 198
198@cindex major mode command 199@cindex major mode command
199 Major modes specialize Emacs for editing particular kinds of text. 200 Major modes specialize Emacs for editing or interacting with
200Each buffer has one major mode at a time. Every major mode is 201particular kinds of text. Each buffer has exactly one major mode at a
201associated with a @dfn{major mode command}, whose name should end in 202time. Every major mode is associated with a @dfn{major mode command},
202@samp{-mode}. This command takes care of switching to that mode in the 203whose name should end in @samp{-mode}. This command takes care of
203current buffer, by setting various buffer-local variables such as a 204switching to that mode in the current buffer, by setting various
204local keymap. @xref{Major Mode Conventions}. 205buffer-local variables such as a local keymap. @xref{Major Mode
206Conventions}. Note that unlike minor modes there is no way to ``turn
207off'' a major mode, instead the buffer must be switched to a different
208one.
205 209
206 The least specialized major mode is called @dfn{Fundamental mode}, 210 The least specialized major mode is called @dfn{Fundamental mode},
207which has no mode-specific definitions or variable settings. 211which has no mode-specific definitions or variable settings.