From d0628b063d09fcaa984c549e4d4ae58500230c8c Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 21 Jan 1998 21:42:19 +0000 Subject: [PATCH] (set_buffer_if_live): New function. --- src/buffer.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/buffer.c b/src/buffer.c index 1950ff365ac..1a68374d7ad 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1571,6 +1571,17 @@ Use `switch-to-buffer' or `pop-to-buffer' to switch buffers permanently.") 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, -- 2.39.2