GNU bug report logs - #3729
f90-mode indentation

Previous Next

Package: emacs;

Reported by: Evangelos Evangelou <vangelis <at> email.unc.edu>

Date: Tue, 30 Jun 2009 12:35:06 UTC

Severity: normal

Tags: wontfix

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 3729 in the body.
You can then email your comments to 3729 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3729; Package emacs. (Tue, 30 Jun 2009 12:35:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Evangelos Evangelou <vangelis <at> email.unc.edu>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Tue, 30 Jun 2009 12:35:06 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Evangelos Evangelou <vangelis <at> email.unc.edu>
To: bug-gnu-emacs <at> gnu.org
Subject: f90-mode indentation
Date: Tue, 30 Jun 2009 14:30:56 +0200
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 <at> 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:
<down> <down> <down> <down> <down> <down> <down> <down> 
<S-up> e t <backspace> s t . 1 <return> e s t . 3 <return> 
C-x 1 <M-down> <M-down> <M-down> <M-down> <M-down> 
<M-down> <M-down> <M-down> <M-down> <M-down> <M-down> 
<M-down> <M-up> <M-up> C-x C-b <down> <down> <down> 
<return> C-x v v C-c C-c C-x C-b <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> C-g <down> 
<up> <up> <right> <down> <left> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <up> <right> C-SPC <down> 
<down> <down> <down> C-w <C-home> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> C-y <return> <up> <up> <up> <up> 
<up> <return> <backspace> <backspace> ! ! ! SPC F i 
l e s SPC n e e d e d SPC b y SPC t h i s SPC <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> : <lwindow> <lwindow> 
<lwindow> <lwindow> <lwindow> <lwindow> <lwindow> <lwindow> 
<lwindow> <lwindow> <lwindow> <lwindow> <lwindow> <lwindow> 
<lwindow> <lwindow> <lwindow> <lwindow> <lwindow> <lwindow> 
<lwindow> <lwindow> <down> C-e <backspace> <backspace> 
M-; SPC <backspace> <backspace> <backspace> <up> <return> 
! ! ! <backspace> <tab> <left> <left> <backspace> <backspace> 
<down> <left> SPC m a t f c n . f 9 0 <left> <left> 
<left> <left> <left> <left> <left> <left> <left> <left> 
<left> <left> <right> <down> <down> <down> <down> <down> 
<down> <down> <down> <up> <up> <up> <up> C-M-q <up> 
<up> <up> C-SPC <down> <down> <down> M-; C-M-q <up> 
<up> <up> C-SPC <C-down> <down> <up> M-; <up> <up> 
<up> <right> <right> <backspace> <backspace> <down> 
<delete> <delete> <down> <delete> <delete> C-x C-s 
C-M-q C-_ C-h ? SPC <lwindow> <help-echo> M-x r e p 
o <tab> r t <tab> <return>

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




Merged 3728 3729. Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> emacsbugs.donarmstrong.com. (Tue, 30 Jun 2009 22:10:15 GMT) Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3729; Package emacs. (Wed, 01 Jul 2009 01:55:06 GMT) Full text and rfc822 format available.

Message #10 received at 3729 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Evangelos Evangelou <vangelis <at> email.unc.edu>
Cc: 3729 <at> debbugs.gnu.org
Subject: Re: bug#3729: f90-mode indentation
Date: Tue, 30 Jun 2009 21:51:12 -0400
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.



bug reassigned from package `emacs' to `emacs,f90'. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Wed, 01 Jul 2009 01:55:10 GMT) Full text and rfc822 format available.

Tags added: wontfix Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Wed, 01 Jul 2009 01:55:11 GMT) Full text and rfc822 format available.

Disconnected #3728 from all other report(s). Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 26 Jan 2010 23:00:04 GMT) Full text and rfc822 format available.

bug reassigned from package 'emacs,f90' to 'emacs'. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 08 Mar 2010 19:31:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 3729 <at> debbugs.gnu.org and Evangelos Evangelou <vangelis <at> email.unc.edu> Request was from Chong Yidong <cyd <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 08 Dec 2012 03:00:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 05 Jan 2013 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 119 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.