comparison doc/lispref/buffers.texi @ 99082:82fc5c6c82f6

(Current Buffer): Reword documentation of set-buffer. (Buffer Names): Reword documentation of buffer-name. (The Buffer List): For bury-buffer explain what happens with the buffer's window. (Creating Buffers): Say that get-buffer-create's arg is buffer-or-name.
author Martin Rudalics <rudalics@gmx.at>
date Thu, 23 Oct 2008 09:20:00 +0000
parents 1dcf806b4a8d
children b7fa14d891a6
comparison
equal deleted inserted replaced
99081:781ed56ae566 99082:82fc5c6c82f6
192 @end group 192 @end group
193 @end example 193 @end example
194 @end defun 194 @end defun
195 195
196 @defun set-buffer buffer-or-name 196 @defun set-buffer buffer-or-name
197 This function makes @var{buffer-or-name} the current buffer. This does 197 This function makes @var{buffer-or-name} the current buffer. An error
198 not display the buffer in any window, so the user cannot necessarily see 198 is signaled if @var{buffer-or-name} is not an existing buffer or the
199 the buffer. But Lisp programs will now operate on it. 199 name of an existing buffer. The return value is the buffer made
200 200 current.
201 This function returns the buffer identified by @var{buffer-or-name}. 201
202 An error is signaled if @var{buffer-or-name} does not identify an 202 This function does not display the buffer in any window, so the user
203 existing buffer. 203 cannot necessarily see the buffer. But Lisp programs will now operate
204 on it.
204 @end defun 205 @end defun
205 206
206 @defspec save-current-buffer body@dots{} 207 @defspec save-current-buffer body@dots{}
207 The @code{save-current-buffer} special form saves the identity of the 208 The @code{save-current-buffer} special form saves the identity of the
208 current buffer, evaluates the @var{body} forms, and finally restores 209 current buffer, evaluates the @var{body} forms, and finally restores
268 visits a file, it @strong{is} mentioned). A name starting with 269 visits a file, it @strong{is} mentioned). A name starting with
269 space also initially disables recording undo information; see 270 space also initially disables recording undo information; see
270 @ref{Undo}. 271 @ref{Undo}.
271 272
272 @defun buffer-name &optional buffer 273 @defun buffer-name &optional buffer
273 This function returns the name of @var{buffer} as a string. If 274 This function returns the name of @var{buffer} as a string.
274 @var{buffer} is not supplied, it defaults to the current buffer. 275 @var{buffer} defaults to the current buffer.
275 276
276 If @code{buffer-name} returns @code{nil}, it means that @var{buffer} 277 If @code{buffer-name} returns @code{nil}, it means that @var{buffer}
277 has been killed. @xref{Killing Buffers}. 278 has been killed. @xref{Killing Buffers}.
278 279
279 @example 280 @example
881 @var{frame})} and in the value of @code{(buffer-list nil)}. 882 @var{frame})} and in the value of @code{(buffer-list nil)}.
882 883
883 If @var{buffer-or-name} is @code{nil} or omitted, this means to bury the 884 If @var{buffer-or-name} is @code{nil} or omitted, this means to bury the
884 current buffer. In addition, if the buffer is displayed in the selected 885 current buffer. In addition, if the buffer is displayed in the selected
885 window, this switches to some other buffer (obtained using 886 window, this switches to some other buffer (obtained using
886 @code{other-buffer}) in the selected window. But if the buffer is 887 @code{other-buffer}) in the selected window. But if the selected window
887 displayed in some other window, it remains displayed there. 888 is dedicated to its buffer, it deletes that window if there are other
889 windows left on its frame. Otherwise, if the selected window is the
890 only window on its frame, it iconifies that frame. If
891 @var{buffer-or-name} is displayed in some other window, it remains
892 displayed there.
888 893
889 To replace a buffer in all the windows that display it, use 894 To replace a buffer in all the windows that display it, use
890 @code{replace-buffer-in-windows}. @xref{Buffers and Windows}. 895 @code{replace-buffer-in-windows}. @xref{Buffers and Windows}.
891 @end deffn 896 @end deffn
892 897
903 Other functions you can use to create buffers include 908 Other functions you can use to create buffers include
904 @code{with-output-to-temp-buffer} (@pxref{Temporary Displays}) and 909 @code{with-output-to-temp-buffer} (@pxref{Temporary Displays}) and
905 @code{create-file-buffer} (@pxref{Visiting Files}). Starting a 910 @code{create-file-buffer} (@pxref{Visiting Files}). Starting a
906 subprocess can also create a buffer (@pxref{Processes}). 911 subprocess can also create a buffer (@pxref{Processes}).
907 912
908 @defun get-buffer-create name 913 @defun get-buffer-create buffer-or-name
909 This function returns a buffer named @var{name}. It returns a live 914 This function returns a buffer named @var{buffer-or-name}. An error is
910 buffer with that name, if one exists; otherwise, it creates a new 915 signaled if @var{buffer-or-name} is neither a string nor a buffer. The
911 buffer. The buffer does not become the current buffer---this function 916 buffer returned does not become the current buffer---this function does
912 does not change which buffer is current. 917 not change which buffer is current.
913 918
914 If @var{name} is a buffer instead of a string, it is returned, even if 919 If @var{buffer-or-name} is a string and a live buffer with that name
915 it is dead. An error is signaled if @var{name} is neither a string 920 exists, it returns that buffer. If no such buffer exists, it creates a
916 nor a buffer. 921 new buffer. If @var{buffer-or-name} is a buffer instead of a string, it
922 is returned as given, even if it is dead.
917 923
918 @example 924 @example
919 @group 925 @group
920 (get-buffer-create "foo") 926 (get-buffer-create "foo")
921 @result{} #<buffer foo> 927 @result{} #<buffer foo>