[Idle-dev] User-defined "keywords"
Arthur
ajsiegel at optonline.net
Sun Feb 22 16:24:36 EST 2004
Hi all.
I had found that I missed, in IDLE, the ability to define domain specific
keywords for highlighting, ala Scite and TextPad.
I discover that doing so by hand is quite enough:
- provide ColorDelegator.py with lists of keywords,
e.g. KEYWORD2 = ["newkw1", newkw2"]
- add a line to make_pat:
kw2= r"\b" + any("KEYWORD2", pygeokeys.KEYWORD2) + r"\b"
- edit the make_pat return
return kw + "|" + kw2 ....
- provide self.tagdefs in LoadTagDefs a tag:
"KEYWORD2": {'background':'ffffff','foreground':'#007FFF'},
The end.
What I am missing is only the ability to provide other users this option in
a reasonable way. What would make sense to me is to the effect of a
config-kws.cfg in user Home with a simple syntax like:
[KEYWORD2}
'newkw1'
'newkw2'
Some default coloring scheme for a few levels of user-defined keywords.
And then the expansion of the HighLighting window to allow users to
customize the coloring of user-defined keyword levels.
Am I making sense?
Should it be pursued?
Art
More information about the IDLE-dev
mailing list