unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Noam Postavsky <npostavs@users.sourceforge.net>
Cc: 25357@debbugs.gnu.org
Subject: bug#25357: 25.1; Doc for `cursor-sensor-mode' (and modes generally)
Date: Wed, 4 Jan 2017 13:02:42 -0800 (PST)	[thread overview]
Message-ID: <a2675f96-d075-408b-81e2-3a3045148b76@default> (raw)
In-Reply-To: <CAM-tV-_+WRvc6+jZpHgywOx0XdgPUxdqyGc40cJ+R2s8ZyL=TQ@mail.gmail.com>

> > 2. (This bug) The manuals should document how to turn on/off a major mode
> > using Lisp.  Please retitle this bug appropriately.
> 
> `(emacs) Major Modes' says
> 
>     You can explicitly select a new major mode by using an M-x
> command. Take the name of the mode and add -mode to get the name of
> the command to select that mode (e.g., M-x lisp-mode enters Lisp
> mode).
> 
> Do you really think it's necessary to explain here how evaluating
> (foo-mode) is equivalent to running M-x foo-mode?

Yes, absolutely I do.

And how to turn it OFF using Lisp.  Yes, the answer is to just turn
on some other major mode.  But how are users to know that if we don't
tell them?

http://emacs.stackexchange.com/q/29813/105

> `(elisp) Major Modes' says
> 
>     Major modes specialize Emacs for editing particular kinds of text.
> Each buffer has one major mode at a time. Every major mode is
> associated with a major mode command, whose name should end in
> ‘-mode’. This command takes care of switching to that mode in the
> current buffer

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.

> Do you really think it's necessary to explain how to call a command
> from elisp here? The first hit in the index for `command' gives
> 
>     command
> 
>     An object which can be invoked via the command-execute primitive,
> usually due to the user typing in a key sequence bound to that
> command. See Interactive Call. A command is usually a function; if the
> function is written in Lisp, it is made into a command by an
> interactive form in the function definition (see Defining Commands).
> Commands that are functions can also be called from Lisp expressions,
> just like other functions.

Yes, I do think it's necessary - see above.

It is sufficient to explain this once (in each manual, I think - or
at least cross-reference the Elisp explanation from the Emacs manual).

I don't think it is ever really explained anywhere.  And the way minor
and major modes work in this regard is quite different.  There is
always some major mode that is "on" - only one at a time.  There can
be many minor modes that are on at the same time.

It will already help a lot if the doc strings of modes make clear
whether a mode is a major or a minor mode.





  reply	other threads:[~2017-01-04 21:02 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 [this message]
2017-01-05  3:45             ` npostavs
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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a2675f96-d075-408b-81e2-3a3045148b76@default \
    --to=drew.adams@oracle.com \
    --cc=25357@debbugs.gnu.org \
    --cc=npostavs@users.sourceforge.net \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).