From e578f3813ff7f48663eb4821caee267e3ec47aa8 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Tue, 11 Sep 2012 08:22:03 +0400 Subject: Convenient macro to check whether the buffer is live. * buffer.h (BUFFER_LIVE_P): New macro. * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c: * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it. --- src/buffer.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/buffer.h') diff --git a/src/buffer.h b/src/buffer.h index da40a7ce3d8..d18ef30ea38 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -959,7 +959,10 @@ bset_width_table (struct buffer *b, Lisp_Object val) b->INTERNAL_FIELD (width_table) = val; } - +/* Convenient check whether buffer B is live. */ + +#define BUFFER_LIVE_P(b) (!NILP (BVAR (b, name))) + /* Chain of all buffers, including killed ones. */ extern struct buffer *all_buffers; -- cgit v1.2.1