emacs-devel
[Top][All Lists]
Advanced

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

Re: fortran indentation bug?


From: Glenn Morris
Subject: Re: fortran indentation bug?
Date: Tue, 10 Jun 2008 19:37:34 -0400
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

Miles Bader wrote:

> The following program fragment is indented by fortran-mode, with 
> `fortran-check-all-num-for-matching-do' set to t.
>
> Isn't the statement on the numbered line part of the DO body, and so
> should be indented along with the body?
>
>       DO 110 J=1,NZ
>          DTEMP=GRID(IEXT(J))
>          DTEMP=DCOS(DTEMP*PI2)
>  110  X(J)=DTEMP

The numbered statement is part of the loop body, yes.

I guess fortran-mode indents under the assumption that most people
using numbered DO loops will use CONTINUE (as a proxy for END DO)
rather than an actual code statement to close the loop, in which case
the current indentation is the normal one people tend to use.

I might try and change it to do a different thing for non-CONTINUEs,
but it's a very old format (insert Fortran joke of your choice here).
END DO has been around since 1978.




reply via email to

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