aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c
index d0e1f9a3347..6b03e6d3e0c 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -560,7 +560,11 @@ This does not change the name of the visited file (if any).")
560 560
561 CHECK_STRING (name, 0); 561 CHECK_STRING (name, 0);
562 tem = Fget_buffer (name); 562 tem = Fget_buffer (name);
563 if (XBUFFER (tem) == current_buffer) 563 /* Don't short-circuit if UNIQUE is t. That is a useful way to rename
564 the buffer automatically so you can create another with the original name.
565 It makes UNIQUE equivalent to
566 (rename-buffer (generate-new-buffer-name NAME)). */
567 if (NILP (unique) && XBUFFER (tem) == current_buffer)
564 return current_buffer->name; 568 return current_buffer->name;
565 if (!NILP (tem)) 569 if (!NILP (tem))
566 { 570 {