[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] trunk r116461: Connect electric-indent-mode up with CC

From: David Kastrup
Subject: Re: [Emacs-diffs] trunk r116461: Connect electric-indent-mode up with CC Mode. Bug #15478.
Date: Mon, 24 Mar 2014 18:29:53 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> From: Dmitry Gutov <address@hidden>
>> Date: Mon, 24 Mar 2014 11:08:43 +0200
>> Cc: Alan Mackenzie <address@hidden>, Stefan <address@hidden>,
>>      address@hidden
>> FWIW, effectively doing `reindent-then-newline-and-indent' on RET also
>> seems gratuitous to me. When I reach the end of a line, usually text on
>> that line is already indented correctly (automatically, or through me
>> typing TAB manually), so the first `reindent' does nothing, unless the
>> indentation function was wrong about the current line in the first
>> place, and I had to adjust it manually.
> This might be mostly true, but not always.  E.g., what if you delete a
> character whose electricity caused the line to be indented in some
> special way, when that character was inserted earlier?

I _expect_ to have to type TAB when deleting electric characters.

> After deleting that character, the line might no longer be indented
> correctly.

Really, the only actually valid argument so far is Stefan's of typing

end M-x newline-and-indent RET

when in pascal and on

   a := 7.0

since it is

   end a:= 7.0


a := 7.0

except, of course, that it is actually

a := 7.0

after all even in Pascal.  And pressing TAB on

   end;a := 7.0

still will do the right thing.  So I don't really think the "inserting
newline will actually cause a different indentation for the line above"
case is relevant enough to fall over backwards for it.

David Kastrup

reply via email to

[Prev in Thread] Current Thread [Next in Thread]