# HG changeset patch # User Richard M. Stallman # Date 1162829315 0 # Node ID b84950e6ade6ab9a81fbf43c76be9483b35de024 # Parent ab47574757339e8b02c4e551d217ea0f7bfc17b9 (Managing Overlays): Document overlay-recenter. diff -r ab4757475733 -r b84950e6ade6 lispref/display.texi --- a/lispref/display.texi Mon Nov 06 16:06:11 2006 +0000 +++ b/lispref/display.texi Mon Nov 06 16:08:35 2006 +0000 @@ -1259,6 +1259,21 @@ @result{} t @end example + Emacs stores the overlays of each buffer in two lists, divided +around an arbitrary ``center position.'' One list extends backwards +through the buffer from that center position, and the other extends +forwards from that center position. The center position can be anywhere +in the buffer. + +@defun overlay-recenter pos +This function recenters the overlays of the current buffer around +position @var{pos}. That makes overlay lookup faster for positions +near @var{pos}, but slower for positions far away from @var{pos}. +@end defun + + A loop that scans the buffer forwards, creating overlays, can run +faster if you do @code{(overlay-recenter (point-max))} first. + @node Overlay Properties @subsection Overlay Properties