Lugaru's Epsilon
Editor 14.00

Epsilon User's Manual and Reference
   Primitives and EEL Subroutines
      Display Primitives
         . . .
         Window Titles and Mode Lines
         Normal Buffer Display
            Screen Dimensions
            Character Display
            Character Widths and Columns
         Displaying Status Messages
         . . .

Previous   Up    Next
Screen Dimensions  Primitives and EEL Subroutines   Character Widths and Columns

Epsilon User's Manual and Reference > Primitives and EEL Subroutines > Display Primitives > Normal Buffer Display >

Character Display

buffer char *_display_class;
user buffer short tab_size;
char *_echo_display_class;

Modifying the character array _display_class lets you alter the way Epsilon displays characters. There is one position in the array for each of the 65,536 possible characters in a buffer. The code at each position determines how Epsilon displays the character when it appears in a buffer. This code is a display code.

Epsilon lets each character occupy one or more screen positions. For example, the Control-A character is usually shown in two characters on the screen as "^A". The number of columns the <Tab> character occupies depends on the column it starts in. Epsilon uses the display codes 0 through 6 to produce the various multi-character representations it is capable of, as described below.

Besides these multi-character display codes, Epsilon provides a way to have one character display as another. If the display code of a character is not one of the special display codes 0 through 7, Epsilon interprets the display code as a graphics character. This graphics character becomes the single-column representation.

For example, if the display code for "A" is "B" (that is, if the value of _display_class['A'] is the character "B"), wherever an "A" appears in the buffer, a "B" will appear on the screen when it is displayed. The character is still really an "A", however: only searches for "A" will find it, an "A" will be written if you save the file, and so forth. This facility is especially useful for supporting national character sets.

If a display code is from 0 to 7, it has a special meaning. By default, all characters have such a display code. These numbers have been given names in the file codes.h, and we'll use the names in this discussion for clarity.

Epsilon displays a character with display code BNORMAL as the character itself. If character 65, the letter 'A', has display code BNORMAL it is the same as if it had display code 65.

Epsilon displays a character with display code BTAB as a tab. The character is displayed as the number of blanks necessary to reach the next tab stop. The buffer-specific primitive variable tab-size sets the number of columns from one tab stop to the next. By default its value is eight.

A character with display code BNEWLINE goes to the start of the next line when displayed, as newline does normally.

Epsilon displays a character with display code BC as a control character. It is displayed as the ^ character, followed by the original character exclusive-or'ed with 64, and with the high bit stripped. BM and BMC are similar, with the prefix being M- and M-^, respectively.

Epsilon displays a character with display code BHEX as a hexadecimal number in the form "xB7". Specifically, the representation has the letter 'x', then the two-character hexadecimal character code (or four digits for character codes over 255). You can change many of the characters Epsilon uses for its representations of newlines, tabs, hex characters, and so forth; see below.

Finally, Epsilon for Windows uses the display code BDOUBLEWIDTH for an experimental feature supporting those East Asian languages that have double-width characters in a fixed-width font. In this version the feature is normally disabled, and the display code is reserved for future use.

By default, the tab character has code BTAB, the newline character has code BNEWLINE, and the other control characters have code BC. Control characters with the eighth bit set have code BMC. All other characters have code BNORMAL.

The variable _display_class is actually a buffer-specific pointer to the array of display codes. Normally, all these pointers refer to the same array, contained in the variable _std_disp_class defined in cmdline.e. You can create other arrays if you wish to have different buffers display characters in different ways. Whenever you change the _display_class variable, build_first must be set to make the change take effect, as described above.

When displaying text in the echo area, Epsilon uses the display class array pointed to by the _echo_display_class variable. It can have the same values as _display_class.

char _display_characters[ ];
buffer char *buffer_display_characters;

It is possible to change the characters Epsilon uses to display certain parts of the screen such as the border between windows. Epsilon gets such characters from the _display_characters array. This array contains the line-drawing characters that form window borders, the characters Epsilon uses in some of the display modes set by set-show-graphic, and the characters it uses to construct the scroll bar. The set-display-characters command may be used to set these characters.

If the buffer-specific variable buffer_display_characters is non-null in a buffer, Epsilon uses it in place of the _display_characters variable whenever it displays that buffer. You can use this to provide a special window border, scroll bar, or similar for a particular buffer. Epsilon's change-show-spaces command uses this variable, too.

int expand_display(char *to, char *from)

The expand_display( ) primitive expands characters to the multicharacter representations they would have if displayed on the screen. It returns the length of the result.

Previous   Up    Next
Screen Dimensions  Primitives and EEL Subroutines   Character Widths and Columns

Lugaru Epsilon Programmer's Editor 14.00 manual. Copyright (C) 1984, 2020 by Lugaru Software Ltd. All rights reserved.