diff options
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/src/buffer.c b/src/buffer.c index 861a89b5a0f..0b3dde27968 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -1663,18 +1663,11 @@ No argument or nil as argument means do this for the current buffer. */) | |||
| 1663 | void | 1663 | void |
| 1664 | compact_buffer (struct buffer *buffer) | 1664 | compact_buffer (struct buffer *buffer) |
| 1665 | { | 1665 | { |
| 1666 | /* Verify indirection counters. */ | 1666 | BUFFER_CHECK_INDIRECTION (buffer); |
| 1667 | if (buffer->base_buffer) | ||
| 1668 | { | ||
| 1669 | eassert (buffer->indirections == -1); | ||
| 1670 | eassert (buffer->base_buffer->indirections > 0); | ||
| 1671 | } | ||
| 1672 | else | ||
| 1673 | eassert (buffer->indirections >= 0); | ||
| 1674 | 1667 | ||
| 1675 | /* Skip dead buffers, indirect buffers and buffers | 1668 | /* Skip dead buffers, indirect buffers and buffers |
| 1676 | which aren't changed since last compaction. */ | 1669 | which aren't changed since last compaction. */ |
| 1677 | if (!NILP (buffer->INTERNAL_FIELD (name)) | 1670 | if (BUFFER_LIVE_P (buffer) |
| 1678 | && (buffer->base_buffer == NULL) | 1671 | && (buffer->base_buffer == NULL) |
| 1679 | && (buffer->text->compact != buffer->text->modiff)) | 1672 | && (buffer->text->compact != buffer->text->modiff)) |
| 1680 | { | 1673 | { |
| @@ -1888,19 +1881,20 @@ cleaning up all windows currently displaying the buffer to be killed. */) | |||
| 1888 | 1881 | ||
| 1889 | if (b->base_buffer) | 1882 | if (b->base_buffer) |
| 1890 | { | 1883 | { |
| 1891 | { /* Unchain all markers that belong to this indirect buffer. | 1884 | /* Unchain all markers that belong to this indirect buffer. |
| 1892 | Don't unchain the markers that belong to the base buffer | 1885 | Don't unchain the markers that belong to the base buffer |
| 1893 | or its other indirect buffers. */ | 1886 | or its other indirect buffers. */ |
| 1894 | struct Lisp_Marker **mp; | 1887 | struct Lisp_Marker **mp = &BUF_MARKERS (b); |
| 1895 | for (mp = &BUF_MARKERS (b); *mp; ) | 1888 | while ((m = *mp)) |
| 1896 | { | 1889 | { |
| 1897 | struct Lisp_Marker *m = *mp; | 1890 | if (m->buffer == b) |
| 1898 | if (m->buffer == b) | 1891 | { |
| 1892 | m->buffer = NULL; | ||
| 1899 | *mp = m->next; | 1893 | *mp = m->next; |
| 1900 | else | 1894 | } |
| 1901 | mp = &m->next; | 1895 | else |
| 1902 | } | 1896 | mp = &m->next; |
| 1903 | } | 1897 | } |
| 1904 | } | 1898 | } |
| 1905 | else | 1899 | else |
| 1906 | { | 1900 | { |
| @@ -2114,6 +2108,8 @@ set_buffer_internal_1 (register struct buffer *b) | |||
| 2114 | if (current_buffer == b) | 2108 | if (current_buffer == b) |
| 2115 | return; | 2109 | return; |
| 2116 | 2110 | ||
| 2111 | BUFFER_CHECK_INDIRECTION (b); | ||
| 2112 | |||
| 2117 | old_buf = current_buffer; | 2113 | old_buf = current_buffer; |
| 2118 | current_buffer = b; | 2114 | current_buffer = b; |
| 2119 | last_known_column_point = -1; /* invalidate indentation cache */ | 2115 | last_known_column_point = -1; /* invalidate indentation cache */ |