From unknown Sat Jun 21 03:28:49 2025 X-Loop: don@donarmstrong.com Subject: bug#345: Bug in F90 mode Reply-To: Gabor Toth , 345@debbugs.gnu.org Resent-From: Gabor Toth Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sun, 01 Jun 2008 14:05:05 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 345 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.121232871730717 (code B ref -1); Sun, 01 Jun 2008 14:05:05 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-5.0 required=4.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 1 Jun 2008 13:58:37 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m51DwXQS030711 for ; Sun, 1 Jun 2008 06:58:34 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K2o4v-0001du-Du for bug-gnu-emacs@gnu.org; Sun, 01 Jun 2008 09:58:33 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K2o4u-0001dT-At for bug-gnu-emacs@gnu.org; Sun, 01 Jun 2008 09:58:32 -0400 Received: from [199.232.76.173] (port=41176 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K2o4u-0001dF-0i for bug-gnu-emacs@gnu.org; Sun, 01 Jun 2008 09:58:32 -0400 Received: from smtp.mail.umich.edu ([141.211.93.160]:40373 helo=skycaptain.mr.itd.umich.edu) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K2o4t-0002hI-Uh for bug-gnu-emacs@gnu.org; Sun, 01 Jun 2008 09:58:32 -0400 Received: FROM [192.168.1.101] (c-68-40-56-218.hsd1.mi.comcast.net [68.40.56.218]) BY skycaptain.mr.itd.umich.edu ID 4842AAC8.55409.22328 ; 1 Jun 2008 09:57:28 -0400 Mime-Version: 1.0 (Apple Message framework v753) Content-Transfer-Encoding: 7bit Message-Id: <7638BF9C-95FC-4104-980B-FEAED84AEF63@UMICH.EDU> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: bug-gnu-emacs@gnu.org From: Gabor Toth Date: Sun, 1 Jun 2008 09:57:27 -0400 X-Mailer: Apple Mail (2.753) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Dear GNU emacs developers, I truly appreciate the work put into the emacs editor. This is the editor of choice for editing source code files because of the many advanced features that help programmers. I have been using the F90 module for a long time and I encountered a small but annoying bug. I tried to work around it, but I could not. The bug is present in every version of emacs I know of. It is a bug in the F90 module. To reproduced the bug, simply create a file with .f90 extension, say bug.f90 open the file, and type the following lines program bug AnyVariable = 1.0 TypeVariable = 2.0 OtherVariable = 3.0 end program bug and let Emacs indent it (by hitting TAB at the beginning of each line). The result is what you see above, ie the lines following the TypeVariable = 2.0 line are indented. The reason is that if a line starts withTypeXXX the F90 module regards it as a type definition, although it is not matched when an end statement is typed. I suspect that the error is in the definition of f90-type-def-re in the f90.el file. The definition is (defconst f90-type-def-re "\\<\\(type\\)\\([^(\n]*\\)\\(::\\)?[ \t]*\\b\\(\\sw+\\)") It seems that this regular expression is too permissive. The [^(\n]** part matches anything that follows the "type" string except for opening paren and end-of-line. This should probably be replaced with [ \t]* I would be greatful if you could suggest a work around that I can put into my .emacs file. My attempts at redefining the f90-type-def-re did not work. I managed to set the indentation to 0 for type/ interface/blockdata definitions to avoid this problem, but then the true type and interface definitions will not be indented, and that's pretty ugly. We have some huge F90 codes, and not allowing variables to start with the string "type" is not an option. Thanks for your work and kind help, Gabor Toth Research scientist University of Michigan From unknown Sat Jun 21 03:28:49 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.420 (Entity 5.420) X-Loop: don@donarmstrong.com From: help-debbugs@gnu.org (Emacs bug Tracking System) To: Gabor Toth Subject: bug#345 closed by Glenn Morris (Re: bug#345: Bug in F90 mode) Message-ID: References: <7638BF9C-95FC-4104-980B-FEAED84AEF63@UMICH.EDU> X-Emacs-PR-Message: they-closed 345 X-Emacs-PR-Package: emacs Reply-To: 345@debbugs.gnu.org Content-Type: multipart/mixed; boundary="----------=_1212439205-30630-1" This is a multi-part message in MIME format... ------------=_1212439205-30630-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is an automatic notification regarding your bug report which was filed against the emacs package: #345: Bug in F90 mode=20 It has been closed by Glenn Morris . 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 by replying to this email. --=20 345: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D345 Emacs Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1212439205-30630-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit >From rgm@gnu.org Mon Jun 2 13:31:57 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-9.5 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 345-done) by emacsbugs.donarmstrong.com; 2 Jun 2008 20:31:57 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m52KVoBJ029398 for <345-done@emacsbugs.donarmstrong.com>; Mon, 2 Jun 2008 13:31:51 -0700 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1K3GfH-0008Lk-7u; Mon, 02 Jun 2008 16:29:59 -0400 From: Glenn Morris To: Gabor Toth Cc: 345-done@debbugs.gnu.org Subject: Re: bug#345: Bug in F90 mode References: <7638BF9C-95FC-4104-980B-FEAED84AEF63@UMICH.EDU> X-Spook: argus Sears Tower Compsec Putin InfoSec pipeline BLU-97 X-Ran: L*^MHhlRFI:E;3%kVhE+`$<1-<[@vA-M#wM5u\ntGBqx6dH&Jq!'@*P,0y0j/gc"j&ybnJ X-Hue: yellow X-Attribution: GM Date: Mon, 02 Jun 2008 16:29:59 -0400 In-Reply-To: <7638BF9C-95FC-4104-980B-FEAED84AEF63@UMICH.EDU> (Gabor Toth's message of "Sun, 1 Jun 2008 09:57:27 -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 Gabor Toth wrote: > The bug is present in every version of emacs I know of. I can't reproduce it in Emacs 21.4, 22.1 or 22.2. (The CVS trunk does have a separate problem here; funny coincidence.) > (defconst f90-type-def-re > "\\<\\(type\\)\\([^(\n]*\\)\\(::\\)?[ \t]*\\b\\(\\sw+\\)") This form was replaced 6 years ago, ie in Emacs 21.3. I strongly advise you to use a more recent version of Emacs (the latest is 22.2), where we have the equivalent of: (setq f90-type-def-re "\\<\\(type\\)\\>\\(?:[^()\n]*::\\)?[ \t]*\\(\\sw+\\)") ------------=_1212439205-30630-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit >From GTOTH@UMICH.EDU Sun Jun 1 06:58:37 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-5.0 required=4.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 1 Jun 2008 13:58:37 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m51DwXQS030711 for ; Sun, 1 Jun 2008 06:58:34 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K2o4v-0001du-Du for bug-gnu-emacs@gnu.org; Sun, 01 Jun 2008 09:58:33 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K2o4u-0001dT-At for bug-gnu-emacs@gnu.org; Sun, 01 Jun 2008 09:58:32 -0400 Received: from [199.232.76.173] (port=41176 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K2o4u-0001dF-0i for bug-gnu-emacs@gnu.org; Sun, 01 Jun 2008 09:58:32 -0400 Received: from smtp.mail.umich.edu ([141.211.93.160]:40373 helo=skycaptain.mr.itd.umich.edu) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K2o4t-0002hI-Uh for bug-gnu-emacs@gnu.org; Sun, 01 Jun 2008 09:58:32 -0400 Received: FROM [192.168.1.101] (c-68-40-56-218.hsd1.mi.comcast.net [68.40.56.218]) BY skycaptain.mr.itd.umich.edu ID 4842AAC8.55409.22328 ; 1 Jun 2008 09:57:28 -0400 Mime-Version: 1.0 (Apple Message framework v753) Content-Transfer-Encoding: 7bit Message-Id: <7638BF9C-95FC-4104-980B-FEAED84AEF63@UMICH.EDU> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: bug-gnu-emacs@gnu.org From: Gabor Toth Subject: Bug in F90 mode Date: Sun, 1 Jun 2008 09:57:27 -0400 X-Mailer: Apple Mail (2.753) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Dear GNU emacs developers, I truly appreciate the work put into the emacs editor. This is the editor of choice for editing source code files because of the many advanced features that help programmers. I have been using the F90 module for a long time and I encountered a small but annoying bug. I tried to work around it, but I could not. The bug is present in every version of emacs I know of. It is a bug in the F90 module. To reproduced the bug, simply create a file with .f90 extension, say bug.f90 open the file, and type the following lines program bug AnyVariable = 1.0 TypeVariable = 2.0 OtherVariable = 3.0 end program bug and let Emacs indent it (by hitting TAB at the beginning of each line). The result is what you see above, ie the lines following the TypeVariable = 2.0 line are indented. The reason is that if a line starts withTypeXXX the F90 module regards it as a type definition, although it is not matched when an end statement is typed. I suspect that the error is in the definition of f90-type-def-re in the f90.el file. The definition is (defconst f90-type-def-re "\\<\\(type\\)\\([^(\n]*\\)\\(::\\)?[ \t]*\\b\\(\\sw+\\)") It seems that this regular expression is too permissive. The [^(\n]** part matches anything that follows the "type" string except for opening paren and end-of-line. This should probably be replaced with [ \t]* I would be greatful if you could suggest a work around that I can put into my .emacs file. My attempts at redefining the f90-type-def-re did not work. I managed to set the indentation to 0 for type/ interface/blockdata definitions to avoid this problem, but then the true type and interface definitions will not be indented, and that's pretty ugly. We have some huge F90 codes, and not allowing variables to start with the string "type" is not an option. Thanks for your work and kind help, Gabor Toth Research scientist University of Michigan ------------=_1212439205-30630-1--