HCoop
/
bpt
/
emacs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge from emacs-24; up to 2012-12-05T00:13:56Z!yamaoka@jpl.org
[bpt/emacs.git]
/
src
/
buffer.h
diff --git
a/src/buffer.h
b/src/buffer.h
index
fbbbf1b
..
a8769fd
100644
(file)
--- a/
src/buffer.h
+++ b/
src/buffer.h
@@
-193,6
+193,9
@@
INLINE_HEADER_BEGIN
/* FIXME: should we move this into ->text->auto_save_modiff? */
#define BUF_AUTOSAVE_MODIFF(buf) ((buf)->auto_save_modified)
/* FIXME: should we move this into ->text->auto_save_modiff? */
#define BUF_AUTOSAVE_MODIFF(buf) ((buf)->auto_save_modified)
+/* Compaction count. */
+#define BUF_COMPACT(buf) ((buf)->text->compact)
+
/* Marker chain of buffer. */
#define BUF_MARKERS(buf) ((buf)->text->markers)
/* Marker chain of buffer. */
#define BUF_MARKERS(buf) ((buf)->text->markers)
@@
-770,11
+773,15
@@
struct buffer
In an ordinary buffer, it is 0. */
struct buffer *base_buffer;
In an ordinary buffer, it is 0. */
struct buffer *base_buffer;
- /* In an indirect buffer, this is -1. In an ordinary buffer,
+ /* In an indirect buffer, this is -1.
In an ordinary buffer,
it's the number of indirect buffers that share our text;
zero means that we're the only owner of this text. */
int indirections;
it's the number of indirect buffers that share our text;
zero means that we're the only owner of this text. */
int indirections;
+ /* Number of windows showing this buffer. Always -1 for
+ an indirect buffer since it counts as its base buffer. */
+ int window_count;
+
/* A non-zero value in slot IDX means that per-buffer variable
with index IDX has a local value in this buffer. The index IDX
for a buffer-local variable is stored in that variable's slot
/* A non-zero value in slot IDX means that per-buffer variable
with index IDX has a local value in this buffer. The index IDX
for a buffer-local variable is stored in that variable's slot
@@
-982,6
+989,11
@@
bset_width_table (struct buffer *b, Lisp_Object val)
#define BUFFER_LIVE_P(b) (!NILP (BVAR (b, name)))
#define BUFFER_LIVE_P(b) (!NILP (BVAR (b, name)))
+/* Convenient check whether buffer B is hidden (i.e. its name
+ starts with a space). Caller must ensure that B is live. */
+
+#define BUFFER_HIDDEN_P(b) (SREF (BVAR (b, name), 0) == ' ')
+
/* Verify indirection counters. */
#define BUFFER_CHECK_INDIRECTION(b) \
/* Verify indirection counters. */
#define BUFFER_CHECK_INDIRECTION(b) \
@@
-1168,7
+1180,18
@@
BUF_FETCH_MULTIBYTE_CHAR (struct buffer *buf, ptrdiff_t pos)
+ pos + BUF_BEG_ADDR (buf) - BEG_BYTE);
return STRING_CHAR (p);
}
+ pos + BUF_BEG_ADDR (buf) - BEG_BYTE);
return STRING_CHAR (p);
}
-
\f
+
+/* Return number of windows showing B. */
+
+BUFFER_INLINE int
+buffer_window_count (struct buffer *b)
+{
+ if (b->base_buffer)
+ b = b->base_buffer;
+ eassert (b->window_count >= 0);
+ return b->window_count;
+}
+
/* Overlays */
/* Return the marker that stands for where OV starts in the buffer. */
/* Overlays */
/* Return the marker that stands for where OV starts in the buffer. */