GNU bug report logs - #17222
24.3; In f90-mode variables declared in continuation lines are not colored.

Previous Next

Package: emacs;

Reported by: Luca Cartasegna <cartasegna.luca <at> gmail.com>

Date: Tue, 8 Apr 2014 15:42:01 UTC

Severity: minor

Found in version 24.3

To reply to this bug, email your comments to 17222 AT debbugs.gnu.org.

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-gnu-emacs <at> gnu.org:
bug#17222; Package emacs. (Tue, 08 Apr 2014 15:42:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Luca Cartasegna <cartasegna.luca <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 08 Apr 2014 15:42:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Luca Cartasegna <cartasegna.luca <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3;
 In f90-mode variables declared in continuation lines are not colored.
Date: Tue, 8 Apr 2014 16:45:59 +0200
[Message part 1 (text/plain, inline)]
Hello,

breaking lines in variables declaration seems to break the color
syntax.

cat main.f90:
program main
integer :: a, &
     b
end program main

The variable a is correctly colored while the variable b is
not(using continuation lines in other parts of the program, not in the
variable declaration, seems to work fine).

Cheers!

Luca




In GNU Emacs 24.3.1 (x86_64-apple-darwin13.1.0, Carbon Version 1.6.0 AppKit
1265.19)
of 2014-04-05 on tennine-slave.macports.org
Windowing system distributor `Apple Inc.', version 10.9.2
Configured using:
`configure '--prefix=/opt/local' '--with-mac'
'--enable-mac-app=/Applications/MacPorts' '--without-rsvg'
'--without-imagemagick' 'CC=/usr/bin/clang' 'CFLAGS=-pipe -Os
-fobjc-arc -arch x86_64' 'LDFLAGS=-L/opt/local/lib
-Wl,-headerpad_max_install_names -arch x86_64'
'CPPFLAGS=-I/opt/local/include''

Important settings:
locale-coding-system: utf-8-unix
default enable-multibyte-characters: t

Major mode: Info

Minor modes in effect:
tooltip-mode: t
mac-mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
buffer-read-only: t
line-number-mode: t
transient-mark-mode: t

Recent input:
<tool-bar> <Back in history> <help-echo> <help-echo>
<down> <down> <down> <down> <down> <down> <right> <right>
<right> <right> <right> <right> <right> <up> <up> <up>
<up> <right> <right> <right> <right> <right> <right>
<right> <right> <right> <right> <right> <right> <right>
<right> <right> <right> <right> <return> C-x b <return>
<up> <up> <down> C-a & <tab> <tab> <right> <right>
<right> <right> <right> <right> <right> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> SPC C-x C-s <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <return> <tab> C-x C-s C-x
b <return> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <return> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> M-<
<help-echo> <help-echo> <help-echo> <help-echo> <tool-bar>
<Back in history> <help-echo> <help-echo> <help-echo>
<return> <help-echo> <help-echo> <help-echo> <help-echo>
<tool-bar> <Back in history> <help-echo> <help-echo>
<help-echo> <help-echo> <down> <help-echo> <help-echo>
<return> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <up> <up>
<up> <up> <up> M-< <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <tool-bar> <Back
in history> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <down-mouse-1> <mouse-2> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> M-< <help-echo> <help-echo> <help-echo>
<tool-bar> <Back in history> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <down-mouse-1>
<mouse-2> <help-echo> <down> <down> <down> <down> C-e
<left> <left> <left> <left> <return> <help-echo> <help-echo>
<help-echo> <tool-bar> <Back in history> <help-echo>
<help-echo> <down> <down> <down> <down> <down> M-x
r e p o <tab> r t <tab> <return>

Recent messages:
Note: file is write protected
View mode: type C-h for help, h for commands, q to quit.
Mark saved where search started [2 times]
Mark set
Saving file /Volumes/Data/Luca/Desktop/temp/main.f90...
Wrote /Volumes/Data/Luca/Desktop/temp/main.f90
Saving file /Volumes/Data/Luca/Desktop/temp/main.f90...
Wrote /Volumes/Data/Luca/Desktop/temp/main.f90
Mark set [3 times]
Making completion list...

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message idna format-spec
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils browse-url goto-addr thingatpt noutline
outline easy-mmode view misearch multi-isearch f90 cus-edit cus-start
cus-load wid-edit jka-compr flycheck find-func help-mode rx f dash s
solarized-dark-theme solarized flycheck-autoloads info easymenu
f-autoloads dash-autoloads pkg-info-autoloads epl-autoloads finder-inf
s-autoloads solarized-theme-autoloads package time-date tooltip
ediff-hook vc-hooks lisp-float-type mwheel mac-win tool-bar dnd fontset
image regexp-opt fringe tabulated-list newcomment lisp-mode register
page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core frame cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew
greek romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote mac multi-tty make-network-process emacs)
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17222; Package emacs. (Wed, 11 May 2022 14:13:01 GMT) Full text and rfc822 format available.

Message #8 received at 17222 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Luca Cartasegna <cartasegna.luca <at> gmail.com>
Cc: 17222 <at> debbugs.gnu.org
Subject: Re: bug#17222: 24.3; In f90-mode variables declared in continuation
 lines are not colored.
Date: Wed, 11 May 2022 16:12:16 +0200
[Message part 1 (text/plain, inline)]
Luca Cartasegna <cartasegna.luca <at> gmail.com> writes:

> breaking lines in variables declaration seems to break the color
> syntax.
>
> cat main.f90:
> program main
> integer :: a, &
>      b
> end program main
>
> The variable a is correctly colored while the variable b is
> not(using continuation lines in other parts of the program, not in the
> variable declaration, seems to work fine).

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

I've now fixed this in Emacs 29:

[Message part 2 (image/png, inline)]
[Message part 3 (text/plain, inline)]


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

bug marked as fixed in version 29.1, send any further explanations to 17222 <at> debbugs.gnu.org and Luca Cartasegna <cartasegna.luca <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 11 May 2022 14:13:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17222; Package emacs. (Tue, 17 May 2022 15:21:02 GMT) Full text and rfc822 format available.

Message #13 received at 17222 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Luca Cartasegna <cartasegna.luca <at> gmail.com>, 17222 <at> debbugs.gnu.org
Subject: bug#17222: 24.3; In f90-mode variables declared in continuation lines
 are not colored. 
Date: Tue, 17 May 2022 17:20:46 +0200
> I've now fixed this in Emacs 29: 

Thank you for doing this. Relint complained about this part:

-\\(.*::\\|[ \t]*(.*)\\)?\\([^&!\n]*\\)"
-      (1 font-lock-type-face t) (4 font-lock-variable-name-face t))
+\\(.*::\\|[ \t]*(.*)\\)?\\(\\(?:[^&!\n]*\\(?:&\n\\)?\\)+\\)"
+      (1 font-lock-type-face t) (4 font-lock-variable-name-face append))

More specifically, the

\\(?:[^&!\n]*\\(?:&\n\\)?\\)+

part at the end is a potential empty-string repetition that indicates an ambiguity which we'd like to remove.
What is the desired grammar here? Moving to rx for clarity, the above snippet means

(+ (* (not (in "\n!&")))
  (? "&\n"))

What about rewriting it as

(: (* (not (in "\n!&")))
  (* "&\n"
     (* (not (in "\n!&")))))

which should be equivalent but unambiguous?

However there may be something more fundamentally wrong with the original change, because it only seems to work for me after loading a file, not when writing the code incrementally. More precisely, when I've typed

program main
 integer :: alpha, &&

in a new buffer then everything looks correctly coloured, but if I add

  beta

to the next line then it isn't fontified at all. Saving and reloading the buffer helps. Can you confirm?



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17222; Package emacs. (Tue, 17 May 2022 17:33:01 GMT) Full text and rfc822 format available.

Message #16 received at 17222 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: Luca Cartasegna <cartasegna.luca <at> gmail.com>, 17222 <at> debbugs.gnu.org
Subject: Re: bug#17222: 24.3; In f90-mode variables declared in continuation
 lines are not colored.
Date: Tue, 17 May 2022 19:32:11 +0200
Mattias Engdegård <mattiase <at> acm.org> writes:

> part at the end is a potential empty-string repetition that indicates an ambiguity which we'd like to remove.
> What is the desired grammar here? Moving to rx for clarity, the above snippet means
>
> (+ (* (not (in "\n!&")))
>   (? "&\n"))
>
> What about rewriting it as
>
> (: (* (not (in "\n!&")))
>   (* "&\n"
>      (* (not (in "\n!&")))))
>
> which should be equivalent but unambiguous?

Yes, I think that's correct.

> However there may be something more fundamentally wrong with the original change, because it only seems to work for me after loading a file, not when writing the code incrementally. More precisely, when I've typed
>
> program main
>  integer :: alpha, &&
>
> in a new buffer then everything looks correctly coloured, but if I add
>
>   beta
>
> to the next line then it isn't fontified at all. Saving and reloading the buffer helps. Can you confirm?

Yes.  I had forgotten all about the rules for multiline font locking
(i.e., (elisp)Multiline Font Lock).  So I think my changes here were
basically misguided, and this should be implemented in a totally
different way.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17222; Package emacs. (Tue, 24 May 2022 15:42:02 GMT) Full text and rfc822 format available.

Message #19 received at 17222 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Luca Cartasegna <cartasegna.luca <at> gmail.com>, 17222 <at> debbugs.gnu.org
Subject: Re: bug#17222: 24.3; In f90-mode variables declared in continuation
 lines are not colored. 
Date: Tue, 24 May 2022 17:40:57 +0200
17 maj 2022 kl. 19.32 skrev Lars Ingebrigtsen <larsi <at> gnus.org>:

> Yes.  I had forgotten all about the rules for multiline font locking
> (i.e., (elisp)Multiline Font Lock).  So I think my changes here were
> basically misguided, and this should be implemented in a totally
> different way.

Perhaps this bug should be reopened then since it's not really been satisfactorily resolved, and revert the change?





bug No longer marked as fixed in versions 29.1 and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 24 May 2022 16:03:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17222; Package emacs. (Tue, 24 May 2022 16:04:02 GMT) Full text and rfc822 format available.

Message #24 received at 17222 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: Luca Cartasegna <cartasegna.luca <at> gmail.com>, 17222 <at> debbugs.gnu.org
Subject: Re: bug#17222: 24.3; In f90-mode variables declared in continuation
 lines are not colored.
Date: Tue, 24 May 2022 18:03:17 +0200
Mattias Engdegård <mattiase <at> acm.org> writes:

>> Yes.  I had forgotten all about the rules for multiline font locking
>> (i.e., (elisp)Multiline Font Lock).  So I think my changes here were
>> basically misguided, and this should be implemented in a totally
>> different way.
>
> Perhaps this bug should be reopened then since it's not really been
> satisfactorily resolved, and revert the change?

Now reopened.  I'm not sure about reverting -- the patch doesn't make
things worse.  It just doesn't do it right, either.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17222; Package emacs. (Tue, 24 May 2022 18:19:02 GMT) Full text and rfc822 format available.

Message #27 received at 17222 <at> debbugs.gnu.org (full text, mbox):

From: Mattias Engdegård <mattiase <at> acm.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Luca Cartasegna <cartasegna.luca <at> gmail.com>, 17222 <at> debbugs.gnu.org
Subject: Re: bug#17222: 24.3; In f90-mode variables declared in continuation
 lines are not colored. 
Date: Tue, 24 May 2022 20:18:08 +0200
24 maj 2022 kl. 18.03 skrev Lars Ingebrigtsen <larsi <at> gnus.org>:

> Now reopened.  I'm not sure about reverting -- the patch doesn't make
> things worse.  It just doesn't do it right, either.

That's fine. I pushed the regexp disambiguating suggestion mentioned earlier; hope it's all right.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17222; Package emacs. (Wed, 25 May 2022 00:18:02 GMT) Full text and rfc822 format available.

Message #30 received at 17222 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: Luca Cartasegna <cartasegna.luca <at> gmail.com>, 17222 <at> debbugs.gnu.org
Subject: Re: bug#17222: 24.3; In f90-mode variables declared in continuation
 lines are not colored.
Date: Wed, 25 May 2022 02:17:45 +0200
Mattias Engdegård <mattiase <at> acm.org> writes:

> That's fine. I pushed the regexp disambiguating suggestion mentioned
> earlier; hope it's all right.

Sure; looks good.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 3 years and 19 days ago.

Previous Next


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