diff options
| author | Martin Rudalics | 2008-10-23 09:05:39 +0000 |
|---|---|---|
| committer | Martin Rudalics | 2008-10-23 09:05:39 +0000 |
| commit | cd265ca60fa8bc6294137426e792b876d165f15e (patch) | |
| tree | 8f20666a75d19a7dfdc1f00b1bfda377414558ed | |
| parent | 472a4dc990b0cfc96691bd8dde0e983d1df7c204 (diff) | |
| download | emacs-cd265ca60fa8bc6294137426e792b876d165f15e.tar.gz emacs-cd265ca60fa8bc6294137426e792b876d165f15e.zip | |
(Fget_buffer_create): Rename arg to buffer_or_name. Reword doc-string.
(Fbury_buffer): In doc-string say what happens to the buffer's window.
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/buffer.c | 44 |
2 files changed, 32 insertions, 19 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 3920f5821ab..0a14ebc4e55 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2008-10-23 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * buffer.c (Fget_buffer_create): Rename arg to buffer_or_name. | ||
| 4 | Reword doc-string. | ||
| 5 | (Fbury_buffer): In doc-string say what happens to the buffer's | ||
| 6 | window. | ||
| 7 | |||
| 1 | 2008-10-23 Juanma Barranquero <lekktu@gmail.com> | 8 | 2008-10-23 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 9 | ||
| 3 | * character.c (syms_of_character) <script-representative-chars>: | 10 | * character.c (syms_of_character) <script-representative-chars>: |
diff --git a/src/buffer.c b/src/buffer.c index 3e25c28f5b4..922109ab282 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -334,22 +334,25 @@ get_truename_buffer (filename) | |||
| 334 | int buffer_count; | 334 | int buffer_count; |
| 335 | 335 | ||
| 336 | DEFUN ("get-buffer-create", Fget_buffer_create, Sget_buffer_create, 1, 1, 0, | 336 | DEFUN ("get-buffer-create", Fget_buffer_create, Sget_buffer_create, 1, 1, 0, |
| 337 | doc: /* Return the buffer named NAME, or create such a buffer and return it. | 337 | doc: /* Return the buffer specified by BUFFER-OR-NAME, creating a new one if needed. |
| 338 | A new buffer is created if there is no live buffer named NAME. | 338 | If BUFFER-OR-NAME is a string and a live buffer with that name exists, |
| 339 | If NAME starts with a space, the new buffer does not keep undo information. | 339 | return that buffer. If no such buffer exists, create a new buffer with |
| 340 | If NAME is a buffer instead of a string, then it is the value returned. | 340 | that name and return it. If BUFFER-OR-NAME starts with a space, the new |
| 341 | The value is never nil. */) | 341 | buffer does not keep undo information. |
| 342 | (name) | 342 | |
| 343 | register Lisp_Object name; | 343 | If BUFFER-OR-NAME is a buffer instead of a string, return it as given, |
| 344 | even if it is dead. The return value is never nil. */) | ||
| 345 | (buffer_or_name) | ||
| 346 | register Lisp_Object buffer_or_name; | ||
| 344 | { | 347 | { |
| 345 | register Lisp_Object buf; | 348 | register Lisp_Object buffer, name; |
| 346 | register struct buffer *b; | 349 | register struct buffer *b; |
| 347 | 350 | ||
| 348 | buf = Fget_buffer (name); | 351 | buffer = Fget_buffer (buffer_or_name); |
| 349 | if (!NILP (buf)) | 352 | if (!NILP (buffer)) |
| 350 | return buf; | 353 | return buffer; |
| 351 | 354 | ||
| 352 | if (SCHARS (name) == 0) | 355 | if (SCHARS (buffer_or_name) == 0) |
| 353 | error ("Empty string for buffer name is not allowed"); | 356 | error ("Empty string for buffer name is not allowed"); |
| 354 | 357 | ||
| 355 | b = allocate_buffer (); | 358 | b = allocate_buffer (); |
| @@ -403,7 +406,7 @@ The value is never nil. */) | |||
| 403 | b->begv_marker = Qnil; | 406 | b->begv_marker = Qnil; |
| 404 | b->zv_marker = Qnil; | 407 | b->zv_marker = Qnil; |
| 405 | 408 | ||
| 406 | name = Fcopy_sequence (name); | 409 | name = Fcopy_sequence (buffer_or_name); |
| 407 | STRING_SET_INTERVALS (name, NULL_INTERVAL); | 410 | STRING_SET_INTERVALS (name, NULL_INTERVAL); |
| 408 | b->name = name; | 411 | b->name = name; |
| 409 | 412 | ||
| @@ -417,17 +420,17 @@ The value is never nil. */) | |||
| 417 | b->name = name; | 420 | b->name = name; |
| 418 | 421 | ||
| 419 | /* Put this in the alist of all live buffers. */ | 422 | /* Put this in the alist of all live buffers. */ |
| 420 | XSETBUFFER (buf, b); | 423 | XSETBUFFER (buffer, b); |
| 421 | Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buf), Qnil)); | 424 | Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buffer), Qnil)); |
| 422 | 425 | ||
| 423 | /* An error in calling the function here (should someone redefine it) | 426 | /* An error in calling the function here (should someone redefine it) |
| 424 | can lead to infinite regress until you run out of stack. rms | 427 | can lead to infinite regress until you run out of stack. rms |
| 425 | says that's not worth protecting against. */ | 428 | says that's not worth protecting against. */ |
| 426 | if (!NILP (Ffboundp (Qucs_set_table_for_input))) | 429 | if (!NILP (Ffboundp (Qucs_set_table_for_input))) |
| 427 | /* buf is on buffer-alist, so no gcpro. */ | 430 | /* buffer is on buffer-alist, so no gcpro. */ |
| 428 | call1 (Qucs_set_table_for_input, buf); | 431 | call1 (Qucs_set_table_for_input, buffer); |
| 429 | 432 | ||
| 430 | return buf; | 433 | return buffer; |
| 431 | } | 434 | } |
| 432 | 435 | ||
| 433 | 436 | ||
| @@ -2047,7 +2050,10 @@ default. | |||
| 2047 | 2050 | ||
| 2048 | The argument may be a buffer name or an actual buffer object. If | 2051 | The argument may be a buffer name or an actual buffer object. If |
| 2049 | BUFFER-OR-NAME is nil or omitted, bury the current buffer and remove it | 2052 | BUFFER-OR-NAME is nil or omitted, bury the current buffer and remove it |
| 2050 | from the selected window if it is displayed there. */) | 2053 | from the selected window if it is displayed there. If the selected |
| 2054 | window is dedicated to its buffer, delete that window if there are other | ||
| 2055 | windows on the same frame. If the selected window is the only window on | ||
| 2056 | its frame, iconify that frame. */) | ||
| 2051 | (buffer_or_name) | 2057 | (buffer_or_name) |
| 2052 | register Lisp_Object buffer_or_name; | 2058 | register Lisp_Object buffer_or_name; |
| 2053 | { | 2059 | { |