[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/buffer.c,v
From: |
Martin Rudalics |
Subject: |
[Emacs-diffs] Changes to emacs/src/buffer.c,v |
Date: |
Thu, 23 Oct 2008 09:01:50 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Martin Rudalics <m061211> 08/10/23 09:01:50
Index: buffer.c
===================================================================
RCS file: /sources/emacs/emacs/src/buffer.c,v
retrieving revision 1.570
retrieving revision 1.571
diff -u -b -r1.570 -r1.571
--- buffer.c 21 Oct 2008 14:05:55 -0000 1.570
+++ buffer.c 23 Oct 2008 09:01:50 -0000 1.571
@@ -334,22 +334,25 @@
int buffer_count;
DEFUN ("get-buffer-create", Fget_buffer_create, Sget_buffer_create, 1, 1, 0,
- doc: /* Return the buffer named NAME, or create such a buffer and
return it.
-A new buffer is created if there is no live buffer named NAME.
-If NAME starts with a space, the new buffer does not keep undo information.
-If NAME is a buffer instead of a string, then it is the value returned.
-The value is never nil. */)
- (name)
- register Lisp_Object name;
+ doc: /* Return the buffer specified by BUFFER-OR-NAME, creating a new
one if needed.
+If BUFFER-OR-NAME is a string and a live buffer with that name exists,
+return that buffer. If no such buffer exists, create a new buffer with
+that name and return it. If BUFFER-OR-NAME starts with a space, the new
+buffer does not keep undo information.
+
+If BUFFER-OR-NAME is a buffer instead of a string, return it as given,
+even if it is dead. The return value is never nil. */)
+ (buffer_or_name)
+ register Lisp_Object buffer_or_name;
{
- register Lisp_Object buf;
+ register Lisp_Object buffer, name;
register struct buffer *b;
- buf = Fget_buffer (name);
- if (!NILP (buf))
- return buf;
+ buffer = Fget_buffer (buffer_or_name);
+ if (!NILP (buffer))
+ return buffer;
- if (SCHARS (name) == 0)
+ if (SCHARS (buffer_or_name) == 0)
error ("Empty string for buffer name is not allowed");
b = allocate_buffer ();
@@ -403,7 +406,7 @@
b->begv_marker = Qnil;
b->zv_marker = Qnil;
- name = Fcopy_sequence (name);
+ name = Fcopy_sequence (buffer_or_name);
STRING_SET_INTERVALS (name, NULL_INTERVAL);
b->name = name;
@@ -417,17 +420,17 @@
b->name = name;
/* Put this in the alist of all live buffers. */
- XSETBUFFER (buf, b);
- Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buf), Qnil));
+ XSETBUFFER (buffer, b);
+ Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buffer), Qnil));
/* An error in calling the function here (should someone redefine it)
can lead to infinite regress until you run out of stack. rms
says that's not worth protecting against. */
if (!NILP (Ffboundp (Qucs_set_table_for_input)))
- /* buf is on buffer-alist, so no gcpro. */
- call1 (Qucs_set_table_for_input, buf);
+ /* buffer is on buffer-alist, so no gcpro. */
+ call1 (Qucs_set_table_for_input, buffer);
- return buf;
+ return buffer;
}
@@ -2047,7 +2050,10 @@
The argument may be a buffer name or an actual buffer object. If
BUFFER-OR-NAME is nil or omitted, bury the current buffer and remove it
-from the selected window if it is displayed there. */)
+from the selected window if it is displayed there. If the selected
+window is dedicated to its buffer, delete that window if there are other
+windows on the same frame. If the selected window is the only window on
+its frame, iconify that frame. */)
(buffer_or_name)
register Lisp_Object buffer_or_name;
{