From dc9cc5743b880fedfba00a681306e33589a7d893 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 9 Dec 2008 23:08:05 +0000 Subject: [PATCH] (Fbuffer_swap_text): Signal error if swapping a dead buffer. --- src/buffer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/buffer.c b/src/buffer.c index 8041e3abce5..50db471ae12 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -2192,6 +2192,9 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text, CHECK_BUFFER (buffer); other_buffer = XBUFFER (buffer); + if (NILP (other_buffer->name)) + error ("Cannot swap a dead buffer's text"); + /* Actually, it probably works just fine. * if (other_buffer == current_buffer) * error ("Cannot swap a buffer's text with itself"); */ -- 2.39.2