unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: rms@gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
Cc: acm@muc.de, larsi@gnus.org, johnw@gnu.org, 22564@debbugs.gnu.org,
	rgm@gnu.org
Subject: bug#22564: Fundamental mode isn't fundamental enough.
Date: Sun, 01 May 2022 09:16:08 +0300	[thread overview]
Message-ID: <83h7697p7b.fsf@gnu.org> (raw)
In-Reply-To: <E1nkylj-0007LR-Ir@fencepost.gnu.org> (message from Richard Stallman on Sat, 30 Apr 2022 21:53:03 -0400)

> From: Richard Stallman <rms@gnu.org>
> Date: Sat, 30 Apr 2022 21:53:03 -0400
> Cc: jwiegley@gmail.com, johnw@gnu.org, 22564@debbugs.gnu.org, acm@muc.de,
>  rgm@gnu.org
> 
> The doc string of `electric-indent-mode' is deficient -- it fails to say
> what it will concretely do in an uncustomized Emacs.  All it says is this:
> 
>     When enabled, this reindents whenever the hook ‘electric-indent-functions’
>     returns non-nil, or if you insert a character from ‘electric-indent-chars’.
> 
> To see what that concretely does, you have to look at those variables.
> That's asking too much, for a beginner.

The difficulty is that the hook and the characters vary significantly
from major mode to major mode.  The latter one, for example, can in
some modes include characters that are very unintuitive, like ':'.

We could say something like

  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.

Would this help?

> This doc string should say where to find the specifics of what it
> does in Fundametal mode.

Why is that important?  Fundamental mode is not supposed to be used
frequently by Emacs users, so why single out that mode, and why
specifically for this minor mode?

> I looked at them and found that `electric-indent-chars' has TAB (10) in it.
> However, TAB has a global binding, `indent-for-tab-command'.

10 is not TAB, it's C-j (newline).

> What, then, does Electric Indent mode alter in Fundamental mode?  Does
> it alter anything?

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

  C-u 10 SPC C-u 10 x C-j

> Was there a concrete motive for proposing to disable it in
> Fundamental mode?

We enabled it by default in every mode (in Emacs 24), so Fundamental
mode is also affected.

I don't remember the motives; perhaps Stefan (CC'ed) does.

> We need to help users find out these
> things.  Is there a way, other than by reading electric.el?

Not really.

> The doc string also fails to say what, concretely, reindenting does, or even
> what controls what reindenting does.  So it needs a lot of improvement.

The problem is that this feature is implemented with so many opaque
hooks and variables which modes can set and override that it's hard to
describe its workings in a way that is both accurate and general
enough to cover all the modes which employ those hooks and those
variables.

The workhorse is electric-indent-post-self-insert-function; please
take a look at what it does and how, and I think any improvement of
the doc string based on what you see there (and the many rabbit holes
down which it will lead you) will be most welcome.





  reply	other threads:[~2022-05-01  6:16 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-05 12:55 bug#22564: Fundamental mode isn't fundamental enough Alan Mackenzie
2016-02-05 14:46 ` Eli Zaretskii
2016-02-05 15:13   ` Alan Mackenzie
2016-02-05 15:34     ` Mark Oteiza
2016-02-05 15:38       ` Drew Adams
2016-02-05 17:57         ` Marcin Borkowski
2016-02-05 19:59           ` Drew Adams
2016-02-05 19:26     ` Eli Zaretskii
2016-02-05 20:18       ` Marcin Borkowski
2016-02-06 19:48     ` Richard Stallman
2016-02-05 20:23 ` Glenn Morris
2016-02-05 21:43   ` Glenn Morris
2016-02-05 21:53   ` Alan Mackenzie
2016-02-17  2:50     ` John Wiegley
2022-04-27 14:39       ` Lars Ingebrigtsen
2022-05-01  1:53         ` Richard Stallman
2022-05-01  6:16           ` Eli Zaretskii [this message]
2022-05-02 23:47             ` Richard Stallman
2022-05-03  7:03               ` Andreas Röhler
2022-05-03 14:28                 ` Drew Adams
2022-05-03 17:00               ` Eli Zaretskii
2022-05-04 22:49                 ` Richard Stallman
2022-05-05  5:43                   ` Eli Zaretskii
2022-05-05 11:02                     ` Andreas Röhler
2022-05-05 16:17                       ` Eli Zaretskii
2022-05-05 18:34                         ` Andreas Röhler
2022-05-06 23:20                     ` Richard Stallman
2022-05-07  6:30                       ` Eli Zaretskii
2022-05-07 23:08                         ` Richard Stallman
     [not found] ` <mailman.3748.1454702408.843.bug-gnu-emacs@gnu.org>
2016-02-06 11:06   ` Alan Mackenzie
2016-02-07 18:33     ` Richard Stallman
     [not found] ` <mailman.3712.1454686507.843.bug-gnu-emacs@gnu.org>
2016-02-06 11:21   ` Alan Mackenzie
2016-02-06 14:36     ` Mark Oteiza
2016-02-06 16:59 ` Achim Gratz
2016-02-07 19:09   ` Eli Zaretskii
2016-02-07 21:02 ` Achim Gratz
2016-02-07 21:08   ` Eli Zaretskii
2016-02-08 19:39 ` Achim Gratz
2016-02-08 20:05   ` Eli Zaretskii
2016-02-08 20:18 ` Achim Gratz
2016-02-08 20:53   ` Eli Zaretskii
2016-02-08 21:01 ` Achim Gratz
2016-02-09  3:31   ` Eli Zaretskii
     [not found] <<20160205125559.GC7727@acm.fritz.box>
     [not found] ` <<834mdnusem.fsf@gnu.org>
2016-02-05 15:36   ` Drew Adams
     [not found] <<mailman.3748.1454702408.843.bug-gnu-emacs@gnu.org>
     [not found] ` <<20160206110601.6095.qmail@mail.muc.de>
2016-02-06 15:57   ` Drew Adams
     [not found]   ` <<E1aSU9T-0002aS-5O@fencepost.gnu.org>
2016-02-07 19:43     ` Drew Adams

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=83h7697p7b.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=22564@debbugs.gnu.org \
    --cc=acm@muc.de \
    --cc=johnw@gnu.org \
    --cc=larsi@gnus.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rgm@gnu.org \
    --cc=rms@gnu.org \
    /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).