Julian Bradfield writes:
Is it the case that insert-before-markers at the end of an end-open
extent will put the text inside the extent (and correspondingly that
insert-before-markers at the start of a start-closed extent will not)?
No. Neither extents nor their endpoints are markers, and markers are
not extents. Extent behavior with respect to swallowing text inserted
at an endpoint of the extent is entirely determined by the start-open
and end-open properties of the extent. Markers do not have such
properties, so the only way to get different behavior (ie, inserting
text at a marker pushes the marker toward the end of the file instead
of toward the beginning) is by changing the function call, which is
why `insert-before-markers' exists.
There are clearly applications where it makes sense for extent and
marker behavior to be distinct in this respect (eg, in font-locking
you don't want to have to fiddle with the openness or closedness of an
extent depending on the kind of insertion you're doing). Do you have
an application where you'd like it to work the other way around? Or
is it incompatible with That Other Emacs?
As for why this isn't documented, it is documented.<wink/> The
documentation of `insert-before-markers' doesn't mention extents, so
`insert-before-markers' should be assumed to have the same behavior as
`insert' with respect to extents. I suppose we could add an explicit
caveat to the docstring, though, as it's not necessarily intuitive
that extent and marker behavior are not linked to each other.
XEmacs-Beta mailing list