aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2024-06-28 14:52:05 +0300
committerEli Zaretskii2024-06-28 14:52:05 +0300
commitdf0eb5be1eac7763236a99ffeb6e2b3561955bd9 (patch)
tree7330e91577cc22651834c8118ad957408e07313f
parent73c1252bb6b7cc61d9f992818568d3c57de4ff67 (diff)
downloademacs-df0eb5be1eac7763236a99ffeb6e2b3561955bd9.tar.gz
emacs-df0eb5be1eac7763236a99ffeb6e2b3561955bd9.zip
Improve documentation of 'remove-overlays' in ELisp manual
* doc/lispref/display.texi (Managing Overlays): Update documentation of 'remove-overlays'. (Bug#57534) (Bug#13648)
-rw-r--r--doc/lispref/display.texi50
1 files changed, 41 insertions, 9 deletions
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 34096196df4..55885b7438d 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -1659,15 +1659,47 @@ overlay.
1659@end defun 1659@end defun
1660 1660
1661@defun remove-overlays &optional start end name value 1661@defun remove-overlays &optional start end name value
1662This function removes all the overlays between @var{start} and 1662This function clears the text in the region between @var{start} and
1663@var{end} whose property @var{name} has the specified @var{value}. It 1663@var{end} of any overlays whose property named @var{name} has the
1664can move the endpoints of the overlays in the region, or split them. 1664specified @var{value}, such that no such overlay will affect the text in
1665 1665the region. To do this, the function can remove overlays in the region,
1666If @var{name} is omitted or @code{nil}, it means to delete all overlays in 1666or move their endpoints, or split them, or do some combination of these.
1667the specified region. If @var{start} and/or @var{end} are omitted or 1667Specifically:
1668@code{nil}, that means the beginning and end of the buffer respectively. 1668
1669Therefore, @code{(remove-overlays)} removes all the overlays in the 1669@itemize @bullet
1670current buffer. 1670@item
1671Overlays that start at or after @var{start} and end before @var{end}
1672will be removed completely.
1673
1674@item
1675Overlays that start before @var{start} and end after @var{start}, but
1676before @var{end}, will be altered so that they end at @var{start}.
1677
1678@item
1679Overlays that start at or after @var{start} and end after @var{end} will
1680be altered so that they start at @var{end}.
1681
1682@item
1683Overlays that start before @var{start} and end after @var{end} will be
1684split into two overlays: one that ends at @var{start} and the other that
1685begins at @var{end}.
1686@end itemize
1687
1688If @var{name} is omitted or @code{nil}, it means to delete/modify all
1689overlays that affect text in the specified region. If @var{start}
1690and/or @var{end} are omitted or @code{nil}, they default to the
1691beginning and end of the buffer, respectively. Therefore,
1692@code{(remove-overlays)} removes all the overlays in the current buffer.
1693
1694Values of the named overlay property are compared using @code{eq}, which
1695is important if the values are anything but symbols or fixnums
1696(@pxref{Equality Predicates}). It means the values passed to the
1697function must be the same values used to set the overlay property, not
1698their copies; objects which are different will not compare equal even if
1699they have identical contents.
1700
1701The optional arguments @var{name} and @var{value} should either both be
1702passed and non-@code{nil}, or both omitted or @code{nil}.
1671@end defun 1703@end defun
1672 1704
1673@defun copy-overlay overlay 1705@defun copy-overlay overlay