From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#3729: f90-mode indentation Date: Tue, 30 Jun 2009 21:51:12 -0400 Message-ID: References: Reply-To: Glenn Morris , 3729@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1246413491 2564 80.91.229.12 (1 Jul 2009 01:58:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 1 Jul 2009 01:58:11 +0000 (UTC) Cc: 3729@emacsbugs.donarmstrong.com To: Evangelos Evangelou Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 01 03:58:04 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MLp5I-0007kD-46 for geb-bug-gnu-emacs@m.gmane.org; Wed, 01 Jul 2009 03:58:04 +0200 Original-Received: from localhost ([127.0.0.1]:38099 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MLp5H-0006qt-Lq for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Jun 2009 21:58:03 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MLp4n-0006Jq-O4 for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2009 21:57:33 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MLp4i-0006FP-DK for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2009 21:57:32 -0400 Original-Received: from [199.232.76.173] (port=38163 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MLp4i-0006FD-6G for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2009 21:57:28 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:39217) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MLp4h-0000b8-Br for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2009 21:57:27 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n611vOaG011503; Tue, 30 Jun 2009 18:57:25 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n611t60K010907; Tue, 30 Jun 2009 18:55:06 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Glenn Morris Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 01 Jul 2009 01:55:06 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 3729 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 3729-submit@emacsbugs.donarmstrong.com id=B3729.124641308310684 (code B ref 3729); Wed, 01 Jul 2009 01:55:06 +0000 Original-Received: (at 3729) by emacsbugs.donarmstrong.com; 1 Jul 2009 01:51:23 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n611pDKq010667; Tue, 30 Jun 2009 18:51:14 -0700 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1MLoye-0004fe-OE; Tue, 30 Jun 2009 21:51:12 -0400 X-Spook: supercomputer SAPO ASPIC eavesdropping digicash afsatcom X-Ran: \_|][t0)S|Tup,H+/;H~A!-C/n^BL+[y}u/Kj"TXeG.s8O4^^YL>P0eh0pyvc'o+;=h}z? X-Hue: black X-Attribution: GM User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Tue, 30 Jun 2009 21:57:32 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:29118 Archived-At: reassign 3729 emacs,f90 tags 3729 wontfix stop Evangelos Evangelou wrote: > The f90-mode indents by two spaces the code when the first non-comment > line starts with include. For example, starting emacs with -Q flag and > typing the following in f90-mode > > !! Comment > > include "file.f90" > > subroutine test (x) > real x > x = x+1. > return > end subroutine test > > pointing in the first line and then running f90-indent-subprogram will > indent all lines by 2. This is not the case (the correct) if the line > > include "file.f90" > > was missing. I think there shouldn't be any indentation. I think it's not that simple. The reason is, there is no need for a leading "program" statement in Fortran. If there is any non-comment line at the "top-level" (outside of a function, subroutine, etc) at the start of the file, f90 mode assumes it is dealing with a program without an explicit start. Consider the following two cases: 1) !! Program without an explicit PROGRAM statement. !! Everything from the start of the file is implicitly inside the program. include "stuff.f90" write (*,*) 'hi' end program 2) !! Program with an explicit program statement. !! This comment is outside the program program foo !! This comment is inside the program. include "stuff.f90" write (*,*) 'hi' end program foo The present behaviour is designed to make these two cases indent in the same way. The behaviour is not specific to "include"; any non-comment code will make F90 mode think this is a program. I don't see any simple way to distinguish between your example and case 1 above. So I think the behaviour of f90-mode is unlikely to change in this regard.