From unknown Tue Jun 24 05:09:12 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#19809 <19809@debbugs.gnu.org> To: bug#19809 <19809@debbugs.gnu.org> Subject: Status: 24.4; f90-beginning-of-subprogram wrong behavior with string continuation Reply-To: bug#19809 <19809@debbugs.gnu.org> Date: Tue, 24 Jun 2025 12:09:12 +0000 retitle 19809 24.4; f90-beginning-of-subprogram wrong behavior with string = continuation reassign 19809 emacs submitter 19809 Raul Laasner severity 19809 minor thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 07 16:00:35 2015 Received: (at submit) by debbugs.gnu.org; 7 Feb 2015 21:00:35 +0000 Received: from localhost ([127.0.0.1]:36874 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YKCUU-0003zX-6f for submit@debbugs.gnu.org; Sat, 07 Feb 2015 16:00:35 -0500 Received: from eggs.gnu.org ([208.118.235.92]:44104) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YKBwP-00037F-In for submit@debbugs.gnu.org; Sat, 07 Feb 2015 15:25:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YKBwJ-0006Hx-2J for submit@debbugs.gnu.org; Sat, 07 Feb 2015 15:25:16 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:47149) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKBwI-0006Ht-W6 for submit@debbugs.gnu.org; Sat, 07 Feb 2015 15:25:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45820) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKBwH-0006nk-OV for bug-gnu-emacs@gnu.org; Sat, 07 Feb 2015 15:25:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YKBwG-0006HX-C6 for bug-gnu-emacs@gnu.org; Sat, 07 Feb 2015 15:25:13 -0500 Received: from mail-ig0-x22e.google.com ([2607:f8b0:4001:c05::22e]:40525) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKBwG-0006HP-31 for bug-gnu-emacs@gnu.org; Sat, 07 Feb 2015 15:25:12 -0500 Received: by mail-ig0-f174.google.com with SMTP id b16so9467413igk.1 for ; Sat, 07 Feb 2015 12:25:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=tqgHUrqq1RzGEiJ88lblEeQr3m1qjPFTaobY0RLdoSc=; b=gHRno4jh/H2bc9x6bjDXYIDhmPjSKc5wx91K3s40ctgaDmVcnz+e2WojSrr0WOGGRV s8dJOek0SGt+QGqbrFeWXrxP9gCKuOXDLQ+UayRvJ8q6uCShdYVtEKBgGZRyDs2UVczJ 6Qb1FnjgN4EDQCnmDmUG1XV1eoyyMW0WZqcQ2heRY8NBWYI6ia1QmHqxATewwZ8C565g IJDvponbTiMa4NfAaLvHWA68BOUKNdXRkt+SQ7P0fSgtmnqJBqZeJLbCA09LBs6JQadf PHr9jPD53wIhwSsR4Tl2+LTF3r0dKpg8JVZZfPvyWQxmpJxhvqx1l8D3fnDUQ2qTivje h+pA== MIME-Version: 1.0 X-Received: by 10.107.160.72 with SMTP id j69mr18381223ioe.0.1423340710916; Sat, 07 Feb 2015 12:25:10 -0800 (PST) Received: by 10.36.7.205 with HTTP; Sat, 7 Feb 2015 12:25:10 -0800 (PST) Date: Sat, 7 Feb 2015 22:25:10 +0200 Message-ID: Subject: 24.4; f90-beginning-of-subprogram wrong behavior with string continuation From: Raul Laasner To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary=001a1140e92277f9a1050e8555ac X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 07 Feb 2015 16:00:32 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --001a1140e92277f9a1050e8555ac Content-Type: text/plain; charset=UTF-8 The functions f90-beginning-of-subprogram and f90-end-of-subprogram do not work correctly if the source file contains lines which begin with the correct keywords but in fact belong to a continued string. For instance, in the following, subroutine foo() print*, '& end subroutine foo' ! The cursor is here end subroutine foo f90-beginning-of-subprogram jumps past the line containing 'subroutine foo()'. A similar example could be written for f90-end-of-subprogram. I propose to put a small check of whether the previous line ended with an ampersand into the F90 major mode source file: --- f90.el 2015-02-07 16:50:56.210519581 +0200 +++ f90_new.el 2015-02-07 16:56:44.997174743 +0200 @@ -1619,6 +1619,14 @@ (looking-at "[ \t0-9]*\\(!\\|$\\|#\\)"))) not-last-statement)) +(defsubst f90-test-string-continuation () + "Return true if the the current is a string continuation." + (save-excursion + (beginning-of-line) + (backward-char) + (skip-chars-backward " ") + (string= (string (char-before)) "&"))) + (defun f90-beginning-of-subprogram () "Move point to the beginning of the current subprogram. Return (TYPE NAME), or nil if not found." @@ -1629,9 +1637,13 @@ (re-search-backward f90-program-block-re nil 'move)) (beginning-of-line) (skip-chars-forward " \t0-9") - (cond ((setq matching-beg (f90-looking-at-program-block-start)) + (cond ((and + (setq matching-beg (f90-looking-at-program-block-start)) + (not (f90-test-string-continuation))) (setq count (1- count))) - ((f90-looking-at-program-block-end) + ((and + (f90-looking-at-program-block-end) + (not (f90-test-string-continuation))) (setq count (1+ count))))) (beginning-of-line) (if (zerop count) @@ -1654,9 +1666,13 @@ (re-search-forward f90-program-block-re nil 'move)) (beginning-of-line) (skip-chars-forward " \t0-9") - (cond ((f90-looking-at-program-block-start) + (cond ((and + (f90-looking-at-program-block-start) + (not (f90-test-string-continuation))) (setq count (1+ count))) - ((setq matching-end (f90-looking-at-program-block-end)) + ((and + (setq matching-end (f90-looking-at-program-block-end)) + (not (f90-test-string-continuation))) (setq count (1- count)))) (end-of-line)) ;; This means f90-end-of-subprogram followed by f90-start-of-subprogram Best wishes, Raul Laasner -- Raul Laasner Institute of Physics University of Tartu Ravila 14c, 50411, Estonia e-mail: raullaasner@gmail.com cell: (+372)5182268 --001a1140e92277f9a1050e8555ac Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
The functions f90-beginning-of-subprogram and f90-end-of-s= ubprogram do not work correctly if the source file contains lines which beg= in with the correct keywords but in fact belong to a continued string. For = instance, in the following,

subroutine foo()
=C2=A0 print*, '= &
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 end subroutine foo'
= =C2=A0 ! The cursor is here
end subroutine foo

f90-beginning-of-s= ubprogram jumps past the line containing 'subroutine foo()'. A simi= lar example could be written for f90-end-of-subprogram. I propose to put a = small check of whether the previous line ended with an ampersand into the F= 90 major mode source file:

--- f90.el=C2=A0=C2=A0=C2=A0 2015-02-07 1= 6:50:56.210519581 +0200
+++ f90_new.el=C2=A0=C2=A0=C2=A0 2015-02-07 16:5= 6:44.997174743 +0200
@@ -1619,6 +1619,14 @@
=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (l= ooking-at "[ \t0-9]*\\(!\\|$\\|#\\)")))
=C2=A0=C2=A0=C2=A0=C2= =A0 not-last-statement))
=C2=A0
+(defsubst f90-test-string-continuati= on ()
+=C2=A0 "Return true if the the current is a string continuat= ion."
+=C2=A0 (save-excursion
+=C2=A0=C2=A0=C2=A0 (beginning-of-= line)
+=C2=A0=C2=A0=C2=A0 (backward-char)
+=C2=A0=C2=A0=C2=A0 (skip-c= hars-backward " ")
+=C2=A0=C2=A0=C2=A0 (string=3D (string (cha= r-before)) "&")))
+
=C2=A0(defun f90-beginning-of-subpr= ogram ()
=C2=A0=C2=A0 "Move point to the beginning of the current s= ubprogram.
=C2=A0Return (TYPE NAME), or nil if not found."
@@ -1= 629,9 +1637,13 @@
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (re-search-backward f90-program-= block-re nil 'move))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (beginning= -of-line)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (skip-chars-forward "= ; \t0-9")
-=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (cond ((setq matching-beg= (f90-looking-at-program-block-start))
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (= cond ((and
+=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (setq matc= hing-beg (f90-looking-at-program-block-start))
+=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 (not (f90-test-string-continuation)))
=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (s= etq count (1- count)))
-=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 ((f90-looking-at-program-block-end)
+=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((and
+=C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (f90-looking-at-program-block-end)+=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (not (f90-test-string-c= ontinuation)))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 (setq count (1+ count)))))
=C2=A0=C2=A0=C2=A0=C2= =A0 (beginning-of-line)
=C2=A0=C2=A0=C2=A0=C2=A0 (if (zerop count)
@@= -1654,9 +1666,13 @@
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (re-search-forward f90-progra= m-block-re nil 'move))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (beginni= ng-of-line)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (skip-chars-forward &qu= ot; \t0-9")
-=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (cond ((f90-looking-at-= program-block-start)
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (cond ((and
+=C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (f90-looking-at-program-bloc= k-start)
+=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (not (f90-te= st-string-continuation)))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (setq count (1+ count)))
-=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((setq matching-end = (f90-looking-at-program-block-end))
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((and
+=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 (setq matching-end (f90-looking-at-program-block-end))+=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (not (f90-test-string-= continuation)))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 (setq count (1- count))))
=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 (end-of-line))
=C2=A0=C2=A0=C2=A0=C2=A0 ;; This means f9= 0-end-of-subprogram followed by f90-start-of-subprogram


Best wis= hes,
Raul Laasner

--
Raul Laasner
Institute of Physics
University of= Tartu
Ravila 14c, 50411, Estonia
e-mail: raullaasner@gmail.com
cell: (+372)51= 82268
--001a1140e92277f9a1050e8555ac-- From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 10 20:27:33 2015 Received: (at 19809) by debbugs.gnu.org; 11 Feb 2015 01:27:33 +0000 Received: from localhost ([127.0.0.1]:39713 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YLM5U-0006GS-U1 for submit@debbugs.gnu.org; Tue, 10 Feb 2015 20:27:33 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:41171 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YLM5T-0006GK-1u for 19809@debbugs.gnu.org; Tue, 10 Feb 2015 20:27:31 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1YLM5P-0003FP-2v; Tue, 10 Feb 2015 20:27:29 -0500 From: Glenn Morris To: Raul Laasner Subject: Re: bug#19809: 24.4; f90-beginning-of-subprogram wrong behavior with string continuation References: X-Spook: Roswell Abbas csystems CID Mole sniper CDMA Manfurov X-Ran: Cj-?h`}2yO*-MDNOUKIv~rwOv"C$6}-WhEkCsh;^74mI_huMCo0yIozw/jC#\m-2/^6C (Raul Laasner's message of "Sat, 7 Feb 2015 22:25:10 +0200") 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 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 19809 Cc: 19809@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Raul Laasner wrote: > The functions f90-beginning-of-subprogram and f90-end-of-subprogram do not > work correctly if the source file contains lines which begin with the > correct keywords but in fact belong to a continued string. For instance, in > the following, > > subroutine foo() > print*, '& > end subroutine foo' > ! The cursor is here > end subroutine foo But that's not valid Fortran? Continued strings must use '&' at the start of the continued lines as well? Eg gfortran 4.8.2 says: Warning: Missing '&' in continued character constant at (1) Ie, you must write subroutine foo() print*, '& &end subroutine foo' end subroutine foo in which case there isn't a problem. From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 11 04:53:27 2015 Received: (at 19809) by debbugs.gnu.org; 11 Feb 2015 09:53:27 +0000 Received: from localhost ([127.0.0.1]:39786 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YLTz4-0007Wl-EU for submit@debbugs.gnu.org; Wed, 11 Feb 2015 04:53:26 -0500 Received: from mail-ig0-f176.google.com ([209.85.213.176]:52417) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YLTz2-0007WY-6M for 19809@debbugs.gnu.org; Wed, 11 Feb 2015 04:53:24 -0500 Received: by mail-ig0-f176.google.com with SMTP id hl2so29607974igb.3 for <19809@debbugs.gnu.org>; Wed, 11 Feb 2015 01:53:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=iDYn5EETtZAqQ2+9q9ptXsRT4QbRE0+vNn82gTqo0lM=; b=OVAhf5jCoJVmq7jNw4ivihXOrEegMc6PPEpCE0GxsujmrDvji6RAbdKOvkg0nQpcLK KUbwimOyq5dwPxyfG8HaiUc78R8KANDdq9ZXfehQPwy92R7OIpSPfPbUAMQPJSJoO6yg 5UeYFPnTUC5narR9bz+KAO4TSL6dDuuaQREQwaI6LMi6nMD8P0tN/np4cm8W1Il3U9jH GdUaUcm4yx9Z37ZoQwgCoMZlAIog5lIrzUtqGCSAQbQF+pDih3BmNu+7sWRnUw45XtIh n7QZM1z2vcPm4KLDT34JJ/lL5ET/IXVdchckMGE1CMc/fMiSO6AqeTNC3Qzh8CXcWGK1 aPzw== MIME-Version: 1.0 X-Received: by 10.107.152.209 with SMTP id a200mr19031919ioe.14.1423648398414; Wed, 11 Feb 2015 01:53:18 -0800 (PST) Received: by 10.36.7.205 with HTTP; Wed, 11 Feb 2015 01:53:18 -0800 (PST) In-Reply-To: References: Date: Wed, 11 Feb 2015 11:53:18 +0200 Message-ID: Subject: Re: bug#19809: 24.4; f90-beginning-of-subprogram wrong behavior with string continuation From: Raul Laasner To: Glenn Morris Content-Type: multipart/alternative; boundary=001a1140fa98129c68050eccf947 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19809 Cc: 19809@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --001a1140fa98129c68050eccf947 Content-Type: text/plain; charset=UTF-8 I don't think the standard requires the second '&', although it is recommended. Moreover, GFortran permits its omission and so in practice people sometimes write such code. In any case, I have realized that the proposed modification leads to new problems because in principle one could also have subroutine foo ! & end subroutine foo or something as weird as subroutine foo ; & end subroutine foo and it's probably not worth the effort to account for such unlikely cases. If the function is used mainly interactively then it's immediately clear anyway if it fails due to unusual coding style. (On a different subject, it also fails if the subprogram ends with a bare 'end' not followed by a keyword, also allowed by the standard.) On Wed, Feb 11, 2015 at 3:27 AM, Glenn Morris wrote: > Raul Laasner wrote: > > > The functions f90-beginning-of-subprogram and f90-end-of-subprogram do > not > > work correctly if the source file contains lines which begin with the > > correct keywords but in fact belong to a continued string. For instance, > in > > the following, > > > > subroutine foo() > > print*, '& > > end subroutine foo' > > ! The cursor is here > > end subroutine foo > > But that's not valid Fortran? Continued strings must use '&' at the > start of the continued lines as well? Eg gfortran 4.8.2 says: > > Warning: Missing '&' in continued character constant at (1) > > Ie, you must write > > subroutine foo() > print*, '& > &end subroutine foo' > end subroutine foo > > in which case there isn't a problem. > -- Raul Laasner Institute of Physics University of Tartu Ravila 14c, 50411, Estonia e-mail: raullaasner@gmail.com --001a1140fa98129c68050eccf947 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I don't think the standard require= s the second '&', although it is recommended. Moreover, GFortra= n permits its omission and so in practice people sometimes write such code.= In any case, I have realized that the proposed modification leads to new p= roblems because in principle one could also have

=C2=A0 subroutine f= oo
=C2=A0 =C2=A0 ! &
=C2=A0 end subroutine foo

or something as weird as

=C2=A0 subroutine foo
=C2=A0 =C2=A0 ; &= amp;
=C2=A0 end subroutine foo

and it's probably not wo= rth the effort to account for such unlikely cases. If the function is used = mainly interactively then it's immediately clear anyway if it fails due= to unusual coding style. (On a different subject, it also fails if the sub= program ends with a bare 'end' not followed by a keyword, also allo= wed by the standard.)


On Wed, Feb 11, 2015 at 3:27 A= M, Glenn Morris <rgm@gnu.org> wrote:
Raul Laasner wrote:

> The functions f90-beginning-of-subprogram and f90-end-of-subprogram do= not
> work correctly if the source file contains lines which begin with the<= br> > correct keywords but in fact belong to a continued string. For instanc= e, in
> the following,
>
> subroutine foo()
>=C2=A0 =C2=A0print*, '&
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 end subroutine foo'
>=C2=A0 =C2=A0! The cursor is here
> end subroutine foo

But that's not valid Fortran? Continued strings must use '&'= ; at the
start of the continued lines as well? Eg gfortran 4.8.2 says:

=C2=A0 =C2=A0 Warning: Missing '&' in continued character const= ant at (1)

Ie, you must write

=C2=A0 =C2=A0subroutine foo()
=C2=A0 =C2=A0 =C2=A0print*, '&
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &end subroutine foo'
=C2=A0 =C2=A0end subroutine foo

in which case there isn't a problem.



--
Raul Laasner
Institute of Physics
University= of Tartu
Ravila 14c, 50411, Estonia
e-mail: raullaasner@gmail.com
--001a1140fa98129c68050eccf947-- From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 11 14:09:10 2015 Received: (at 19809) by debbugs.gnu.org; 11 Feb 2015 19:09:10 +0000 Received: from localhost ([127.0.0.1]:40336 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YLces-00079u-3X for submit@debbugs.gnu.org; Wed, 11 Feb 2015 14:09:10 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:59738 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YLceq-00079m-77 for 19809@debbugs.gnu.org; Wed, 11 Feb 2015 14:09:08 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1YLcep-0004EO-0m; Wed, 11 Feb 2015 14:09:07 -0500 From: Glenn Morris To: Raul Laasner Subject: Re: bug#19809: 24.4; f90-beginning-of-subprogram wrong behavior with string continuation References: X-Spook: World Trade Center Indigo Abbas emc JFK Verisign Clinton X-Ran: |g#JZ}NfpQk{_u*s{#8wBsce[7hms8y&htTtdfD|cGHux;;iH'MscZ((m9dS=R/\{T^\$K X-Hue: green X-Debbugs-No-Ack: yes X-Attribution: GM Date: Wed, 11 Feb 2015 14:09:06 -0500 In-Reply-To: (Raul Laasner's message of "Wed, 11 Feb 2015 11:53:18 +0200") 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 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 19809 Cc: 19809@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Raul Laasner wrote: > I don't think the standard requires the second '&', although it is > recommended. By my reading, it does require it. Quoting from FCD 1539-1: 3.3.2.4 Free form statement continuation: [...] If a character context is to be continued, an "&" shall be the last nonblank character on the line and shall not be followed by commentary. There shall be a later line that is not a comment; an "&" shall be the first nonblank character on the next such line and the statement continues with the next character following that "&". Maybe it has changed in newer version of the standard. From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 11 14:33:47 2015 Received: (at 19809) by debbugs.gnu.org; 11 Feb 2015 19:33:47 +0000 Received: from localhost ([127.0.0.1]:40347 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YLd2g-0007ku-7p for submit@debbugs.gnu.org; Wed, 11 Feb 2015 14:33:46 -0500 Received: from mail-ie0-f181.google.com ([209.85.223.181]:43596) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YLd2d-0007kg-GK for 19809@debbugs.gnu.org; Wed, 11 Feb 2015 14:33:44 -0500 Received: by iecrp18 with SMTP id rp18so6495972iec.10 for <19809@debbugs.gnu.org>; Wed, 11 Feb 2015 11:33:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=qybtnhzSwwk5sX0jFZKiJ/Rk2qnRPLaNfQqNx0c5l3o=; b=cvxPfwHnLhwJVNZfujj4gTzEFuoUx2vgqiW1ytnt8P3uYZ4UjP9YWbAg/3f8Fdolb2 fBwPTNybX/9WGvFD+Y7FGn2S1qQ5hxfj2OZshFUMErojPJNMJLxrJdfu45gdL//h6RGa SFnq0E6xLLX1tajarae9KgW5hKDc1uBqN7Iz/JJ+uZJDWIJgEjjlex039tXLTzJhryxA 2C/8hcM9h3FhbDUVJVdsHd9WxU/jUQVv//P9jG59KmhUIN4KR71DeMaq2NbUjmZPK7eO M8bTL1FbLjKPKbAM8WrygGCRytpjWZmCGqz9NRD1HLzG+Akx2L/bMrZeqc11mIHc0Ls7 jbsw== MIME-Version: 1.0 X-Received: by 10.50.30.130 with SMTP id s2mr5765230igh.11.1423683217567; Wed, 11 Feb 2015 11:33:37 -0800 (PST) Received: by 10.36.7.205 with HTTP; Wed, 11 Feb 2015 11:33:37 -0800 (PST) In-Reply-To: References: Date: Wed, 11 Feb 2015 21:33:37 +0200 Message-ID: Subject: Re: bug#19809: 24.4; f90-beginning-of-subprogram wrong behavior with string continuation From: Raul Laasner To: Glenn Morris Content-Type: multipart/alternative; boundary=047d7bdc0d9c74b795050ed514fa X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19809 Cc: 19809@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --047d7bdc0d9c74b795050ed514fa Content-Type: text/plain; charset=UTF-8 I stand corrected. Indeed, what I said before only applies to a noncharacter context. On Wed, Feb 11, 2015 at 9:09 PM, Glenn Morris wrote: > Raul Laasner wrote: > > > I don't think the standard requires the second '&', although it is > > recommended. > > By my reading, it does require it. > Quoting from FCD 1539-1: > > 3.3.2.4 Free form statement continuation: > > [...] > > If a character context is to be continued, an "&" shall be the last > nonblank character on the line and shall not be followed by commentary. > There shall be a later line that is not a comment; an "&" shall be the > first nonblank character on the next such line and the statement > continues with the next character following that "&". > > Maybe it has changed in newer version of the standard. > -- Raul Laasner Institute of Physics University of Tartu Ravila 14c, 50411, Estonia e-mail: raullaasner@gmail.com cell: (+372)5182268 --047d7bdc0d9c74b795050ed514fa Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I stand corrected. Indeed, what I said before only applies= to a noncharacter context.
--047d7bdc0d9c74b795050ed514fa-- From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 24 02:18:11 2015 Received: (at 19809-done) by debbugs.gnu.org; 24 Feb 2015 07:18:11 +0000 Received: from localhost ([127.0.0.1]:56018 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YQ9kx-0006Ns-78 for submit@debbugs.gnu.org; Tue, 24 Feb 2015 02:18:11 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:58890 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YQ9kv-0006Ni-9v for 19809-done@debbugs.gnu.org; Tue, 24 Feb 2015 02:18:09 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1YQ9ku-0002B9-Kr; Tue, 24 Feb 2015 02:18:08 -0500 From: Glenn Morris To: 19809-done@debbugs.gnu.org Subject: Re: bug#19809: 24.4; f90-beginning-of-subprogram wrong behavior with string continuation References: X-Spook: arrangements Tony Blair mania InfoSec Operation Iraqi X-Ran: \M9:MB'uU\2a7!*Z**Z=-%'6}rdZ8Qh(46Uv4ttw|%A^9y=t3A_J3/Jzq*]kyyfi{aBOK\ X-Hue: red X-Debbugs-No-Ack: yes X-Attribution: GM Date: Tue, 24 Feb 2015 02:18:08 -0500 In-Reply-To: (Raul Laasner's message of "Wed, 11 Feb 2015 21:33:37 +0200") 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 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 19809-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Version: 25.1 I added some support for this in e8a11db, but I suspect there are more places where f90.el assumes strings are not continued in that way. It doesn't seem especially important to me to track them all down. From unknown Tue Jun 24 05:09:12 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 24 Mar 2015 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator