GNU bug report logs - #16155
electric indent gripes

Previous Next

Package: emacs;

Reported by: rms <at> gnu.org

Date: Sun, 15 Dec 2013 11:49:01 UTC

Severity: minor

Merged with 16156

Found in version 24.3.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Alan Mackenzie <acm <at> muc.de>
To: gnu-emacs-bug <at> moderators.isc.org
Subject: bug#16155: 24.3.50;
Date: Sun, 15 Dec 2013 20:01:29 +0000 (UTC)
Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:
> Richard Stallman <rms <at> gnu.org> wrote:
>> I don't ever like having newline indent.

I agree.  `newline' should never indent the new line.  `newline-and-indent'
should always indent the new line.

>> It should be a minor mode,

> It is a minor mode.  Called electric-indent-mode, and no enabled by default.
> See NEWS.

electric-indent-mode _is_ enabled by default in the current trunk.  I've
just updated, built, and tried it.

>> and the documentation of `newline' should explain how to easily turn
>> this off.

> The docstring does mention the indentation behavior, with a link to
> electric-indent-mode.

What the docstring says is this:

    A non-nil INTERACTIVE argument means to run the `post-self-insert-hook',
    which by default will also indent the line (see `electric-indent-mode').

Presumably the invocation of `newline' by pressing the RET key leaves
INTERACTIVE set to nil.  Nevertheless, the unwanted indentation happened.

This is bad documentation, since it describes the internal workings rather
than the coherent functionality.  As a user of `newline', I shouldn't have
to know about `post-self-insert-hook', never mind having to try to figure
out which way to set INTERACTIVE.

I can't make out what that bit of the doc string means without a
considerable investment of intellectual effort.

Again, the question: why should `newline' indent when we've got the specific
command `newline-and-indent'?  I think a good way to resolve the current
confusion would be to restrict electric-indent-mode to indenting ONLY the
line in which the character is typed, and leaving the indentation of any
new line to `newline-and-indent'.

>        Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).





This bug report was last modified 3 years and 20 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.