Highlighting Information

The user can interrogate the current window to determine the color highlighting used on a particular piece of text. The following functions provide information on the highlighting pattern against which text at a particular position has been matched, its style, color and font attributes (whether the font is supposed to be bold and/or italic).

These macro functions permit macro writers to generate formatted output which allows XNEdit highlighting to be reproduced. This is suitable for the generation of HTML or Postscript output, for example.

Note that if any of the functions is used while in Plain mode or while syntax highlighting is off, the behaviour is undefined.

get_pattern_by_name( pattern_name )
Returns an array containing the pattern attributes for pattern 'pattern_name'. The elements in this array are:

If 'pattern_name' is invalid, an empty array is returned.

get_pattern_at_pos( pos )
Returns an array containing the pattern attributes of the character at position 'pos'. The elements in this array are:

The 'extent' value is measured from position 'pos' going right/down (forward in the file) only.

If 'pos' is invalid, an empty array is returned.

get_style_by_name( style_name )
Returns an array containing the style attributes for style 'style_name'. The elements in this array are:

The colors use the names specified in the color definitions for the style. These will either be names matching those the X server recognises, or RGB (red/green/blue) specifications.

If 'style_name' is invalid, an empty array is returned.

get_style_at_pos( pos )
Returns an array containing the style attributes of the character at position 'pos'. The elements in this array are:

The colors use the names specified in the color definitions for the style. These will either be names matching those the X server recognises, or RGB specifications. The values for 'rgb' and 'back_rgb' contain the actual color values allocated by the X server for the window. If the X server cannot allocate the specified (named) color exactly, the RGB values in these entries may not match the specified ones.

The 'extent' value is measured from position 'pos' going right/down (forward in the file) only.

If 'pos' is invalid, an empty array is returned.