bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: elisp's display.texi: What happens to overlays when text is inserted


From: David Kastrup
Subject: Re: elisp's display.texi: What happens to overlays when text is inserted/deleted?
Date: 19 Jan 2004 00:10:20 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Alan Mackenzie <acm@muc.de> writes:

> Elisp manual's display.texi.  Section "Overlays".
> 
> In Emacs, when text is inserted into/deleted from a buffer in which an
> overlay exists, the overlay's beginning and end are updated much like
> markers are.
> 
> The Elisp manual (display.texi) doesn't say this explicitly - I think it
> should.
> 
> Attached is a patch to display.texi which adds this info, and a ChangeLog
> entry.

Please don't put patches in your signature: that makes it difficult
to answer to them as they are not quoted by the mail reader.

+ If text is inserted into or deleted from the buffer before the range
+ covered by an overlay, the beginning and end of the overlay are
+ automatically adjusted so that it continues to cover the same range of
+ text.  Similarly, if text is inserted into or deleted from the inside of
+ the range covered by an overlay, the overlay gets expanded or shrunk
+ accordingly by adjusting its end position.

This is misleading at best.  If text is inserted into the buffer
immediately before the overlay, dependending on the insertion
property of the overlay start, this text becomes part of the
overlay.  The second sentence is similarly misleading, since it does
not cover whether text inserted at the end of the overlay is
considered "inside" or not: again this depends on the insert property
of the overlay end marker.

The correct explanation is that that overlay beginning and end work
like markers with the appropriate marker-insertion-type as specified
to make-overlay.  If any explanation is added beyond that, it should
not be fuzzy, incomplete or incorrect.  That is not an advantage.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

[Prev in Thread] Current Thread [Next in Thread]