diff options
| author | Noam Postavsky | 2017-01-04 20:35:13 -0500 |
|---|---|---|
| committer | Noam Postavsky | 2017-01-07 09:30:00 -0500 |
| commit | a2a20739331a216826b9c76d49b0aa2abd68deee (patch) | |
| tree | f880ce4da04fb77a1468d383e72ec80ba6705c96 /doc | |
| parent | fc38671988d2d9c3ddb865bdc3a44e827fdb23ed (diff) | |
| download | emacs-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.texi | 5 | ||||
| -rw-r--r-- | doc/lispref/modes.texi | 26 |
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}). | |||
| 66 | first visit a file or create a buffer (@pxref{Choosing Modes}). You | 66 | first visit a file or create a buffer (@pxref{Choosing Modes}). You |
| 67 | can explicitly select a new major mode by using an @kbd{M-x} command. | 67 | can explicitly select a new major mode by using an @kbd{M-x} command. |
| 68 | Take the name of the mode and add @code{-mode} to get the name of the | 68 | Take the name of the mode and add @code{-mode} to get the name of the |
| 69 | command to select that mode (e.g., @kbd{M-x lisp-mode} enters Lisp mode). | 69 | command to select that mode (e.g., @kbd{M-x lisp-mode} enters Lisp |
| 70 | mode). Since every buffer has exactly one major mode, there is no way | ||
| 71 | to ``turn off'' a major mode; instead you must switch to a different | ||
| 72 | one. | ||
| 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 |
| 11 | turned on and off while you edit. There are two varieties of modes: | 11 | in useful ways. There are two varieties of modes: @dfn{minor modes}, |
| 12 | @dfn{major modes}, which are mutually exclusive and used for editing | 12 | which provide features that users can turn on and off while editing; |
| 13 | particular kinds of text, and @dfn{minor modes}, which provide features | 13 | and @dfn{major modes}, which are used for editing or interacting with |
| 14 | that users can enable individually. | 14 | a particular kind of text. Each buffer has exactly one @dfn{major |
| 15 | mode} 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 |
| 17 | indicate them in the mode line, and how they run hooks supplied by the | 18 | indicate 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 |
| 200 | Each buffer has one major mode at a time. Every major mode is | 201 | particular kinds of text. Each buffer has exactly one major mode at a |
| 201 | associated with a @dfn{major mode command}, whose name should end in | 202 | time. 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 | 203 | whose name should end in @samp{-mode}. This command takes care of |
| 203 | current buffer, by setting various buffer-local variables such as a | 204 | switching to that mode in the current buffer, by setting various |
| 204 | local keymap. @xref{Major Mode Conventions}. | 205 | buffer-local variables such as a local keymap. @xref{Major Mode |
| 206 | Conventions}. Note that unlike minor modes there is no way to ``turn | ||
| 207 | off'' a major mode, instead the buffer must be switched to a different | ||
| 208 | one. | ||
| 205 | 209 | ||
| 206 | The least specialized major mode is called @dfn{Fundamental mode}, | 210 | The least specialized major mode is called @dfn{Fundamental mode}, |
| 207 | which has no mode-specific definitions or variable settings. | 211 | which has no mode-specific definitions or variable settings. |