nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] disable a time-consuming multiline regex?


From: doark
Subject: Re: [Nano-devel] disable a time-consuming multiline regex?
Date: Mon, 18 Jan 2016 13:38:42 -0500

On Fri, 01 Jan 2016 11:04:23 Benno Schulenberg wrote:

> On Wed, Dec 30, 2015, at 20:32, David Niklas wrote:
> > [...] I also added additional hash tags for the comments,  
> 
> Please don't mix cosmetic changes with functional ones.
>
> > as that
> > is what most people, and nanorc highlighting use for comments.  
> 
> No they don't.  The gentoo one does, none of the others do.
> 

% grep -E '^##[^#]' nano-trunk/doc/syntax/*.nanorc | wc -l
67
% grep -E '^#[^#]' nano/doc/syntax/*.nanorc | wc -l
253

I was only interested in making everything similar. Here is a snippet
from nanorc.nanorc
icolor cyan "^[[:space:]]*##.*$"
This told me that using ## was considered appropriate by the nano folks
for their files, if this is not the case please remove this offending
snippet from the said file or change it to bring up a red error colour.

> > If you find any of the regex's difficult, just ask, or use grep on
> > some source files.  
> 
> Stop being so condescending.
> 
> More importantly: don't make me ask for explanations.  You provide
> a patch, on you is the burden to explain why it is needed, why the
> changes improve things, what problems they solve.
> 
> > -color brightyellow "<[^=   ]*>" ""(\\.|[^"])*""
> > +color brightwhite ""[^"\\]*""  
> 
> Why is ""[^"\\]*"" better than the two regexes on the line before?

Regex one matches non-C-strings, it matches include directives for system
header files, which are preprocessor strings, I can change it.
Regex two matches a period or something not a double quote, this is
duplicative.
Come to think of it I should remove the \\ from my regex.

> > +## CPP directives. They need to go after strings because the can
> > include strings. +color brightwhite,cyan
> > "^[[:blank:]]*#[[:blank:]]*(define|(un|ifn?)def|endif|el(if|se)|if|warning|error|pragma)[[:graph:]]*"
> >   
> 
> That you changed [[:space:]] to [[:blank:]] is good.  But why did you
> add [[:graph:]]* at the end?  What is it supposed to cover?  And why
> does the patch not remove the earlier line that covers preprocessor
> directives?
> 

So that the colours would go across the whole line, I like it that way.



I could continue quoting you both (and I'm sorry for being haughty), but I
think we are several different people with multiple very different
versions of what should be what colour, if it should be coloured and what
should be coloured, etc. If you would show me for this first patch what
you expect I will better be able to submit patches against the c.nanorc in
the future (which I intend to do).
Or I can work with what you've said previously.

Thanks, David



reply via email to

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