GNU bug report logs -
#50801
28.0.50; Emacs manual about file variables doesn't mention that major modes shouldn't end in "-mode"
Previous Next
Reported by: Daniel Martín <mardani29 <at> yahoo.es>
Date: Sat, 25 Sep 2021 13:40:01 UTC
Severity: normal
Tags: fixed
Found in version 28.0.50
Fixed in version 28.1
Done: Stefan Kangas <stefan <at> marxist.se>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 50801 <at> debbugs.gnu.org (full text, mbox):
Daniel Martín <mardani29 <at> 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.
This bug report was last modified 3 years and 242 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.