summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-02-06 23:48:06 +0000
committerRichard M. Stallman <rms@gnu.org>1996-02-06 23:48:06 +0000
commit1457a30d0cde0617a36307be30211fb1bcb03773 (patch)
treef017b2fd42e72a88e87ee8b4efc2c2a10ca274fc
parentb02b7e272d74a9a024100feb2ae2807f306c6cc7 (diff)
downloademacs-1457a30d0cde0617a36307be30211fb1bcb03773.tar.gz
(Fbuffer_live_p): New function.
(syms_of_buffer): defsubr it.
-rw-r--r--src/buffer.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/buffer.c b/src/buffer.c
index ee55ed6bee3..c2e72e156f3 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -163,6 +163,16 @@ nsberror (spec)
error ("Invalid buffer argument");
}
+DEFUN ("buffer-live-p", Fbuffer_live_p, Sbuffer_live_p, 1, 1, 0,
+ "Return non-nil if OBJECT is a buffer which has not been killed.\n\
+Value is nil if OBJECT is not a buffer or if it has been killed.")
+ (object)
+ Lisp_Object object;
+{
+ return ((BUFFERP (object) && ! NILP (XBUFFER (object)->name))
+ ? Qt : Qnil);
+}
+
DEFUN ("buffer-list", Fbuffer_list, Sbuffer_list, 0, 0, 0,
"Return a list of all existing live buffers.")
()
@@ -3946,6 +3956,7 @@ is a member of the list.");
"List of functions called with no args to query before killing a buffer.");
Vkill_buffer_query_functions = Qnil;
+ defsubr (&Sbuffer_live_p);
defsubr (&Sbuffer_list);
defsubr (&Sget_buffer);
defsubr (&Sget_file_buffer);