CodeCommander

-

Customization Information

CodeCommander is one of the most customizable applications in the entire GNOME collection. The reason for this is it's use of Python or Guile as a scripting language. This file is here to help you customize CodeCommander to fit your specific needs.




Language Definition Information

A line may be commented out by placing a '#' in the first column
CodeCommander uses the GNU regex library.

[Section 1: General Settings]

<settings>               // beginning tag
language=C/C++                 // Description of the language
compiler=gcc -g %2 -o %3 2>&1  // the command to use for compiling (by default)
debugger=xterm -e gdb %3       // command for debugging
execution=./%3                 // command for execution
auto_indent=1                  // is auto indenting on?
indent_chars={                 // list of chars that should envoke an auto-tab (after pressing enter)
use_spaces=0                   // should spaces be used instead of tabs?
tab_stop=4                     // how wide (in spaces) are tabs?
</settings>              // end tag

Constants for compiler, debugger and execution:
%term% = the default terminal command, as set in the general preferences.
%make% = the default make command, as set in the general preferences.
%1 = Path to the current file, as set in the directory entry, or if the directory entry is empty, it will be the path to the current file.
%2 = The name of the file without path, but with extension. (if it has one)
%3 = The name of the file without path or extension.

[Section 2: Supported Extensions]

<extensions>
 <item name="c source file" ext="c">
 <item name="include file" ext="h">
 <item name="c++ source file" ext="cpp">
</extensions>
This is simply a list of supported extensions.

[Section 3: Highlighting between 2 regex's]

<syntax>
 <item name="string" start="\"" end="\"" color="string" class="d">
</syntax>
or...
<python>
import cc
cc.add_syntax_entry("string", "\"", "\(\"\|\n\)", "string", "d")
</python>
or...
<guile>
(add-syntax-entry "string" "\"" "\\(\"\\|\\n\\)" "string" "d")
</guile>

Note: cc is the python module for CodeCommander.
Arg1: the name of the highlight class.
Arg2: the regex of the start of the highlight.
Arg3: the regex of the end of the highlight.
Arg4: the color class (see section 6)
Arg5: the font class (see section 7)

[Section 4: Highlighting words and characters]

<pattern>
 <item name="labels" words="^[a-zA-Z_]*\:" color="function" class="b">
</pattern>
or...
<python>
import cc
cc.add_pattern_entry("labels", "^[a-zA-Z_]*\:", "function", "b")
</python>
or...
<guile>
(add-pattern-entry "labels" "^[a-zA-Z_]*\\:" "function" "b")
</guile>

Note: cc is the python module for CodeCommander.
Arg1: the name of the highlight class.
Arg2: the regex of the 'words' to highlight.
Arg3: the color class (see section 6)
Arg4: the font class (see section 7)

Note: notice that guile often times uses 2 '\' characters instead of 1.
This is due to it's string parsing routines. Just deal with it :-)

[Section 5: Highlighting words and characters between 2 specified regex's]

<embedded>
 <item name="keywords1" start="<" words="\b\(bgcolor\|size\|target\|href\)\b" end=">" color="data_type" class="i">
</embedded>
<python>
import cc
cc.add_embedded_entry("keywords1", "<", r'\b\(bgcolor\|size\|target\|href\)\b', ">", "data_type", "i")
</python>
or...
<guile>
(add-embedd