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

Full log


View this message in rfc822 format

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?



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

Previous Next


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