From: npostavs@users.sourceforge.net
To: Drew Adams <drew.adams@oracle.com>
Cc: 25357@debbugs.gnu.org
Subject: bug#25357: 25.1; Doc for `cursor-sensor-mode' (and modes generally)
Date: Wed, 04 Jan 2017 22:45:17 -0500 [thread overview]
Message-ID: <878tqq5fw2.fsf@users.sourceforge.net> (raw)
In-Reply-To: <a2675f96-d075-408b-81e2-3a3045148b76@default> (Drew Adams's message of "Wed, 4 Jan 2017 13:02:42 -0800 (PST)")
[-- Attachment #1: Type: text/plain, Size: 341 bytes --]
Drew Adams <drew.adams@oracle.com> writes:
>
> I even think it would help to emphasize that "one" - not zero.
> IOW, you cannot turn off a major mode without turning on another one.
Sure, here's a patch to the manuals to clarify that. I don't think
explaining about the relationship between M-x and Lisp functions again
is needed though.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 3315 bytes --]
From ebea8363cc02fded1a98d0fffcda460faee9e72d Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
Date: Wed, 4 Jan 2017 20:35:13 -0500
Subject: [PATCH] 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).
---
doc/emacs/modes.texi | 5 ++++-
doc/lispref/modes.texi | 20 +++++++++++---------
2 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/doc/emacs/modes.texi b/doc/emacs/modes.texi
index 0acb82d..6b8bd92 100644
--- a/doc/emacs/modes.texi
+++ b/doc/emacs/modes.texi
@@ -66,7 +66,10 @@ Major Modes
first visit a file or create a buffer (@pxref{Choosing Modes}). You
can explicitly select a new major mode by using an @kbd{M-x} command.
Take the name of the mode and add @code{-mode} to get the name of the
-command to select that mode (e.g., @kbd{M-x lisp-mode} enters Lisp mode).
+command to select that mode (e.g., @kbd{M-x lisp-mode} enters Lisp
+mode). Since every buffer has exactly one major mode, there is no way
+to ``turn off'' a major mode, instead you must switch to a different
+one.
@vindex major-mode
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 b24ab36..3704e03 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -7,11 +7,11 @@ Modes
@chapter Major and Minor Modes
@cindex mode
- A @dfn{mode} is a set of definitions that customize Emacs and can be
-turned on and off while you edit. There are two varieties of modes:
-@dfn{major modes}, which are mutually exclusive and used for editing
-particular kinds of text, and @dfn{minor modes}, which provide features
-that users can enable individually.
+ A @dfn{mode} is a set of definitions that customize Emacs' behavior
+in useful ways. There are two varieties of modes: @dfn{minor modes},
+which provide features that users can turn on and off while editing.
+And @dfn{major modes}, which are used for editing a particular kind of
+text. Each buffer has exactly one @dfn{major mode}.
This chapter describes how to write both major and minor modes, how to
indicate them in the mode line, and how they run hooks supplied by the
@@ -197,11 +197,13 @@ Major Modes
@cindex major mode command
Major modes specialize Emacs for editing particular kinds of text.
-Each buffer has one major mode at a time. Every major mode is
+Each buffer has exactly one major mode at a time. Every major mode is
associated with a @dfn{major mode command}, whose name should end in
-@samp{-mode}. This command takes care of switching to that mode in the
-current buffer, by setting various buffer-local variables such as a
-local keymap. @xref{Major Mode Conventions}.
+@samp{-mode}. This command takes care of switching to that mode in
+the current buffer, by setting various buffer-local variables such as
+a local keymap. @xref{Major Mode Conventions}. Note that unlike
+minor modes, the only way to ``turn off'' a major mode is to switch to
+a different one.
The least specialized major mode is called @dfn{Fundamental mode},
which has no mode-specific definitions or variable settings.
--
2.9.3
next prev parent reply other threads:[~2017-01-05 3:45 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <<de93b37f-921f-4a6e-9f29-a357cf6b1c55@default>
[not found] ` <<83o9zmemfo.fsf@gnu.org>
2017-01-04 18:07 ` bug#25357: 25.1; Doc for `cursor-sensor-mode' (and modes generally) Drew Adams
2017-01-04 18:56 ` Noam Postavsky
2017-01-04 19:06 ` Drew Adams
2017-01-04 19:27 ` Noam Postavsky
2017-01-04 21:02 ` Drew Adams
2017-01-05 3:45 ` npostavs [this message]
2017-01-05 4:29 ` Drew Adams
2017-01-06 3:58 ` npostavs
2017-01-06 5:50 ` Drew Adams
2017-01-06 7:57 ` Eli Zaretskii
2017-01-08 17:15 ` npostavs
2017-01-05 15:28 ` Eli Zaretskii
[not found] ` <<83mvf6em4p.fsf@gnu.org>
2017-01-04 18:08 ` Drew Adams
[not found] <<9ad8b225-73da-4533-a676-b0f8e84e54ca@default>
[not found] ` <<CAM-tV--ymvk7wQ9VyBCSse1fQQqVxoH9htTnZdHmZGZYeH543A@mail.gmail.com>
[not found] ` <<a9c8bee8-1564-4bd3-81c4-2753a14e53a9@default>
[not found] ` <<CAM-tV-_+WRvc6+jZpHgywOx0XdgPUxdqyGc40cJ+R2s8ZyL=TQ@mail.gmail.com>
[not found] ` <<a2675f96-d075-408b-81e2-3a3045148b76@default>
[not found] ` <<878tqq5fw2.fsf@users.sourceforge.net>
[not found] ` <<678f8299-e6e8-4b08-a412-bf367194f6d7@default>
[not found] ` <<87a8b44z72.fsf@users.sourceforge.net>
[not found] ` <<bcd0da83-e266-4c27-a678-d429f07d7d58@default>
[not found] ` <<83lguod3i4.fsf@gnu.org>
2017-01-06 14:50 ` Drew Adams
2017-01-04 17:44 Drew Adams
2017-01-04 17:59 ` Eli Zaretskii
2017-01-04 18:05 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878tqq5fw2.fsf@users.sourceforge.net \
--to=npostavs@users.sourceforge.net \
--cc=25357@debbugs.gnu.org \
--cc=drew.adams@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.