I’ll want my text editor to be able to internally “mark” words and phrases and characters within the text. Here I discuss the basics of a system for doing this. I’ll need this system to implement such features as syntax highlighting, background spellchecking, bookmarks, and highlighting the results of previous searches.