aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/buffer.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 1ceec958a00..97c82a7468b 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1146,7 +1146,14 @@ window even if BUFFER is already visible in the selected window.")
1146 if (NILP (bufname)) 1146 if (NILP (bufname))
1147 buf = Fother_buffer (Fcurrent_buffer (), Qnil); 1147 buf = Fother_buffer (Fcurrent_buffer (), Qnil);
1148 else 1148 else
1149 buf = Fget_buffer_create (bufname); 1149 {
1150 buf = Fget_buffer (bufname);
1151 if (NILP (buf))
1152 {
1153 buf = Fget_buffer_create (bufname);
1154 Fset_buffer_major_mode (buf);
1155 }
1156 }
1150 Fset_buffer (buf); 1157 Fset_buffer (buf);
1151 record_buffer (buf); 1158 record_buffer (buf);
1152 Fselect_window (Fdisplay_buffer (buf, other)); 1159 Fselect_window (Fdisplay_buffer (buf, other));