Mercurial > emacs
comparison src/minibuf.c @ 52005:3e9cb0aeebe1
(get_minibuffer): Be careful when calling `reset_buffer'
which assumes the buffer is uninitialized.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Tue, 22 Jul 2003 16:12:45 +0000 |
parents | bd0acf8d5f97 |
children | 292d2d0762b8 |
comparison
equal
deleted
inserted
replaced
52004:34d5a525041e | 52005:3e9cb0aeebe1 |
---|---|
775 XSETCAR (tail, buf); | 775 XSETCAR (tail, buf); |
776 } | 776 } |
777 else | 777 else |
778 { | 778 { |
779 int count = SPECPDL_INDEX (); | 779 int count = SPECPDL_INDEX (); |
780 | 780 Lisp_Object overlay; |
781 reset_buffer (XBUFFER (buf)); | 781 struct buffer *b = XBUFFER (buf); |
782 | |
783 /* `reset_buffer' blindly sets the list of overlays to NULL, so we | |
784 have to empty the list, otherwise we end up with overlays that | |
785 think they belong to this buffer while the buffer doesn't know about | |
786 them any more. */ | |
787 while (b->overlays_before) | |
788 { | |
789 XSETMISC (overlay, b->overlays_before); | |
790 Fdelete_overlay (overlay); | |
791 } | |
792 while (b->overlays_after) | |
793 { | |
794 XSETMISC (overlay, b->overlays_after); | |
795 Fdelete_overlay (overlay); | |
796 } | |
797 eassert (b->overlays_before == NULL); | |
798 eassert (b->overlays_after == NULL); | |
799 | |
800 reset_buffer (b); | |
782 record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); | 801 record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); |
783 Fset_buffer (buf); | 802 Fset_buffer (buf); |
784 Fkill_all_local_variables (); | 803 Fkill_all_local_variables (); |
785 unbind_to (count, Qnil); | 804 unbind_to (count, Qnil); |
786 } | 805 } |