implement "window marks" which also contain a flag whether or not the area has changed. note that the buffer is a buffer of bytes. If a character is longer than a byte, it could maybe happen that a byte pointer (e.g. the caret) points into the middle of it. In that case, it would get the character (and all subsequent characters?) wrong.