Subject: bug#22564: Fundamental mode isn't fundamental enough.

From: Eli Zaretskii <[email-masked]>
Date: Thu, 05 May 2022 08:43:21 +0300

> From: Richard Stallman <[email-masked]>
> Cc: [email-masked], [email-masked], [email-masked],
> 	[email-masked], [email-masked], [email-masked]
> Date: Wed, 04 May 2022 18:49:15 -0400
> 
>   > That is only important to document if enough important major modes
>   > don't customize it.
> 
> Fundamental mode is one -- and that's enough.  It is the default
> mode if you visit a file whose name has no special extension.
> For instance, `foo'.

I disagree with it being important, as I already said.  But I don't
think this aspect is important enough to keep arguing about it, see
below.

> What DOES Electric Indent mode do in Fundamental mode?
> Nothing?
> 
> I am starting to think that is what it does.

No, it isn't "nothing".  Once again, I already gave an example of what
it does in Fundamental.  Here is that example repeated:

  As a simple example, try this in fundamental mode, on an empty line:

    C-u 10 SPC C-u 10 x RET

>   > Sorry, I disagree that Fundamental mode is important.  Its being the
>   > default doesn't mean users frequently see it, not at all.
> 
> I do.  And not for any special reason.  If I want to put some notes
> in a file, I give it a simple name.  I don't add an extension just to
> get some other mode.  (Do you?)  I find that Fundamental mode is fine.

I don't add extensions, but files edited in Emacs frequently do have
extensions and usually have some major mode that is not Fundamental.

So I don't think your use pattern is common.

Nevertheless, if we describe better what the newline and similar
characters do in electric-indent-mode, that would cover Fundamental as
well, no need to do something special about Fundamental, nor to argue
about its importance.

>     > The electric characters normally include the newline, but can also
>     > include other characters as needed by the major mode; see
>     > `electric-indent-chars' for the actual list.
> 
> Adding that would be useful, but it isn't enough because it doesn't
> answer that crucial question.

Which question was that?

>   > > How about adding, "Typically the major mode controls what reindenting does."?
> 
>   > I'm sorry, I don't think I understand how saying that would help.
>   > Unless a person knows "what reindenting does" (or even what is
>   > "reindenting"), this leaves the issue as obscure as it was before.
> 
> The Emacs Manual does not define "reindenting".  It is not exactly
> synonymous with "indenting", so I think this needs clarification 
> in the manual itself.
> 
> Then the doc string of Electric Indent mode could refer to the
> appropriate node in the Emacs Manual.
> 
> I think reindenting means this:
> 
>   In major modes where indenting a line idempotently adjusts its
>   indentation to what is called for by the line's contents and
>   context, "reindenting" the line is the same as indenting it.
> 
>   In other situations, the concept of "reindenting" is not
>   really applicable, so commands that should "reindent" actually
>   do nothing or have some other definion.
> 
> Is this entirely correct?

I don't know.  But I think it is better to say that this mode
automatically indents the current line according to the context (the
surrounding lines) and the rules of the major mode.  After all, the
mode's name is "Electric Indent mode", not "Electric Reindent mode".