emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/buffer.c


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/src/buffer.c
Date: Tue, 22 Jul 2003 15:02:11 -0400

Index: emacs/src/buffer.c
diff -c emacs/src/buffer.c:1.434 emacs/src/buffer.c:1.435
*** emacs/src/buffer.c:1.434    Tue Jul 15 15:32:05 2003
--- emacs/src/buffer.c  Tue Jul 22 15:02:11 2003
***************
*** 630,637 ****
    return buf;
  }
  
  /* Reinitialize everything about a buffer except its name and contents
!    and local variables.  */
  
  void
  reset_buffer (b)
--- 630,665 ----
    return buf;
  }
  
+ void
+ delete_all_overlays (b)
+      struct buffer *b;
+ {
+   Lisp_Object overlay;
+ 
+   /* `reset_buffer' blindly sets the list of overlays to NULL, so we
+      have to empty the list, otherwise we end up with overlays that
+      think they belong to this buffer while the buffer doesn't know about
+      them any more.  */
+   while (b->overlays_before)
+     {
+       XSETMISC (overlay, b->overlays_before);
+       Fdelete_overlay (overlay);
+     }
+   while (b->overlays_after)
+     {
+       XSETMISC (overlay, b->overlays_after);
+       Fdelete_overlay (overlay);
+     }
+   eassert (b->overlays_before == NULL);
+   eassert (b->overlays_after == NULL);
+ }
+ 
  /* Reinitialize everything about a buffer except its name and contents
!    and local variables. 
!    If called on an already-initialized buffer, the list of overlays
!    should be deleted before calling this function, otherwise we end up
!    with overlays that claim to belong to the buffer but the buffer
!    claims it doesn't belong to it.  */
  
  void
  reset_buffer (b)




reply via email to

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