changeset 20698:ec08780e4c42

(set_buffer_if_live): New function.
author Richard M. Stallman <rms@gnu.org>
date Wed, 21 Jan 1998 21:42:19 +0000
parents 6c8ba5a6147b
children 907d8633c8cc
files src/buffer.c
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/buffer.c	Wed Jan 21 21:41:27 1998 +0000
+++ b/src/buffer.c	Wed Jan 21 21:42:19 1998 +0000
@@ -1571,6 +1571,17 @@
   set_buffer_internal (XBUFFER (buf));
   return buf;
 }
+
+/* Set the current buffer to BUFFER provided it is alive.  */
+
+Lisp_Object
+set_buffer_if_live (buffer)
+     Lisp_Object buffer;
+{
+  if (! NILP (XBUFFER (buffer)->name))
+    Fset_buffer (buffer);
+  return Qnil;
+}
 
 DEFUN ("barf-if-buffer-read-only", Fbarf_if_buffer_read_only,
 				   Sbarf_if_buffer_read_only, 0, 0, 0,