aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2003-07-22 19:02:11 +0000
committerStefan Monnier2003-07-22 19:02:11 +0000
commitd4f5719ace3b4287687812c808a0806a769fcf76 (patch)
tree82ad23a44b7f2169691eca9026c82392b120cd0b /src
parent1dd7ccf2804ea436ffca8d92b9617b21d623e7f5 (diff)
downloademacs-d4f5719ace3b4287687812c808a0806a769fcf76.tar.gz
emacs-d4f5719ace3b4287687812c808a0806a769fcf76.zip
(delete_all_overlays): New function.
Diffstat (limited to 'src')
-rw-r--r--src/buffer.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c
index cbbe4153106..40ee3f071de 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -630,8 +630,36 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
630 return buf; 630 return buf;
631} 631}
632 632
633void
634delete_all_overlays (b)
635 struct buffer *b;
636{
637 Lisp_Object overlay;
638
639 /* `reset_buffer' blindly sets the list of overlays to NULL, so we
640 have to empty the list, otherwise we end up with overlays that
641 think they belong to this buffer while the buffer doesn't know about
642 them any more. */
643 while (b->overlays_before)
644 {
645 XSETMISC (overlay, b->overlays_before);
646 Fdelete_overlay (overlay);
647 }
648 while (b->overlays_after)
649 {
650 XSETMISC (overlay, b->overlays_after);
651 Fdelete_overlay (overlay);
652 }
653 eassert (b->overlays_before == NULL);
654 eassert (b->overlays_after == NULL);
655}
656
633/* Reinitialize everything about a buffer except its name and contents 657/* Reinitialize everything about a buffer except its name and contents
634 and local variables. */ 658 and local variables.
659 If called on an already-initialized buffer, the list of overlays
660 should be deleted before calling this function, otherwise we end up
661 with overlays that claim to belong to the buffer but the buffer
662 claims it doesn't belong to it. */
635 663
636void 664void
637reset_buffer (b) 665reset_buffer (b)