Message from discussion
Possible style overwrite?
Received: by 10.52.24.68 with SMTP id s4mr40016683vdf.3.1342035361820;
Wed, 11 Jul 2012 12:36:01 -0700 (PDT)
X-BeenThere: scite-interest@googlegroups.com
Received: by 10.220.230.4 with SMTP id jk4ls655370vcb.4.gmail; Wed, 11 Jul
2012 12:36:00 -0700 (PDT)
Received: by 10.52.68.141 with SMTP id w13mr35411vdt.18.1342035360185;
Wed, 11 Jul 2012 12:36:00 -0700 (PDT)
Date: Wed, 11 Jul 2012 12:35:58 -0700 (PDT)
From: zetah <klo...@gmail.com>
To: scite-interest@googlegroups.com
Message-Id: <2b8ca569-33cf-4324-983e-e65b84d4c12c@googlegroups.com>
In-Reply-To: <CAA2zXtDDkGU+_0PtA=4X8+nw+=_OvXs1bBCQjy-7Q3_JR5ECLQ@mail.gmail.com>
References: <87f3a314-b62a-4013-bf25-bbb96c28a9f9@googlegroups.com>
<0AE9C344-DECE-4020-A21E-3EA7771B679C@me.com>
<83250346-12a1-4ebd-8d76-bd1ad33e0406@googlegroups.com>
<7FF9A3CE-6956-419A-A013-A1E40038EED1@me.com>
<14c97182-626b-4516-8ad9-6e498306e147@googlegroups.com>
<CAA2zXtDDkGU+_0PtA=4X8+nw+=_OvXs1bBCQjy-7Q3_JR5ECLQ@mail.gmail.com>
Subject: Re: [scite] Possible style overwrite?
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_344_28529801.1342035358430"
------=_Part_344_28529801.1342035358430
Content-Type: multipart/alternative;
boundary="----=_Part_345_7546005.1342035358430"
------=_Part_345_7546005.1342035358430
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Thanks for your reply,
I'll just do similar to your suggestion, by adding couple of styles for
lexers I use most.
I initially thought to make it for all lexers so that I could share the
result, but if there is repetitive task and it can't be automated,
generally it's not worth the effort.
I tried regex on properties files to grab commented line above style
definitions and match it with general lexer types. I got nice table on
which I can work, but for completion I'll need to do more work for the rest
of unmatched styles. If I have patience
OTOH "colour.<definition>" variables are really nice idea for solving this
problem, also allowing user not to dig in various aspects of particular
language to determine what should be treated here as keyword and similar.
But not yet all lexer properties files are using those variables
On Wednesday, July 11, 2012 5:05:34 AM UTC+2, John Yeung wrote:
>
> > Important thing
> > learned is that there is no way for defining custom style for scite
> without
> > doing it by hand for every lexer .properties file separately.
>
> Well, it's true (as far as I know) that you have to override each
> properties file separately, but any overrides you do should be done in
> your user properties file. This way you keep them all in one place
> and you don't have to redo them if you go to a newer version of SciTE.
>
> I admit it is cumbersome to have a set of overrides for each lexer,
> but you only have to do it once. I haven't made any major changes to
> my properties in years, and the only time I have to do it is when I
> start using a new language I haven't used before.
>
> Also, if you want to keep the styles more-or-less consistent across
> different lexers, use the symbolic names instead of hex codes. For
> example, I've set
>
> # Comment
> style.python.1=$(colour.code.comment.line),$(font.comment)
> # Number
> style.python.2=$(colour.number)
> # String
> style.python.3=$(colour.string),$(font.monospace)
> # Single quoted string
> style.python.4=$(style.python.3)
> # Keyword
> style.python.5=$(colour.keyword)
>
> and so forth. Similarly, any lexer that I use regularly has its
> properties overridden in this manner. Now I can change the color of
> numbers in all the lexers *that I use* by modifying just
> $(colour.number), earlier in my user properties file.
>
> I agree that the design could have been more flexible and easier to
> customize. But going back to fix it now would probably be a
> tremendous amount of work, and more trouble than it's worth.
>
> John
>
------=_Part_345_7546005.1342035358430
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
<div>Thanks for your reply,</div><div><br></div><div>I'll just do similar t=
o your suggestion, by adding couple of styles for lexers I use most.</div><=
div><br></div><div>I initially thought to make it for all lexers so that I =
could share the result, but if there is repetitive task and it can't be aut=
omated, generally it's not worth the effort.</div><div>I tried regex on pro=
perties files to grab commented line above style definitions and match it w=
ith general lexer types. I got nice table on which I can work, but for comp=
letion I'll need to do more work for the rest of unmatched styles. If I hav=
e patience</div><div><br></div><div>OTOH "colour.<definition>" variab=
les are really nice idea for solving this problem, also allowing user not t=
o dig in various aspects of particular language to determine what should be=
treated here as keyword and similar. But not yet all lexer properties file=
s are using those variables</div><div><br><br>On Wednesday, July 11, 2012 5=
:05:34 AM UTC+2, John Yeung wrote:<blockquote class=3D"gmail_quote" style=
=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: =
1ex;">> Important thing
<br>> learned is that there is no way for defining custom style for scit=
e without
<br>> doing it by hand for every lexer .properties file separately.
<br>
<br>Well, it's true (as far as I know) that you have to override each
<br>properties file separately, but any overrides you do should be done in
<br>your user properties file. This way you keep them all in one plac=
e
<br>and you don't have to redo them if you go to a newer version of SciTE.
<br>
<br>I admit it is cumbersome to have a set of overrides for each lexer,
<br>but you only have to do it once. I haven't made any major changes=
to
<br>my properties in years, and the only time I have to do it is when I
<br>start using a new language I haven't used before.
<br>
<br>Also, if you want to keep the styles more-or-less consistent across
<br>different lexers, use the symbolic names instead of hex codes. Fo=
r
<br>example, I've set
<br>
<br># Comment
<br>style.python.1=3D$(colour.code.<wbr>comment.line),$(font.comment)
<br># Number
<br>style.python.2=3D$(colour.<wbr>number)
<br># String
<br>style.python.3=3D$(colour.<wbr>string),$(font.monospace)
<br># Single quoted string
<br>style.python.4=3D$(style.python.<wbr>3)
<br># Keyword
<br>style.python.5=3D$(colour.<wbr>keyword)
<br>
<br>and so forth. Similarly, any lexer that I use regularly has its
<br>properties overridden in this manner. Now I can change the color =
of
<br>numbers in all the lexers *that I use* by modifying just
<br>$(colour.number), earlier in my user properties file.
<br>
<br>I agree that the design could have been more flexible and easier to
<br>customize. But going back to fix it now would probably be a
<br>tremendous amount of work, and more trouble than it's worth.
<br>
<br>John
<br></blockquote></div>
------=_Part_345_7546005.1342035358430--
------=_Part_344_28529801.1342035358430--