http://www.alh.net/newlisp/phpbb/viewtopic.php?t=941
I gave it a try and get it working with a few changes to ctext:

The line numbering is a little side effect! ;-)
Now is there a list what commands are grouped together in what color?
So I start with the first one.ctext::addHighlightClass $txt commands blue
- #ctext::addHighlightClass $txt flags color [list ???]
#ctext::addHighlightClassWithOnlyCharStart $txt vars color "\$"
#ctext::addHighlightClassForSpecialChars $txt brackets green {[]{}}
#ctext::addHighlightClassForRegexp $txt paths lightblue {\.[a-zA-Z0-9\_\-]+}
TCL/TK has grown over years and has a lot of extensions.How does the TK version highlight the syntax anyway? It seems a function within TCL/TK itself?
Code: Select all
;Helperlisp for getting keywords
(device (open "keywords.txt" "w"))
(dolist (s (symbols)) (if (primitive? (eval s)) (println s)))
(close (device))
(device (open "keywords.tcl" "w"))
(setq commandstring "set Ide(newLISPCommands) [list ")
(dolist (s (symbols)) (if (primitive? (eval s)) (setq commandstring (string commandstring s " "))))
(setq commandstring (string commandstring "]"))
(println commandstring)
(close (device))
Using now in newlisp-tk.tcl:set Ide(newLISPCommands) [list ! != $ % & * + - / < << <= = > >= >> NaN? ^ abs ..... ]
set Ide(CommandColor) blue
set Ide(StringColor) orange
set Ide(CommentColor) turquoise4
Code: Select all
ctext::addHighlightClass $txt commands $Ide(CommandColor) $Ide(newLISPCommands)
ctext::addHighlightClassForSpecialChars $txt paranthesis red {()}
ctext::addHighlightClassForSpecialChars $txt brackets darkred {[]}
ctext::addHighlightClassForRegexp $txt dstrings $Ide(StringColor) {\".*\"}
ctext::addHighlightClassForRegexp $txt cstrings $Ide(StringColor) {{.*}}
ctext::addHighlightClassForRegexp $txt tstrings $Ide(StringColor) {\[text\].*\[/text\]}
ctext::addHighlightClassForRegexp $txt comments $Ide(CommentColor) {;.*}
Enable/Disable the linemap in console and editor.set Ide(ConsoleLineMap) 1
set Ide(EditLineMap) 0
Not absolute sure.Is ctext part of the normal Tcl/Tk 8.4 library?
It could be so. Give it a simple try first.I mean do I get it with the Freewrap distribution? Or would it be an add-on like BWidget?