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


47.7 Detached Extents

A detached extent is an extent that is not attached to a buffer or string but can be re-inserted. Detached extents have a start position and end position of nil. Extents can be explicitly detached using detach-extent.

An extent is also detached when all of its characters are all killed by a deletion, if its detachable property is set; if this property is not set, the extent becomes a zero-length extent. Zero-length extents with the detachable property set behave specially. See zero-length extents.

Function: detach-extent extent

This function detaches extent from its buffer or string. If extent has the duplicable property, its detachment is tracked by the undo mechanism. See Duplicable Extents.

Function: extent-detached-p extent

This function returns nil if extent is detached, and t otherwise.

Function: copy-extent extent &optional object

This function makes a copy of extent. It is initially detached. Optional argument object defaults to extent’s object (normally a buffer or string, but could be nil).

Function: insert-extent extent &optional start end no-hooks object

This function inserts extent from start to end in object (a buffer or string). If extent is detached from a different buffer or string, or in most cases when extent is already attached, the extent will first be copied as if with copy-extent. This function operates the same as if insert were called on a string whose extent data calls for extent to be inserted, except that if no-hooks is non-nil, extent’s paste-function will not be invoked. See Duplicable Extents.


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