* bug#17222: 24.3; In f90-mode variables declared in continuation lines are not colored.
@ 2014-04-08 14:45 Luca Cartasegna
2022-05-11 14:12 ` Lars Ingebrigtsen
2022-05-17 15:20 ` Mattias Engdegård
0 siblings, 2 replies; 8+ messages in thread
From: Luca Cartasegna @ 2014-04-08 14:45 UTC (permalink / raw)
To: 17222
[-- Attachment #1: Type: text/plain, Size: 5493 bytes --]
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)
[-- Attachment #2: Type: text/html, Size: 25522 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#17222: 24.3; In f90-mode variables declared in continuation lines are not colored.
2014-04-08 14:45 bug#17222: 24.3; In f90-mode variables declared in continuation lines are not colored Luca Cartasegna
@ 2022-05-11 14:12 ` Lars Ingebrigtsen
2022-05-17 15:20 ` Mattias Engdegård
1 sibling, 0 replies; 8+ messages in thread
From: Lars Ingebrigtsen @ 2022-05-11 14:12 UTC (permalink / raw)
To: Luca Cartasegna; +Cc: 17222
[-- Attachment #1: Type: text/plain, Size: 512 bytes --]
Luca Cartasegna <cartasegna.luca@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:
[-- Attachment #2: Type: image/png, Size: 26969 bytes --]
[-- Attachment #3: Type: text/plain, Size: 106 bytes --]
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#17222: 24.3; In f90-mode variables declared in continuation lines are not colored.
2014-04-08 14:45 bug#17222: 24.3; In f90-mode variables declared in continuation lines are not colored Luca Cartasegna
2022-05-11 14:12 ` Lars Ingebrigtsen
@ 2022-05-17 15:20 ` Mattias Engdegård
2022-05-17 17:32 ` Lars Ingebrigtsen
1 sibling, 1 reply; 8+ messages in thread
From: Mattias Engdegård @ 2022-05-17 15:20 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: Luca Cartasegna, 17222
> 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?
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#17222: 24.3; In f90-mode variables declared in continuation lines are not colored.
2022-05-17 15:20 ` Mattias Engdegård
@ 2022-05-17 17:32 ` Lars Ingebrigtsen
2022-05-24 15:40 ` Mattias Engdegård
0 siblings, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2022-05-17 17:32 UTC (permalink / raw)
To: Mattias Engdegård; +Cc: Luca Cartasegna, 17222
Mattias Engdegård <mattiase@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
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#17222: 24.3; In f90-mode variables declared in continuation lines are not colored.
2022-05-17 17:32 ` Lars Ingebrigtsen
@ 2022-05-24 15:40 ` Mattias Engdegård
2022-05-24 16:03 ` Lars Ingebrigtsen
0 siblings, 1 reply; 8+ messages in thread
From: Mattias Engdegård @ 2022-05-24 15:40 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: Luca Cartasegna, 17222
17 maj 2022 kl. 19.32 skrev Lars Ingebrigtsen <larsi@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?
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#17222: 24.3; In f90-mode variables declared in continuation lines are not colored.
2022-05-24 15:40 ` Mattias Engdegård
@ 2022-05-24 16:03 ` Lars Ingebrigtsen
2022-05-24 18:18 ` Mattias Engdegård
0 siblings, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2022-05-24 16:03 UTC (permalink / raw)
To: Mattias Engdegård; +Cc: Luca Cartasegna, 17222
Mattias Engdegård <mattiase@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
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#17222: 24.3; In f90-mode variables declared in continuation lines are not colored.
2022-05-24 16:03 ` Lars Ingebrigtsen
@ 2022-05-24 18:18 ` Mattias Engdegård
2022-05-25 0:17 ` Lars Ingebrigtsen
0 siblings, 1 reply; 8+ messages in thread
From: Mattias Engdegård @ 2022-05-24 18:18 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: Luca Cartasegna, 17222
24 maj 2022 kl. 18.03 skrev Lars Ingebrigtsen <larsi@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.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-05-25 0:17 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-08 14:45 bug#17222: 24.3; In f90-mode variables declared in continuation lines are not colored Luca Cartasegna
2022-05-11 14:12 ` Lars Ingebrigtsen
2022-05-17 15:20 ` Mattias Engdegård
2022-05-17 17:32 ` Lars Ingebrigtsen
2022-05-24 15:40 ` Mattias Engdegård
2022-05-24 16:03 ` Lars Ingebrigtsen
2022-05-24 18:18 ` Mattias Engdegård
2022-05-25 0:17 ` Lars Ingebrigtsen
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.