summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/buffer.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 871a152484e..2fb9fefd5e9 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -961,8 +961,12 @@ If BUFFER is omitted or nil, some interesting buffer is returned.")
}
if (!NILP (notsogood))
return notsogood;
- buf = Fget_buffer_create (build_string ("*scratch*"));
- Fset_buffer_major_mode (buf);
+ buf = Fget_buffer (build_string ("*scratch*"));
+ if (NILP (buf))
+ {
+ buf = Fget_buffer_create (build_string ("*scratch*"));
+ Fset_buffer_major_mode (buf);
+ }
return buf;
}