unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#3729: f90-mode indentation
@ 2009-06-30 12:30 Evangelos Evangelou
  2009-07-01  1:51 ` Glenn Morris
  0 siblings, 1 reply; 3+ messages in thread
From: Evangelos Evangelou @ 2009-06-30 12:30 UTC (permalink / raw)
  To: bug-gnu-emacs


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:
<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






^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#3729: f90-mode indentation
  2009-06-30 12:30 bug#3729: f90-mode indentation Evangelos Evangelou
@ 2009-07-01  1:51 ` Glenn Morris
  2009-07-01  1:55   ` Processed: " Emacs bug Tracking System
  0 siblings, 1 reply; 3+ messages in thread
From: Glenn Morris @ 2009-07-01  1:51 UTC (permalink / raw)
  To: Evangelos Evangelou; +Cc: 3729

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.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Processed: Re: bug#3729: f90-mode indentation
  2009-07-01  1:51 ` Glenn Morris
@ 2009-07-01  1:55   ` Emacs bug Tracking System
  0 siblings, 0 replies; 3+ messages in thread
From: Emacs bug Tracking System @ 2009-07-01  1:55 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Emacs Bugs, f90 for {3728, 3729}

Processing commands for control@emacsbugs.donarmstrong.com:

> reassign 3729 emacs,f90
bug#3729: f90-mode indentation
Warning: Unknown package 'f90'
bug#3728: f90-mode indentation
Warning: Unknown package 'f90'
bug reassigned from package `emacs' to `emacs,f90'.

> tags 3729 wontfix
bug#3729: f90-mode indentation
There were no tags set.
Warning: Unknown package 'f90'
bug#3728: f90-mode indentation
Warning: Unknown package 'f90'
Tags added: wontfix

> stop
Stopping processing here.

Please contact me if you need assistance.

Don Armstrong
(administrator, Emacs bugs database)




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-07-01  1:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-30 12:30 bug#3729: f90-mode indentation Evangelos Evangelou
2009-07-01  1:51 ` Glenn Morris
2009-07-01  1:55   ` Processed: " Emacs bug Tracking System

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).