diff options
| author | Stefan Monnier | 2003-07-22 16:12:45 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2003-07-22 16:12:45 +0000 |
| commit | 7f856567ea6a2c31034e9266d067522b0d857dc0 (patch) | |
| tree | 2bddbff5960b33bbc5dddf57c99edd00c823d661 /src | |
| parent | c73983bbfaf8b34b845c2d803f85daced9fd683d (diff) | |
| download | emacs-7f856567ea6a2c31034e9266d067522b0d857dc0.tar.gz emacs-7f856567ea6a2c31034e9266d067522b0d857dc0.zip | |
(get_minibuffer): Be careful when calling `reset_buffer'
which assumes the buffer is uninitialized.
Diffstat (limited to 'src')
| -rw-r--r-- | src/minibuf.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/minibuf.c b/src/minibuf.c index d2331ba5d4e..89830b0391a 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -777,8 +777,27 @@ get_minibuffer (depth) | |||
| 777 | else | 777 | else |
| 778 | { | 778 | { |
| 779 | int count = SPECPDL_INDEX (); | 779 | int count = SPECPDL_INDEX (); |
| 780 | Lisp_Object overlay; | ||
| 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); | ||
| 780 | 799 | ||
| 781 | reset_buffer (XBUFFER (buf)); | 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 (); |