nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] [PATCH] enables syntax coloring for all GNU Make suppor


From: Benno Schulenberg
Subject: Re: [Nano-devel] [PATCH] enables syntax coloring for all GNU Make supported filenames
Date: Fri, 18 May 2018 19:38:10 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]