diff options
| author | Dmitry Antipov | 2012-07-25 09:09:02 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2012-07-25 09:09:02 +0400 |
| commit | 04e9897cf70e46c703b1412d022511e80314a720 (patch) | |
| tree | af271600844268b6c0a385be82a91fab081e59d9 /src | |
| parent | 9830626b31fe96bd19bdb61e3dfd09f25a806560 (diff) | |
| download | emacs-04e9897cf70e46c703b1412d022511e80314a720.tar.gz emacs-04e9897cf70e46c703b1412d022511e80314a720.zip | |
Adjust buffer text indirection counters at the end of Fkill_buffer.
* buffer.c (Fkill_buffer): Adjust indirection counters when the
buffer is definitely dead. This should really fix an issue reported
by Christoph Scholtes again. (Bug#12007).
(init_buffer_once): Initialize indirection counters of
buffer_defaults and buffer_local_symbols (for sanity and safety).
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 11 | ||||
| -rw-r--r-- | src/buffer.c | 21 |
2 files changed, 22 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index a7ed81da2d2..2c82af88f93 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | Adjust buffer text indirection counters at the end of Fkill_buffer. | ||
| 4 | * buffer.c (Fkill_buffer): Adjust indirection counters when the | ||
| 5 | buffer is definitely dead. This should really fix an issue reported | ||
| 6 | by Christoph Scholtes again. (Bug#12007). | ||
| 7 | (init_buffer_once): Initialize indirection counters of | ||
| 8 | buffer_defaults and buffer_local_symbols (for sanity and safety). | ||
| 9 | |||
| 1 | 2012-07-24 Eli Zaretskii <eliz@gnu.org> | 10 | 2012-07-24 Eli Zaretskii <eliz@gnu.org> |
| 2 | 11 | ||
| 3 | * xdisp.c (init_iterator): Don't compute dimensions of truncation | 12 | * xdisp.c (init_iterator): Don't compute dimensions of truncation |
| @@ -7,7 +16,7 @@ | |||
| 7 | 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru> | 16 | 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru> |
| 8 | 17 | ||
| 9 | Simplify copy_overlay. | 18 | Simplify copy_overlay. |
| 10 | * buffer.c (copy_overlay): Simplify, use build_marker. | 19 | * buffer.c (copy_overlay): Simplify. Use build_marker. |
| 11 | * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks. | 20 | * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks. |
| 12 | 21 | ||
| 13 | 2012-07-23 Eli Zaretskii <eliz@gnu.org> | 22 | 2012-07-23 Eli Zaretskii <eliz@gnu.org> |
diff --git a/src/buffer.c b/src/buffer.c index c017db7b034..06d385110c6 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -1560,14 +1560,6 @@ cleaning up all windows currently displaying the buffer to be killed. */) | |||
| 1560 | if (EQ (buffer, XWINDOW (minibuf_window)->buffer)) | 1560 | if (EQ (buffer, XWINDOW (minibuf_window)->buffer)) |
| 1561 | return Qnil; | 1561 | return Qnil; |
| 1562 | 1562 | ||
| 1563 | /* Notify our base buffer that we don't share the text anymore. */ | ||
| 1564 | if (b->base_buffer) | ||
| 1565 | { | ||
| 1566 | eassert (b->indirections == -1); | ||
| 1567 | b->base_buffer->indirections--; | ||
| 1568 | eassert (b->base_buffer->indirections >= 0); | ||
| 1569 | } | ||
| 1570 | |||
| 1571 | /* When we kill an ordinary buffer which shares it's buffer text | 1563 | /* When we kill an ordinary buffer which shares it's buffer text |
| 1572 | with indirect buffer(s), we must kill indirect buffer(s) too. | 1564 | with indirect buffer(s), we must kill indirect buffer(s) too. |
| 1573 | We do it at this stage so nothing terrible happens if they | 1565 | We do it at this stage so nothing terrible happens if they |
| @@ -1708,7 +1700,15 @@ cleaning up all windows currently displaying the buffer to be killed. */) | |||
| 1708 | BVAR (b, name) = Qnil; | 1700 | BVAR (b, name) = Qnil; |
| 1709 | 1701 | ||
| 1710 | BLOCK_INPUT; | 1702 | BLOCK_INPUT; |
| 1711 | if (! b->base_buffer) | 1703 | if (b->base_buffer) |
| 1704 | { | ||
| 1705 | /* Notify our base buffer that we don't share the text anymore. */ | ||
| 1706 | eassert (b->indirections == -1); | ||
| 1707 | b->base_buffer->indirections--; | ||
| 1708 | eassert (b->base_buffer->indirections >= 0); | ||
| 1709 | } | ||
| 1710 | else | ||
| 1711 | /* No one shares our buffer text, can free it. */ | ||
| 1712 | free_buffer_text (b); | 1712 | free_buffer_text (b); |
| 1713 | 1713 | ||
| 1714 | if (b->newline_cache) | 1714 | if (b->newline_cache) |
| @@ -4897,6 +4897,9 @@ init_buffer_once (void) | |||
| 4897 | /* Prevent GC from getting confused. */ | 4897 | /* Prevent GC from getting confused. */ |
| 4898 | buffer_defaults.text = &buffer_defaults.own_text; | 4898 | buffer_defaults.text = &buffer_defaults.own_text; |
| 4899 | buffer_local_symbols.text = &buffer_local_symbols.own_text; | 4899 | buffer_local_symbols.text = &buffer_local_symbols.own_text; |
| 4900 | /* No one will share the text with these buffers, but let's play it safe. */ | ||
| 4901 | buffer_defaults.indirections = 0; | ||
| 4902 | buffer_local_symbols.indirections = 0; | ||
| 4900 | BUF_INTERVALS (&buffer_defaults) = 0; | 4903 | BUF_INTERVALS (&buffer_defaults) = 0; |
| 4901 | BUF_INTERVALS (&buffer_local_symbols) = 0; | 4904 | BUF_INTERVALS (&buffer_local_symbols) = 0; |
| 4902 | XSETPVECTYPESIZE (&buffer_defaults, PVEC_BUFFER, pvecsize); | 4905 | XSETPVECTYPESIZE (&buffer_defaults, PVEC_BUFFER, pvecsize); |