From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#25357: 25.1; Doc for `cursor-sensor-mode' (and modes generally) Date: Wed, 04 Jan 2017 22:45:17 -0500 Message-ID: <878tqq5fw2.fsf@users.sourceforge.net> References: <9ad8b225-73da-4533-a676-b0f8e84e54ca@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1483587928 4245 195.159.176.226 (5 Jan 2017 03:45:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 5 Jan 2017 03:45:28 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: 25357@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jan 05 04:45:22 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cOyzG-0007Dl-P8 for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Jan 2017 04:45:11 +0100 Original-Received: from localhost ([::1]:43494 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cOyzH-0000pL-GX for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Jan 2017 22:45:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cOyzB-0000nv-HV for bug-gnu-emacs@gnu.org; Wed, 04 Jan 2017 22:45:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cOyz8-0006d3-Fx for bug-gnu-emacs@gnu.org; Wed, 04 Jan 2017 22:45:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54475) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cOyz8-0006cx-CZ for bug-gnu-emacs@gnu.org; Wed, 04 Jan 2017 22:45:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cOyz8-0002id-0j for bug-gnu-emacs@gnu.org; Wed, 04 Jan 2017 22:45:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Jan 2017 03:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25357 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25357-submit@debbugs.gnu.org id=B25357.148358786410385 (code B ref 25357); Thu, 05 Jan 2017 03:45:01 +0000 Original-Received: (at 25357) by debbugs.gnu.org; 5 Jan 2017 03:44:24 +0000 Original-Received: from localhost ([127.0.0.1]:41641 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cOyyW-0002hR-8X for submit@debbugs.gnu.org; Wed, 04 Jan 2017 22:44:24 -0500 Original-Received: from mail-io0-f174.google.com ([209.85.223.174]:32978) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cOyyT-0002hE-GJ for 25357@debbugs.gnu.org; Wed, 04 Jan 2017 22:44:21 -0500 Original-Received: by mail-io0-f174.google.com with SMTP id v96so65670ioi.0 for <25357@debbugs.gnu.org>; Wed, 04 Jan 2017 19:44:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=ZD53WptVQqerUPtnTmMvE4P2DIpKHSA2wBiCPmRfhcY=; b=YXJN1QktGMfPQw512JihA9FKx65uVtIKBs0K4otJvm203d3rsYT0wf7sw5hyM7cyVH YwtYHDux7frFJxh1xYuc89L/9dT0jx+JpAXsYC78G8o76M5dTIVNC6EtNbsFX84ijIiP 1yByKWIdD3Qd36VxFi754J4OH/S2G5IoL2t6L7abEO5woiE+7Wjc0spxllecLljdhy9b SQxmH+evpAV3aHg6aq4e4s7gW4tmkyqTr+nHg/wh8KXe+2ZCGGlNgGPWSOm+wJ2CW7ii zufLxnQ32Shc0jFi/+LSKY4cH6N7kcSDK/veJve7aYejUqNMNzM1cmV5Y9MnMLh6ySwF Rheg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=ZD53WptVQqerUPtnTmMvE4P2DIpKHSA2wBiCPmRfhcY=; b=ZEBHEqiGxYcZZdYLly4WIknAk9uxuvH09F4QzL8mGnoDvRn0+UJOMX96U70wDJYVHf D9RkpB8HoiS9I8+r+hHX4qv+v4qvhKP9h0J0qCoMxHBcVYa5VgmMzDQmPrsvp6SJWE4D v0cWmI9GdN6SeJsokHZAKz7By7E1Ym5U7cj9/0xZgGjZ9kdU/6OCuq1HBt2f/qlQWor4 wsdwYvDSEqLaI30RUvUg+VJRTPMjgfqP/jNO+VPY4DpA/FOK9JDvVgdu4mNfjbewMet0 nPxq9GHGUaaczyxVsVEe0HDPxJxrRgmtiWvBIUNPq+85ELlK3vZfJ3d+Mx1zYEDtFM99 ruew== X-Gm-Message-State: AIkVDXINPOQxzOoen2ygrKirShaKT6G2OxyQ4dLBKqOGBM1yJa1H6wjDjsAsDgvu3dNShQ== X-Received: by 10.107.17.101 with SMTP id z98mr17426040ioi.226.1483587855950; Wed, 04 Jan 2017 19:44:15 -0800 (PST) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id 9sm38515429itv.0.2017.01.04.19.44.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Jan 2017 19:44:14 -0800 (PST) In-Reply-To: (Drew Adams's message of "Wed, 4 Jan 2017 13:02:42 -0800 (PST)") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:127770 Archived-At: --=-=-= Content-Type: text/plain Drew Adams 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. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Clarify-major-mode-switching.patch Content-Description: patch >From ebea8363cc02fded1a98d0fffcda460faee9e72d Mon Sep 17 00:00:00 2001 From: Noam Postavsky 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 --=-=-=--