unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: "Daniel Martín" <mardani29@yahoo.es>
Cc: 50801@debbugs.gnu.org
Subject: bug#50801: 28.0.50; Emacs manual about file variables doesn't mention that major modes shouldn't end in "-mode"
Date: Sat, 25 Sep 2021 10:46:12 -0700	[thread overview]
Message-ID: <CADwFkmnZ82MbqeNJZnx1pTriyV5K-Wcc4vOsLbzb-6tiYa4Xag@mail.gmail.com> (raw)
In-Reply-To: <m1pmswzsda.fsf@yahoo.es> ("Daniel Martín"'s message of "Sat, 25 Sep 2021 15:39:45 +0200")

Daniel Martín <mardani29@yahoo.es> writes:

> I'm reviewing the manuals for the upcoming Emacs 28 and I have a couple
> of minor suggestions for node "49.2.4.1 Specifying File Variables":

That is extremely useful, thank you very much for working on this.

(BTW, you can press `w' in info to get a reference like "(emacs)
Specifying File Variables".  This is not super important, but a handy
feature to know about, as you can then `M-: (info "...")' and get to
that section quickly.)

> The node doesn't explictly mention the crucial information that in
> 'mode: MODENAME' 'MODENAME' must not end in "-mode".  It's true that
> there's an example down there that says "mode: Lisp", so users may infer
> that you don't need to spell the major mode with "-mode", but I thought
> it may be better to be explicit about in the manual.

Fully agreed.  Perhaps something like this?

diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index d12033f841..d5f18fff35 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -1084,8 +1084,9 @@ Specifying File Variables
 @noindent
 You can specify any number of variable/value pairs in this way, each
 pair with a colon and semicolon.  The special variable/value pair
-@code{mode: @var{modename};}, if present, specifies a major mode.  The
-@var{value}s are used literally, and not evaluated.
+@code{mode: @var{modename};}, if present, specifies a major mode
+(excluding the ``-mode'' part).  The @var{value}s are used literally,
+and not evaluated.

 @findex add-file-local-variable-prop-line
 @findex delete-file-local-variable-prop-line

> Another suggestion I have is that the manual doesn't mention that
> something like "-*- C++ -*-" (that is, omitting the "mode" keyword) is
> also supported.  Many free software projects have traditionally been
> using "-* C++ -*" in their C++ header files to make Emacs distinguish
> them from plain C files.  See also src/epaths.in in the Emacs
> repository, among others.  I see this used by Jim Blandy since 1992 at
> least, but I don't really know if a) it's really a stable way to declare
> a file-local mode, and we may lack the historical info to answer that,
> and b) it's worth mentioning it in the manual.

I can't remember the details, but I believe that this form is considered
obsolete and/or problematic.  So I think it's fine to not document it.





  reply	other threads:[~2021-09-25 17:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m1pmswzsda.fsf.ref@yahoo.es>
2021-09-25 13:39 ` bug#50801: 28.0.50; Emacs manual about file variables doesn't mention that major modes shouldn't end in "-mode" Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-25 17:46   ` Stefan Kangas [this message]
2021-09-25 18:22     ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-26  6:59     ` Lars Ingebrigtsen
2021-09-26 10:05       ` Stefan Kangas
2021-09-26  7:09     ` Andreas Schwab
2021-09-27 22:34       ` Richard Stallman

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=CADwFkmnZ82MbqeNJZnx1pTriyV5K-Wcc4vOsLbzb-6tiYa4Xag@mail.gmail.com \
    --to=stefan@marxist.se \
    --cc=50801@debbugs.gnu.org \
    --cc=mardani29@yahoo.es \
    /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).