Next: , Previous: , Up: Extents   [Contents][Index]


47.2 Creating and Modifying Extents

Function: make-extent from to &optional buffer-or-string

This function makes an extent for the range [from, to) in buffer-or-string (a buffer or string). buffer-or-string defaults to the current buffer. Insertions at point to will be outside of the extent; insertions at from will be inside the extent, causing the extent to grow (see Extent Endpoints). This is the same way that markers behave. The extent is initially detached if both from and to are nil, and in this case buffer-or-string defaults to nil, meaning the extent is in no buffer or string (see Detached Extents).

Function: delete-extent extent

This function removes extent from its buffer and destroys it. This does not modify the buffer’s text, only its display properties. The extent cannot be used thereafter. To remove an extent in such a way that it can be re-inserted later, use detach-extent. See Detached Extents.

Function: extent-object extent

This function returns the buffer or string that extent is in. If the return value is nil, this means that the extent is detached; however, a detached extent will not necessarily return a value of nil.

Function: extent-live-p object

This function returns t if object is an extent that has not been deleted, and nil otherwise.