diff options
| author | Karoly Lorentey | 2004-04-13 17:17:13 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2004-04-13 17:17:13 +0000 |
| commit | 6917311031ecaa452d591f99d3bba4e3ce1ec050 (patch) | |
| tree | e057ac34cab81d493581606485ccbdf3a9442ef4 /src/buffer.c | |
| parent | 67ad74dfc55fafe210e8bf1dcae80d269d38ea4b (diff) | |
| parent | a2de0c3b755f982b426e915e3d1064a10f6206bb (diff) | |
| download | emacs-6917311031ecaa452d591f99d3bba4e3ce1ec050.tar.gz emacs-6917311031ecaa452d591f99d3bba4e3ce1ec050.zip | |
Merged in changes from CVS trunk
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-200
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-201
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-202
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-203
Add entry for macroexpand-all to NEWS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-204
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-205
Add macroexpand-all to lisp reference manual
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-206
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-207
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-208
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-209
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-210
More RCS keyword removal
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-211
File-permission tweaks
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-212
Checkout from CVS with unexpanded RCS keywords
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-136
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/buffer.c b/src/buffer.c index 455b03efec2..ca74dda73bf 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -521,7 +521,7 @@ DEFUN ("make-indirect-buffer", Fmake_indirect_buffer, Smake_indirect_buffer, | |||
| 521 | 2, 3, | 521 | 2, 3, |
| 522 | "bMake indirect buffer (to buffer): \nBName of indirect buffer: ", | 522 | "bMake indirect buffer (to buffer): \nBName of indirect buffer: ", |
| 523 | doc: /* Create and return an indirect buffer for buffer BASE-BUFFER, named NAME. | 523 | doc: /* Create and return an indirect buffer for buffer BASE-BUFFER, named NAME. |
| 524 | BASE-BUFFER should be an existing buffer (or buffer name). | 524 | BASE-BUFFER should be a live buffer, or the name of an existing buffer. |
| 525 | NAME should be a string which is not the name of an existing buffer. | 525 | NAME should be a string which is not the name of an existing buffer. |
| 526 | Optional argument CLONE non-nil means preserve BASE-BUFFER's state, | 526 | Optional argument CLONE non-nil means preserve BASE-BUFFER's state, |
| 527 | such as major and minor modes, in the indirect buffer. | 527 | such as major and minor modes, in the indirect buffer. |
| @@ -529,16 +529,20 @@ CLONE nil means the indirect buffer's state is reset to default values. */) | |||
| 529 | (base_buffer, name, clone) | 529 | (base_buffer, name, clone) |
| 530 | Lisp_Object base_buffer, name, clone; | 530 | Lisp_Object base_buffer, name, clone; |
| 531 | { | 531 | { |
| 532 | Lisp_Object buf; | 532 | Lisp_Object buf, tem; |
| 533 | struct buffer *b; | 533 | struct buffer *b; |
| 534 | 534 | ||
| 535 | CHECK_STRING (name); | ||
| 535 | buf = Fget_buffer (name); | 536 | buf = Fget_buffer (name); |
| 536 | if (!NILP (buf)) | 537 | if (!NILP (buf)) |
| 537 | error ("Buffer name `%s' is in use", SDATA (name)); | 538 | error ("Buffer name `%s' is in use", SDATA (name)); |
| 538 | 539 | ||
| 540 | tem = base_buffer; | ||
| 539 | base_buffer = Fget_buffer (base_buffer); | 541 | base_buffer = Fget_buffer (base_buffer); |
| 540 | if (NILP (base_buffer)) | 542 | if (NILP (base_buffer)) |
| 541 | error ("No such buffer: `%s'", SDATA (name)); | 543 | error ("No such buffer: `%s'", SDATA (tem)); |
| 544 | if (NILP (XBUFFER (base_buffer)->name)) | ||
| 545 | error ("Base buffer has been killed"); | ||
| 542 | 546 | ||
| 543 | if (SCHARS (name) == 0) | 547 | if (SCHARS (name) == 0) |
| 544 | error ("Empty string for buffer name is not allowed"); | 548 | error ("Empty string for buffer name is not allowed"); |
| @@ -652,7 +656,7 @@ delete_all_overlays (b) | |||
| 652 | } | 656 | } |
| 653 | 657 | ||
| 654 | /* Reinitialize everything about a buffer except its name and contents | 658 | /* Reinitialize everything about a buffer except its name and contents |
| 655 | and local variables. | 659 | and local variables. |
| 656 | If called on an already-initialized buffer, the list of overlays | 660 | If called on an already-initialized buffer, the list of overlays |
| 657 | should be deleted before calling this function, otherwise we end up | 661 | should be deleted before calling this function, otherwise we end up |
| 658 | with overlays that claim to belong to the buffer but the buffer | 662 | with overlays that claim to belong to the buffer but the buffer |
| @@ -766,7 +770,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. | 770 | 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. | 771 | If there is no live buffer named NAME, then return NAME. |
| 768 | Otherwise modify name by appending `<NUMBER>', incrementing NUMBER | 772 | Otherwise modify name by appending `<NUMBER>', incrementing NUMBER |
| 769 | until an unused name is found, and then return that name. | 773 | \(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 | 774 | Optional second argument IGNORE specifies a name that is okay to use |
| 771 | \(if it is in the sequence to be tried) | 775 | \(if it is in the sequence to be tried) |
| 772 | even if a buffer with that name exists. */) | 776 | even if a buffer with that name exists. */) |
| @@ -779,6 +783,9 @@ even if a buffer with that name exists. */) | |||
| 779 | 783 | ||
| 780 | CHECK_STRING (name); | 784 | CHECK_STRING (name); |
| 781 | 785 | ||
| 786 | tem = Fstring_equal (name, ignore); | ||
| 787 | if (!NILP (tem)) | ||
| 788 | return name; | ||
| 782 | tem = Fget_buffer (name); | 789 | tem = Fget_buffer (name); |
| 783 | if (NILP (tem)) | 790 | if (NILP (tem)) |
| 784 | return name; | 791 | return name; |