help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: indentation


From: Stefan Monnier
Subject: Re: indentation
Date: Tue, 27 Apr 2021 16:31:05 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> I have a comment starting with ! in column  1, and a F90 code on next line
> starting around column 7. When I hit enter inside the comment, the rest of
> the comment is now on new line and aligned according to the *next* line (the
> F90 code).

Without knowing more about the content of your code and comment (and
F90's syntax) I'm not sure if column 7 is the right choice for the
indentation of the new line, but it sounds reasonable.

> Moreover the start of the comment, instead of left alone -- is
> equally aligned too, i.e. the ! moved to around col. 7.

I expect the same happens if you just hit TAB instead of RET, right?

If so, the problem is not directly linked to the electric-indent-mode,
and is instead either a bug in f90-mode's indentation code or maybe it's
controlled by a config var in `f90-mode` (since it sounds to me that
comments in column 1 are an old F77 convention which you may or may not
want to follow in F90 code).

> This all happens even when above the comment was another comment
> starting e.g. in col. 1, not another F90 code, meaning that the
> indentation is governed by what follows not precedes.

It's probably neither: the indentation rules probably looks at preceding
*code* rather than preceding comments ;-)

> Crazines squared, isn't it?

There's always some twisted logic behind craziness.


        Stefan




reply via email to

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