diff options
| author | Luc Teirlinck | 2004-04-11 15:44:38 +0000 |
|---|---|---|
| committer | Luc Teirlinck | 2004-04-11 15:44:38 +0000 |
| commit | 54dffe35a5d575f94d97b55bce830553480c6177 (patch) | |
| tree | 435716496e5399ce97e6972944df7643f52900b7 /src/buffer.c | |
| parent | 3c1dc2cb2bffde236aafc64ab708e6858be7b16f (diff) | |
| download | emacs-54dffe35a5d575f94d97b55bce830553480c6177.tar.gz emacs-54dffe35a5d575f94d97b55bce830553480c6177.zip | |
(Fgenerate_new_buffer_name): Return NAME argument if IGNORE argument
equals NAME. Doc fix.
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c index 455b03efec2..d62e186fda8 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -766,7 +766,7 @@ DEFUN ("generate-new-buffer-name", Fgenerate_new_buffer_name, Sgenerate_new_buff | |||
| 766 | doc: /* Return a string that is the name of no existing buffer based on NAME. | 766 | doc: /* Return a string that is the name of no existing buffer based on NAME. |
| 767 | If there is no live buffer named NAME, then return NAME. | 767 | If there is no live buffer named NAME, then return NAME. |
| 768 | Otherwise modify name by appending `<NUMBER>', incrementing NUMBER | 768 | Otherwise modify name by appending `<NUMBER>', incrementing NUMBER |
| 769 | until an unused name is found, and then return that name. | 769 | \(starting at 2) until an unused name is found, and then return that name. |
| 770 | Optional second argument IGNORE specifies a name that is okay to use | 770 | Optional second argument IGNORE specifies a name that is okay to use |
| 771 | \(if it is in the sequence to be tried) | 771 | \(if it is in the sequence to be tried) |
| 772 | even if a buffer with that name exists. */) | 772 | even if a buffer with that name exists. */) |
| @@ -779,6 +779,9 @@ even if a buffer with that name exists. */) | |||
| 779 | 779 | ||
| 780 | CHECK_STRING (name); | 780 | CHECK_STRING (name); |
| 781 | 781 | ||
| 782 | tem = Fstring_equal (name, ignore); | ||
| 783 | if (!NILP (tem)) | ||
| 784 | return name; | ||
| 782 | tem = Fget_buffer (name); | 785 | tem = Fget_buffer (name); |
| 783 | if (NILP (tem)) | 786 | if (NILP (tem)) |
| 784 | return name; | 787 | return name; |