Next: , Previous: , Up: Representation of Text   [Contents][Index]


2.2 Marks

A mark indicates a specific position within the text represented by a line and a character position within that line. Although a mark is sometimes loosely referred to as pointing to some character, it in fact points between characters. If the charpos is zero, the previous character is the newline character separating the previous line from the mark’s line. If the charpos is equal to the number of characters in the line, the next character is the newline character separating the current line from the next. If the mark’s line has no previous line, a mark with charpos of zero has no previous character; if the mark’s line has no next line, a mark with charpos equal to the length of the line has no next character.

This section discusses the very basic operations involving marks, but a lot of Hemlock programming is built on altering some text at a mark. For more extended uses of marks see chapter doing-stuff.


Next: Regions, Previous: Lines, Up: Representation of Text   [Contents][Index]