comparison src/buffer.c @ 1876:0ddafa88e654

(Frename_buffer): Make prefix arg set UNIQUE.
author Richard M. Stallman <rms@gnu.org>
date Sun, 14 Feb 1993 23:08:25 +0000
parents 04fb1d3d6992
children ea6c75bc0d38
comparison
equal deleted inserted replaced
1875:f569bc4e9b8f 1876:0ddafa88e654
508 508
509 return make_number (BUF_MODIFF (buf)); 509 return make_number (BUF_MODIFF (buf));
510 } 510 }
511 511
512 DEFUN ("rename-buffer", Frename_buffer, Srename_buffer, 1, 2, 512 DEFUN ("rename-buffer", Frename_buffer, Srename_buffer, 1, 2,
513 "sRename buffer (to new name): ", 513 "sRename buffer (to new name): \nP",
514 "Change current buffer's name to NEWNAME (a string).\n\ 514 "Change current buffer's name to NEWNAME (a string).\n\
515 If second arg DISTINGUISH is nil or omitted, it is an error if a\n\ 515 If second arg UNIQUE is nil or omitted, it is an error if a\n\
516 buffer named NEWNAME already exists.\n\ 516 buffer named NEWNAME already exists.\n\
517 If DISTINGUISH is non-nil, come up with a new name using\n\ 517 If UNIQUE is non-nil, come up with a new name using\n\
518 `generate-new-buffer-name'.\n\ 518 `generate-new-buffer-name'.\n\
519 Return the name we actually gave the buffer.\n\ 519 Interactively, you can set UNIQUE with a prefix argument.\n\
520 We return the name we actually gave the buffer.\n\
520 This does not change the name of the visited file (if any).") 521 This does not change the name of the visited file (if any).")
521 (name, distinguish) 522 (name, unique)
522 register Lisp_Object name, distinguish; 523 register Lisp_Object name, unique;
523 { 524 {
524 register Lisp_Object tem, buf; 525 register Lisp_Object tem, buf;
525 526
526 CHECK_STRING (name, 0); 527 CHECK_STRING (name, 0);
527 tem = Fget_buffer (name); 528 tem = Fget_buffer (name);
528 if (XBUFFER (tem) == current_buffer) 529 if (XBUFFER (tem) == current_buffer)
529 return current_buffer->name; 530 return current_buffer->name;
530 if (!NILP (tem)) 531 if (!NILP (tem))
531 { 532 {
532 if (!NILP (distinguish)) 533 if (!NILP (unique))
533 name = Fgenerate_new_buffer_name (name); 534 name = Fgenerate_new_buffer_name (name);
534 else 535 else
535 error ("Buffer name \"%s\" is in use", XSTRING (name)->data); 536 error ("Buffer name \"%s\" is in use", XSTRING (name)->data);
536 } 537 }
537 538