|
From: | Cristian Caloghera |
Subject: | Re: [Nano-devel] [PATCH] enables syntax coloring for all GNU Make supported filenames |
Date: | Tue, 22 May 2018 16:03:49 +0200 |
Hello Cristian,
Op 18-05-18 om 15:05 schreef Cristian Caloghera:
> Subject: [PATCH] enables syntax coloring for all GNU Make supported filenames
>
> makefile.nanorc now recognizes all the filename which GNU Make looks for:
> * GNUmakefile
> * makefile
> * Makefile
>
> [...]
>
> -syntax makefile "Makefile[^/]*$" "\.(make|mk)$"
> +syntax makefile "((GNU)?m|M)akefile[^/]*$" "\.(make|mk)$"
Thanks for the improvement. The "(GNU)?" part, however, does not add
anything, because the regex will also match FooBarMakefile, for example,
and all other names that end with Makefile or makefile. Maybe this is
wrong? If yes, then the regex should begin with a slash:
"/((GNU)?m|M)akefile[^/]*$"
This will work because the regex is matched against the absolute filename,
not against the filename as provided on the command line.
By the way, the syntax would color the keyword "endif" magenta, but
makefiles don't seem to contain that keyword -- they contain "elif"
and "fi", though, but they are not colored. They also contain "case"
and "esac" and "for" and "do" and "done", which are all left uncolored.
However, Vim and Emacs and Joe don't color any of these keywords at all
(except that Emacs colors "else") -- maybe nano should neither?
Benno
0001-enables-syntax-coloring-for-all-GNU-Make-supported-f.patch
Description: Binary data
0002-makefile.nanorc-match-files-that-actually-start-with.patch
Description: Binary data
[Prev in Thread] | Current Thread | [Next in Thread] |