[Top][All Lists]

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

Re: simple editor required

From: Kai Großjohann
Subject: Re: simple editor required
Date: Tue, 24 Jun 2003 17:25:49 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

"Paul Edwards" <address@hidden> writes:

> "Kai Großjohann" <address@hidden> wrote in message news:address@hidden
>> "Paul Edwards" <address@hidden> writes:
>> > It is.  The "maybe" means it doesn't always indent.  And it
>> > shouldn't, when it is quite obvious the user already has text
>> > on that line, and doesn't need it indented.  If they had wanted
>> > it indented, they would have pressed tab, not enter.
>> Huh?  I find it really convenient that I can just hit TAB (my binding
>> for indent-relative) at the beginning of a line to increase its
>> indentation.
> But that's what I just said.  You'd press TAB, not enter.
> TAB is logical, enter is not.  No-one expects enter, at
> the beginning of a line, to go to a newline and indent
> the existing text.  enter doesn't do that sort of thing.  It
> does start a newline, beginning under the previous one
> though.  That is logical and reasonable.

But the fact that RET does newline and then does like TAB is your own
customization!  So you can't blame Emacs that it is doing what you
told it to do.

That said, I understand that the behavior of RET that you see in
text-mode is not the best behavior.  Clearly it should be changed.

>> > Indentation is meant to apply to a NEW line, not an existing
>> > line.  It's meant to put blanks there ready for you to optionally
>> > start typing real characters, and then delete them later if they
>> > are not already there.
>> I use it for existing lines, too.
> You don't hit enter at the beginning of a line of text, and expect
> it to insert a newline and indent the current text.

Actually, I've never minded until now.

But I see how it would be strange in text mode.  But in text mode,
indentation is not done very often.  I have told Emacs that RET
invokes newline-and-indent in programming modes (C, Java, Perl, ...)
whereas it does just newline in other modes, like text.

[time passes]

Oh, now I remember that I sent a bug report about newline-and-indent
in text mode, some years back.  Whee.  Yeah.  I guess Emacs just
doesn't like you to use newline-and-indent in text-like modes :-)

FWIW, I get by with just newline quite nicely.  For the kind of text
I write, indentation is not often required.

>> > It is not meant to trash existing lines!  Nor is it meant to get
>> > so confused on the first line, that it just indents 8 spaces, even
>> > when my tab setting is 4, and there's not even a prior line to
>> > inspire it to do something that silly.
>> That might be a misconfiguration on your part.  (Not that I blame you;
>> the subject is complex.)  indent-relative looks at tab-stop-list and
>> configuring tab-width is not going to have the effect you might
>> expect.  (tab-width refers to how tab characters in the text are
>> displayed, but the TAB key does not always insert tab characters.)
> So it sometimes (ie at beginning of file) looks at tab-stop-list,
> and everywhere else it looks at the indentation of the previous
> line.  Seems very strange to me.

Hm.  I was going to answer that indent-relative does that, but in
fact indent-relative-maybe also has this strange behavior in the
first line of the file.  I think that might be a bug.

Note that indent-relative goes by tab-stop-list after the end of the
previous line, whereas indent-relative-maybe does not do that.
This line is not blank.

reply via email to

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