aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/buffer.h b/src/buffer.h
index 1129840bd47..d838d3767ef 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -770,11 +770,15 @@ struct buffer
770 In an ordinary buffer, it is 0. */ 770 In an ordinary buffer, it is 0. */
771 struct buffer *base_buffer; 771 struct buffer *base_buffer;
772 772
773 /* In an indirect buffer, this is -1. In an ordinary buffer, 773 /* In an indirect buffer, this is -1. In an ordinary buffer,
774 it's the number of indirect buffers that share our text; 774 it's the number of indirect buffers that share our text;
775 zero means that we're the only owner of this text. */ 775 zero means that we're the only owner of this text. */
776 int indirections; 776 int indirections;
777 777
778 /* Number of windows showing this buffer. Always -1 for
779 an indirect buffer since it counts as its base buffer. */
780 int window_count;
781
778 /* A non-zero value in slot IDX means that per-buffer variable 782 /* A non-zero value in slot IDX means that per-buffer variable
779 with index IDX has a local value in this buffer. The index IDX 783 with index IDX has a local value in this buffer. The index IDX
780 for a buffer-local variable is stored in that variable's slot 784 for a buffer-local variable is stored in that variable's slot
@@ -1173,7 +1177,18 @@ BUF_FETCH_MULTIBYTE_CHAR (struct buffer *buf, ptrdiff_t pos)
1173 + pos + BUF_BEG_ADDR (buf) - BEG_BYTE); 1177 + pos + BUF_BEG_ADDR (buf) - BEG_BYTE);
1174 return STRING_CHAR (p); 1178 return STRING_CHAR (p);
1175} 1179}
1176 1180
1181/* Return number of windows showing B. */
1182
1183BUFFER_INLINE int
1184buffer_window_count (struct buffer *b)
1185{
1186 if (b->base_buffer)
1187 b = b->base_buffer;
1188 eassert (b->window_count >= 0);
1189 return b->window_count;
1190}
1191
1177/* Overlays */ 1192/* Overlays */
1178 1193
1179/* Return the marker that stands for where OV starts in the buffer. */ 1194/* Return the marker that stands for where OV starts in the buffer. */