An extent is logically a Lisp object consisting of a start position, an end position, a buffer or string to which these positions refer, and a property list. As text is inserted into a buffer, the start and end positions of the extent are automatically adjusted as necessary to keep the extent referring to the same text in the buffer. Each extent has a face or list of faces associated with it, which controls the way in which the text bounded by the extent is displayed. If an extent's face is nil or its properties are partially undefined, the corresponding properties from the default face for the frame is used. If two or more extents overlap, or if a list of more than one face is specified for a particular extent, the corresponding faces are merged to determine the text's displayed properties.
Every extent has a priority that determines which face takes precedence if the faces conflict.
Higher-numbered priority values correspond to a higher priority, and priority values can be negative. Within a single extent with a list of faces, faces earlier in the list have a higher priority than faces later in the list. Extents can be set to respond specially to key and mouse events within the extent. An extent's keymap property controls the effect of key and mouse strokes within the extent's text, and the mouse-face property controls whether the extent is highlighted when the mouse moves over it. See section Interaction of Extents with Keyboard and Mouse Events .