GNU bug report logs - #4259
Cannot indent fortran continue statement in emacs 23

Previous Next

Package: emacs;

Reported by: Ushnish Basu <ubasu <at> cal.berkeley.edu>

Date: Tue, 25 Aug 2009 19:50:04 UTC

Severity: normal

Done: Glenn Morris <rgm <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 4259 in the body.
You can then email your comments to 4259 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#4259; Package emacs. (Tue, 25 Aug 2009 19:50:05 GMT) Full text and rfc822 format available.

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

From: Ushnish Basu <ubasu <at> cal.berkeley.edu>
To: "Michael D. Prange" <prange <at> erl.mit.edu>, Glenn Morris <rgm <at> gnu.org>
Subject: Cannot indent fortran continue statement in emacs 23
Date: Tue, 25 Aug 2009 12:09:30 -0700
Hello,

I believe I came across a bug in the latest version of the fortran mode 
in emacs 23. Currently I am using version 23.1.1, but I did not have 
this problem with 23.0.60 from CVS.

Please see the following sample code - I have arranged it as such only 
to illustrate the problem:

      subroutine first
      do 10 i=1,10
 10     continue
      end
      do 20 i=1,100
 20     continue


If I run fortran-indent-line on the first continue (label 10) it works 
fine. However, if I run it on the second one (label 20), I get the error:

fortran-check-end-prog-re: Lisp nesting exceeds 'max-lisp-eval-depth'

presumably because it is after the 'end'

If I increase max-lisp-eval-depth (and max-specpdl-size) to 10000, then 
I get the error

fortran-check-end-prog-re: Variable binding depth exceeds max-specpdl-size

Is this something that has been fixed in CVS?

I look forward to hearing back from you.

Thanks,

Ushnish



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4259; Package emacs. (Wed, 26 Aug 2009 02:05:08 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Ushnish Basu <ubasu <at> cal.berkeley.edu>
Cc: 4259 <at> debbugs.gnu.org
Subject: Re: Cannot indent fortran continue statement in emacs 23
Date: Tue, 25 Aug 2009 21:56:11 -0400
Please use M-x report-emacs-bug to report Emacs bugs, rather than
sending mail to addresses in the source files.


Ushnish Basu wrote (on Tue, 25 Aug 2009 at 12:09 -0700):

> Currently I am using version 23.1.1, but I did not have this problem
> with 23.0.60 from CVS.
[...]
>        subroutine first
>        do 10 i=1,10
>   10     continue
>        end
>        do 20 i=1,100
>   20     continue
> 
> If I run fortran-indent-line on the first continue (label 10) it works 
> fine. However, if I run it on the second one (label 20), I get the error:
> 
> fortran-check-end-prog-re: Lisp nesting exceeds 'max-lisp-eval-depth'


The example does not look like valid Fortran, so I'm not too bothered
if fortran-mode cannot indent it (although an infinite loop is not a
nice way to fail).

Do you have a minimum example of a valid Fortran file that fails in
this way?

The problem is another (see eg bug #2106) infinite loop in
end-of-defun, when called from the start of the "20" line. It's not
immediately obvious to me whether this is a problem in fortran-mode or
in end-of-defun.



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4259; Package emacs. (Wed, 26 Aug 2009 17:10:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ushnish Basu <ubasu <at> cal.berkeley.edu>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Wed, 26 Aug 2009 17:10:08 GMT) Full text and rfc822 format available.

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

From: Ushnish Basu <ubasu <at> cal.berkeley.edu>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 4259 <at> debbugs.gnu.org
Subject: Re: Cannot indent fortran continue statement in emacs 23
Date: Wed, 26 Aug 2009 09:59:21 -0700
Glenn Morris wrote:
> Please use M-x report-emacs-bug to report Emacs bugs, rather than
> sending mail to addresses in the source files.
> 
> 

My apologies - I thought of that after I sent off this email. I have now 
submitted a bug report directly, but I guess this bug was already filed 
as #4259, so the second bug would duplicate.

> Ushnish Basu wrote (on Tue, 25 Aug 2009 at 12:09 -0700):
> 
>> Currently I am using version 23.1.1, but I did not have this problem
>> with 23.0.60 from CVS.

[snip]

> 
> Do you have a minimum example of a valid Fortran file that fails in
> this way?
> 

The bug shows for the following program:

      subroutine first
      do 10 i=1,10
 10     continue
      end
      subroutine second
      do 20 i=1,100
 20     continue
      end

I sent the earlier invalid version just to highlight that it was the 
'end' statement that seemed to be making the difference.

I get the bug even in the current(?) CVS version 23.1.50.1

> The problem is another (see eg bug #2106) infinite loop in
> end-of-defun, when called from the start of the "20" line. It's not
> immediately obvious to me whether this is a problem in fortran-mode or
> in end-of-defun.

Thanks for your help.

Best regards,

Ushnish



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4259; Package emacs. (Thu, 27 Aug 2009 22:40:05 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Ushnish Basu <ubasu <at> cal.berkeley.edu>
Cc: 4259 <at> debbugs.gnu.org
Subject: Re: Cannot indent fortran continue statement in emacs 23
Date: Thu, 27 Aug 2009 18:32:31 -0400
Ushnish Basu wrote:

>       subroutine first
>       do 10 i=1,10
>  10     continue
>       end
>       subroutine second
>       do 20 i=1,100
>  20     continue
>       end


Thanks, this looks like a (long-standing but previously hidden)
fortran.el bug with motion commands. I will find a fix.



Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Sun, 30 Aug 2009 01:45:04 GMT) Full text and rfc822 format available.

Notification sent to Ushnish Basu <ubasu <at> cal.berkeley.edu>:
bug acknowledged by developer. (Sun, 30 Aug 2009 01:45:04 GMT) Full text and rfc822 format available.

Message #19 received at 4259-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 4259-done <at> debbugs.gnu.org
Subject: Re: Cannot indent fortran continue statement in emacs 23
Date: Sat, 29 Aug 2009 21:40:33 -0400
I believe this is fixed in the current CVS trunk. It would be great if
you are able to test it out.

2009-08-30  Glenn Morris  <rgm at gnu.org>

  * progmodes/fortran.el (fortran-start-prog-re): New constant, extracted
  from fortran-current-defun.
  (fortran-beginning-of-subprogram): Be more precise about finding the
  start, to avoid an infinite loop in end-of-defun.  (Bug#4259)
  (fortran-end-of-subprogram): Simplify.
  (fortran-current-defun): Use fortran-start-prog-re.



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4259; Package emacs. (Mon, 31 Aug 2009 22:15:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ushnish Basu <ubasu <at> cal.berkeley.edu>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Mon, 31 Aug 2009 22:15:07 GMT) Full text and rfc822 format available.

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

From: Ushnish Basu <ubasu <at> cal.berkeley.edu>
To: 4259 <at> debbugs.gnu.org
Subject: Re: bug#4259 closed by Glenn Morris <rgm <at> gnu.org> (Re: Cannot indent
 fortran continue statement in emacs 23)
Date: Mon, 31 Aug 2009 15:08:54 -0700
Thanks, I tried it out and it works. Thanks for the quick bugfix.

Ushnish

Emacs bug Tracking System wrote:
> This is an automatic notification regarding your bug report
> which was filed against the emacs package:
> 
> #4259: Cannot indent fortran continue statement in emacs 23
> 
> It has been closed by Glenn Morris <rgm <at> gnu.org>.
> 
> Their explanation is attached below along with your original report.
> If this explanation is unsatisfactory and you have not received a
> better one in a separate message then please contact Glenn Morris <rgm <at> gnu.org> by
> replying to this email.
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> Subject:
> Re: Cannot indent fortran continue statement in emacs 23
> From:
> Glenn Morris <rgm <at> gnu.org>
> Date:
> Sat, 29 Aug 2009 21:40:33 -0400
> To:
> 4259-done <at> emacsbugs.donarmstrong.com
> 
> To:
> 4259-done <at> emacsbugs.donarmstrong.com
> 
> 
> I believe this is fixed in the current CVS trunk. It would be great if
> you are able to test it out.
> 
> 2009-08-30  Glenn Morris  <rgm at gnu.org>
> 
>   * progmodes/fortran.el (fortran-start-prog-re): New constant, extracted
>   from fortran-current-defun.
>   (fortran-beginning-of-subprogram): Be more precise about finding the
>   start, to avoid an infinite loop in end-of-defun.  (Bug#4259)
>   (fortran-end-of-subprogram): Simplify.
>   (fortran-current-defun): Use fortran-start-prog-re.
> 
> 
> ------------------------------------------------------------------------
> 
> Subject:
> Cannot indent fortran continue statement in emacs 23
> From:
> Ushnish Basu <ubasu <at> cal.berkeley.edu>
> Date:
> Tue, 25 Aug 2009 12:09:30 -0700
> To:
> "Michael D. Prange" <prange <at> erl.mit.edu>, Glenn Morris <rgm <at> gnu.org>
> 
> To:
> "Michael D. Prange" <prange <at> erl.mit.edu>, Glenn Morris <rgm <at> gnu.org>
> 
> 
> Hello,
> 
> I believe I came across a bug in the latest version of the fortran mode 
> in emacs 23. Currently I am using version 23.1.1, but I did not have 
> this problem with 23.0.60 from CVS.
> 
> Please see the following sample code - I have arranged it as such only 
> to illustrate the problem:
> 
>       subroutine first
>       do 10 i=1,10
>  10     continue
>       end
>       do 20 i=1,100
>  20     continue
> 
> 
> If I run fortran-indent-line on the first continue (label 10) it works 
> fine. However, if I run it on the second one (label 20), I get the error:
> 
> fortran-check-end-prog-re: Lisp nesting exceeds 'max-lisp-eval-depth'
> 
> presumably because it is after the 'end'
> 
> If I increase max-lisp-eval-depth (and max-specpdl-size) to 10000, then 
> I get the error
> 
> fortran-check-end-prog-re: Variable binding depth exceeds max-specpdl-size
> 
> Is this something that has been fixed in CVS?
> 
> I look forward to hearing back from you.
> 
> Thanks,
> 
> Ushnish
> 




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> emacsbugs.donarmstrong.com. (Tue, 29 Sep 2009 14:24:18 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 346 days ago.

Previous Next


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