GNU Info

Info Node: (emacs)Select Buffer

(emacs)Select Buffer


Next: List Buffers Up: Buffers
Enter node , (file) or (file)node

Creating and Selecting Buffers
==============================

`C-x b BUFFER <RET>'
     Select or create a buffer named BUFFER (`switch-to-buffer').

`C-x 4 b BUFFER <RET>'
     Similar, but select BUFFER in another window
     (`switch-to-buffer-other-window').

`C-x 5 b BUFFER <RET>'
     Similar, but select BUFFER in a separate frame
     (`switch-to-buffer-other-frame').

   To select the buffer named BUFNAME, type `C-x b BUFNAME <RET>'.
This runs the command `switch-to-buffer' with argument BUFNAME.  You
can use completion on an abbreviation for the buffer name you want
(Note: Completion).  An empty argument to `C-x b' specifies the
buffer that was current most recently among those not now displayed in
any window.

   To select a buffer in a window other than the current one, type `C-x
4 b BUFNAME <RET>'.  This runs the command
`switch-to-buffer-other-window' which displays the buffer BUFNAME in
another window.  By default, if displaying the buffer causes two
vertically adjacent windows to be displayed, the heights of those
windows are evened out; to countermand that and preserve the window
configuration, set the variable `even-window-heights' to `nil'.

   Similarly, `C-x 5 b BUFFER <RET>' runs the command
`switch-to-buffer-other-frame' which selects a buffer in another frame.

   You can control how certain buffers are handled by these commands by
customizing the variables `special-display-buffer-names',
`special-display-regexps', `same-window-buffer-names', and
`same-window-regexps'.  See Note: Force Same Window, and Note:
Special Buffer Frames, for more about these variables.  In addition,
if the value of `display-buffer-reuse-frames' is non-`nil', and the
buffer you want to switch to is already displayed in some frame, Emacs
will raise that frame.

   Most buffers are created by visiting files, or by Emacs commands that
want to display some text, but you can also create a buffer explicitly
by typing `C-x b BUFNAME <RET>'.  This makes a new, empty buffer that
is not visiting any file, and selects it for editing.  Such buffers are
used for making notes to yourself.  If you try to save one, you are
asked for the file name to use.  The new buffer's major mode is
determined by the value of `default-major-mode' (Note: Major Modes).

   Note that `C-x C-f', and any other command for visiting a file, can
also be used to switch to an existing file-visiting buffer.  Note:
Visiting.

   Emacs uses buffer names that start with a space for internal
purposes.  It treats these buffers specially in minor ways--for
example, by default they do not record undo information.  It is best to
avoid using such buffer names yourself.


automatically generated by info2www version 1.2.2.9