Next: , Previous: Buffer Protocol, Up: Protocols


18.4.2 Buffer Modification Protocol

The buffer maintains two marks, the low mark and the high mark:

— Generic Function: drei-buffer:low-mark buffer

Return the low mark of the buffer.

— Generic Function: drei-buffer:high-mark buffer

Return the high mark of the buffer.

The low mark is a left-sticky mark and high mark is a right-sticky mark. Whenever a modification is made to the buffer, the offset of the low mark is set to the minimum of its current value and the position of the modification. Similarly, whenever a modification is made to the buffer, the offset of the high mark is set to the maximum of its current value and the position of the modification.

The redisplay module may use these values to determine what part of the screen needs to be updated. These values can also be used to update information about syntax highlighting and other cached information.

In addition to these marks, the buffer maintains a modification flag that determines. Whether the buffer has been modified since the last call to clear-modify.

— Generic Function: drei-buffer:modified-p buffer

Return true if and only if the buffer has been modified.

— Generic Function: drei-buffer:clear-modify buffer

Set the high-mark to the beginning of the beginning of the buffer and the low-mark to the end of the buffer, and clear the modification flag. This means that modified-p will return NIL for this buffer until the next time it is modified.

This function is used by the redisplay module after all of the panes on display have been redisplayed properly. A call to this function concludes the interaction loop and Drei is again ready to read and execute commands.