From unknown Mon Jun 23 07:49:00 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#3729: f90-mode indentation Reply-To: Evangelos Evangelou , 3729@debbugs.gnu.org Resent-From: Evangelos Evangelou Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 30 Jun 2009 12:35:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: report 3729 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.12463650722242 (code B ref -1); Tue, 30 Jun 2009 12:35:06 +0000 Received: (at submit) by emacsbugs.donarmstrong.com; 30 Jun 2009 12:31:12 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n5UCV7se002237 for ; Tue, 30 Jun 2009 05:31:08 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MLcUM-0006Fb-OH for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2009 08:31:06 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MLcUH-0006Aa-AT for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2009 08:31:05 -0400 Received: from [199.232.76.173] (port=52855 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MLcUH-0006AH-1a for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2009 08:31:01 -0400 Received: from mxp2.isis.unc.edu ([152.2.2.160]:33147 helo=mxpm.isis.unc.edu) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MLcUG-00082x-Mj for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2009 08:31:00 -0400 Received: from smtp.unc.edu (smtpsrv3.isis.unc.edu [152.2.2.251]) by mxp2 (8.14.3/8.14.3) with ESMTP id n5UCUxPq024625 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 30 Jun 2009 08:30:59 -0400 Received: from LAPTOP-EDU (vp0297.uvt.nl [137.56.81.43]) (authenticated bits=0) by smtp.unc.edu (8.14.3/8.14.3) with ESMTP id n5UCUvFR010974 for ; Tue, 30 Jun 2009 08:30:59 -0400 (EDT) To: bug-gnu-emacs@gnu.org From: Evangelos Evangelou User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (windows-nt) Date: Tue, 30 Jun 2009 14:30:56 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5,1.2.40,4.0.166 definitions=2009-06-30_03:2009-06-25,2009-06-30,2009-06-29 signatures=0 X-Proofpoint-Spam-Details: rule=uncdefault_notspam policy=uncdefault score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=5.0.0-0811170000 definitions=main-0906300059 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Please write in English if possible, because the Emacs maintainers usually do not have translators to read other languages for them. Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list, and to the gnu.emacs.bug news group. Please describe exactly what actions triggered the bug and the precise symptoms of the bug: 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. If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. If you would like to further debug the crash, please read the file c:/Emacs/etc/DEBUG for instructions. In GNU Emacs 22.3.1 (i386-mingw-nt5.1.2600) of 2008-09-06 on SOFT-MJASON Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (3.4)' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: ENU locale-coding-system: cp1253 default-enable-multibyte-characters: t Major mode: F90 Minor modes in effect: iswitchb-mode: t erc-track-mode: t erc-stamp-mode: t erc-match-mode: t shell-dirtrack-mode: t savehist-mode: t recentf-mode: t show-paren-mode: t delete-selection-mode: t encoded-kbd-mode: t tooltip-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t unify-8859-on-encoding-mode: t utf-translate-cjk-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t abbrev-mode: 1 Recent input: e t s t . 1 e s t . 3 C-x 1 C-x C-b C-x v v C-c C-c C-x C-b C-g C-SPC C-w C-y ! ! ! SPC F i l e s SPC n e e d e d SPC b y SPC t h i s SPC : C-e M-; SPC ! ! ! SPC m a t f c n . f 9 0 C-M-q C-SPC M-; C-M-q C-SPC M-; C-x C-s C-M-q C-_ C-h ? SPC M-x r e p o r t Recent messages: Mark activated Mark set Indenting the whole file...done Mark activated Wrote e:/work/asymp_spatial_laplace/program/estimation/estlik.f90 Mark set Indenting the whole file...done Undo! Making completion list... Loading emacsbug...done From cyd@stupidchicken.com Tue Jun 30 15:02:48 2009 Received: (at control) by emacsbugs.donarmstrong.com; 30 Jun 2009 22:02:48 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=none autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from pantheon-po33.its.yale.edu (pantheon-po33.its.yale.edu [130.132.50.94]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n5UM2isA003776 for ; Tue, 30 Jun 2009 15:02:45 -0700 Received: from furry ([18.74.7.43]) (authenticated bits=0) by pantheon-po33.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id n5UM2cBE003706 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Tue, 30 Jun 2009 18:02:38 -0400 Received: by furry (Postfix, from userid 1000) id 619FAC09B; Tue, 30 Jun 2009 18:02:38 -0400 (EDT) From: Chong Yidong To: control@debbugs.gnu.org Subject: close 3688 Date: Tue, 30 Jun 2009 18:02:38 -0400 Message-ID: <87vdmd1itd.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) close 3688 reassign 3709 spam reassign 3711 spam reassign 3715 spam reassign 3716 spam reassign 3718 spam reassign 3721 spam reassign 3723 spam reassign 3724 spam reassign 3725 spam merge 3728 3729 thanks From unknown Mon Jun 23 07:49:00 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#3729: f90-mode indentation Reply-To: Glenn Morris , 3729@debbugs.gnu.org Resent-From: Glenn Morris Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 01 Jul 2009 01:55:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 3729 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 3729-submit@emacsbugs.donarmstrong.com id=B3729.124641308310684 (code B ref 3729); Wed, 01 Jul 2009 01:55:06 +0000 Received: (at 3729) by emacsbugs.donarmstrong.com; 1 Jul 2009 01:51:23 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-9.2 required=4.0 tests=AWL,HAS_BUG_NUMBER, VALID_BTS_CONTROL,X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 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 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 From: Glenn Morris To: Evangelos Evangelou Cc: 3729@debbugs.gnu.org References: 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 Date: Tue, 30 Jun 2009 21:51:12 -0400 Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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. From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 26 17:59:30 2010 Received: (at control) by debbugs.gnu.org; 26 Jan 2010 22:59:30 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NZuNe-0006Wg-50 for submit@debbugs.gnu.org; Tue, 26 Jan 2010 17:59:30 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NZuNc-0006Wa-Ri for control@debbugs.gnu.org; Tue, 26 Jan 2010 17:59:29 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1NZuNZ-0005iV-10; Tue, 26 Jan 2010 17:59:25 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19295.29644.873399.225898@fencepost.gnu.org> Date: Tue, 26 Jan 2010 17:59:24 -0500 From: Glenn Morris To: control Subject: control X-Attribution: GM X-Mailer: VM (www.wonderworks.com/vm), GNU Emacs (www.gnu.org/software/emacs) X-Hue: green X-Ran: &(VbNfmJXZ;[J{*G3aTbd+b!ecJ2-$GFxDMQQe0OAuT_7w/9GVc(bITh-`eB%[Y;QuxJkO X-Debbugs-No-Ack: yes X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.0 (-----) merge 3598 3599 severity 3625 wishlist tags 3634 moreinfo severity 3639 minor unmerge 3728 From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 08 14:30:41 2010 Received: (at control) by debbugs.gnu.org; 8 Mar 2010 19:30:41 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Noif3-0005zw-Js for submit@debbugs.gnu.org; Mon, 08 Mar 2010 14:30:41 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Noif2-0005zr-4y for control@debbugs.gnu.org; Mon, 08 Mar 2010 14:30:40 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1Noiex-0002w1-D7; Mon, 08 Mar 2010 14:30:35 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19349.20571.288686.992076@fencepost.gnu.org> Date: Mon, 8 Mar 2010 14:30:35 -0500 From: Glenn Morris To: control Subject: control X-Attribution: GM X-Mailer: VM (www.wonderworks.com/vm), GNU Emacs (www.gnu.org/software/emacs) X-Hue: magenta X-Ran: ^G{OX',K#?'_m*;8|$I9x/Z;>wFr'`e;W\q$6pkLdN{??Dwf|Q9[f?W]0HN0fq30|!6e*P X-Debbugs-No-Ack: yes X-Spam-Score: -5.1 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.1 (-----) severity 5689 wishlist tags 5689 wontfix reassign 5683 emacs,ns reassign 5693 emacs,ns reassign 5691 emacs,w32 severity 5685 minor reassign 3729 emacs user emacs usertags 3729 f90 From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 07 21:59:43 2012 Received: (at control) by debbugs.gnu.org; 8 Dec 2012 02:59:43 +0000 Received: from localhost ([127.0.0.1]:59695 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1ThAdi-00051J-LR for submit@debbugs.gnu.org; Fri, 07 Dec 2012 21:59:43 -0500 Received: from mail-pa0-f44.google.com ([209.85.220.44]:34344) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1ThAdh-00051C-1n for control@debbugs.gnu.org; Fri, 07 Dec 2012 21:59:41 -0500 Received: by mail-pa0-f44.google.com with SMTP id hz11so859539pad.3 for ; Fri, 07 Dec 2012 18:59:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:mime-version:content-type; bh=ulLk8w+1WesgrxTYLuxjdBAv8o4+s5V2n0mkKKYy9ao=; b=DNmLEVssYh/jbmiFggrGdfBk41sATDqCZhcZyViS212/r8C3p7rQxe2gc5uN/QYfCz n1CYD5VWubpqr8fNneJ/mE/u8OWt4sZ6qBhYtEXSzNMpAfq2Uhu+cTELk0s9hngyZRTV XOiHJADY+zDcjofXGJuJ6U9Lig1yCZe9CkGtXWm5Dxr1sCpiR0hdIdfRf13qtgltIDpO 0yRnq71ROaBIwb+jUA8rFZHeVSYFOmfJ1wd+ri35A1TLvkq0EywBuy6Sow4H+Ekpm9bO EYoOQuXxgn4EQ6sZjimSNT6EdicTl2iKXwOTGxWnhuBTw1Ku5KhS1o/hLlqWsGxdFCqW bSxg== Received: by 10.69.1.73 with SMTP id be9mr21096989pbd.116.1354935558721; Fri, 07 Dec 2012 18:59:18 -0800 (PST) Received: from ulysses (cm107.delta179.maxonline.com.sg. [59.189.179.107]) by mx.google.com with ESMTPS id i5sm7610937pax.13.2012.12.07.18.59.16 (version=SSLv3 cipher=OTHER); Fri, 07 Dec 2012 18:59:17 -0800 (PST) From: Chong Yidong To: control@debbugs.gnu.org Subject: close 975 Date: Sat, 08 Dec 2012 10:59:13 +0800 Message-ID: <87k3st5jwe.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.7 (/) close 975 close 2577 close 3640 close 3729 close 8256 close 10633 close 11407 thanks