JED is now able to do simple syntax highlighting while in C mode. To enable syntax highlighting, set the variable `WANT_SYNTAX_HIGHLIGHT' to 1. On Unix and VMS systems, it is also necessary to set the variable `USE_ANSI_COLORS' to a non-zero value. To control how to highlight in C mode, use the `set_color' function. This function takes three parameters: the first says what to color and the last two specify what foreground and background colors to use. The `what' parameter can be any one of: "operator" : `+', `-', `*', `/', `?', etc. "number" : 1.23, -3, 0x101, etc... "comment" : /* c comment */ // c++ comment "string" : "anything in single or double quotes" "keyword" : c++ keywords such as `if', `while', `register', `class' "delimeter" : Braces {}, parenthesis, commas, etc... "preprocess" : Lines starting with `#' Any other object not falling in any of the above categories is not highlighted. To avoid the task of parsing the buffer on every screen update, comments must either be confined to a single line, or have the following format: /* This is a multi-line * comment. Note how the lines * following the initial one * start with a `*' followed by a * whitespace character */ That is, the second, third, and lines must start with one or more `*' followed by at least one whitespace character. This means that *p++ = ' '; will not be interpreted as comment but * p++ = ' '; will be flagged by the editor as a comment line. Finally, if the screen is panned to the right, syntax highlighting will dometimes fail. This is because the highlighting is performed based entirely upon the visible information. This is only a problem when strings are split with the beginning off to the left of the display (not visible) and the end lying in the visible portion of the buffer. A similar statement holds for comments as well.