diff options
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/buffer.c b/src/buffer.c index dd7334ea52a..6f186c0e7d6 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -568,44 +568,44 @@ If UNIQUE is non-nil, come up with a new name using\n\ | |||
| 568 | Interactively, you can set UNIQUE with a prefix argument.\n\ | 568 | Interactively, you can set UNIQUE with a prefix argument.\n\ |
| 569 | We return the name we actually gave the buffer.\n\ | 569 | We return the name we actually gave the buffer.\n\ |
| 570 | This does not change the name of the visited file (if any).") | 570 | This does not change the name of the visited file (if any).") |
| 571 | (name, unique) | 571 | (newname, unique) |
| 572 | register Lisp_Object name, unique; | 572 | register Lisp_Object newname, unique; |
| 573 | { | 573 | { |
| 574 | register Lisp_Object tem, buf; | 574 | register Lisp_Object tem, buf; |
| 575 | 575 | ||
| 576 | CHECK_STRING (name, 0); | 576 | CHECK_STRING (newname, 0); |
| 577 | 577 | ||
| 578 | if (XSTRING (name)->size == 0) | 578 | if (XSTRING (newname)->size == 0) |
| 579 | error ("Empty string is invalid as a buffer name"); | 579 | error ("Empty string is invalid as a buffer name"); |
| 580 | 580 | ||
| 581 | tem = Fget_buffer (name); | 581 | tem = Fget_buffer (newname); |
| 582 | /* Don't short-circuit if UNIQUE is t. That is a useful way to rename | 582 | /* Don't short-circuit if UNIQUE is t. That is a useful way to rename |
| 583 | the buffer automatically so you can create another with the original name. | 583 | the buffer automatically so you can create another with the original name. |
| 584 | It makes UNIQUE equivalent to | 584 | It makes UNIQUE equivalent to |
| 585 | (rename-buffer (generate-new-buffer-name NAME)). */ | 585 | (rename-buffer (generate-new-buffer-name NEWNAME)). */ |
| 586 | if (NILP (unique) && XBUFFER (tem) == current_buffer) | 586 | if (NILP (unique) && XBUFFER (tem) == current_buffer) |
| 587 | return current_buffer->name; | 587 | return current_buffer->newname; |
| 588 | if (!NILP (tem)) | 588 | if (!NILP (tem)) |
| 589 | { | 589 | { |
| 590 | if (!NILP (unique)) | 590 | if (!NILP (unique)) |
| 591 | name = Fgenerate_new_buffer_name (name, current_buffer->name); | 591 | newname = Fgenerate_new_buffer_name (newname, current_buffer->name); |
| 592 | else | 592 | else |
| 593 | error ("Buffer name \"%s\" is in use", XSTRING (name)->data); | 593 | error ("Buffer name `%s' is in use", XSTRING (newname)->data); |
| 594 | } | 594 | } |
| 595 | 595 | ||
| 596 | current_buffer->name = name; | 596 | current_buffer->name = newname; |
| 597 | 597 | ||
| 598 | /* Catch redisplay's attention. Unless we do this, the mode lines for | 598 | /* Catch redisplay's attention. Unless we do this, the mode lines for |
| 599 | any windows displaying current_buffer will stay unchanged. */ | 599 | any windows displaying current_buffer will stay unchanged. */ |
| 600 | update_mode_lines++; | 600 | update_mode_lines++; |
| 601 | 601 | ||
| 602 | XSETBUFFER (buf, current_buffer); | 602 | XSETBUFFER (buf, current_buffer); |
| 603 | Fsetcar (Frassq (buf, Vbuffer_alist), name); | 603 | Fsetcar (Frassq (buf, Vbuffer_alist), newname); |
| 604 | if (NILP (current_buffer->filename) | 604 | if (NILP (current_buffer->filename) |
| 605 | && !NILP (current_buffer->auto_save_file_name)) | 605 | && !NILP (current_buffer->auto_save_file_name)) |
| 606 | call0 (intern ("rename-auto-save-file")); | 606 | call0 (intern ("rename-auto-save-file")); |
| 607 | /* refetch since that last call may have done GC */ | 607 | /* refetch since that last call may have done GC */ |
| 608 | return current_buffer->name; | 608 | return current_buffer->newname; |
| 609 | } | 609 | } |
| 610 | 610 | ||
| 611 | DEFUN ("other-buffer", Fother_buffer, Sother_buffer, 0, 2, 0, | 611 | DEFUN ("other-buffer", Fother_buffer, Sother_buffer, 0, 2, 0, |