]> code.delx.au - gnu-emacs/blobdiff - man/buffers.texi
*** empty log message ***
[gnu-emacs] / man / buffers.texi
index 65907e6480bfabc57c1442612ceeb53cc9733405..03fef48f1af48a69125cca431d43dd0ffe1ada78 100644 (file)
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985, 86, 87, 93, 94, 95, 97, 2000
+@c Copyright (C) 1985, 86, 87, 93, 94, 95, 97, 2000, 2001
 @c   Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Buffers, Windows, Files, Top
@@ -15,14 +15,14 @@ command's documentation, that appears in a buffer called @samp{*Help*}.
 
 @cindex selected buffer
 @cindex current buffer
-  At any time, one and only one buffer is @dfn{selected}.  It is also
-called the @dfn{current buffer}.  Often we say that a command operates on
+  At any time, one and only one buffer is @dfn{current}.  It is also
+called the @dfn{selected buffer}.  Often we say that a command operates on
 ``the buffer'' as if there were only one; but really this means that the
-command operates on the selected buffer (most commands do).
+command operates on the current buffer (most commands do).
 
   When Emacs has multiple windows, each window has its own chosen
 buffer and displays it; at any time, only one of the windows is
-selected, and its chosen buffer is the selected buffer.  Each window's
+selected, and its chosen buffer is the current buffer.  Each window's
 mode line normally displays the name of the window's chosen buffer
 (@pxref{Windows}).
 
@@ -40,6 +40,13 @@ modified, and what major mode and minor modes are in effect in it
 particular buffer, meaning its value in that buffer can be different from
 the value in other buffers.  @xref{Locals}.
 
+@cindex buffer size, maximum
+  A buffer's size cannot be larger than some maximum, which is defined
+by the largest buffer position representable by the @dfn{Emacs integer}
+data type.  This is because Emacs tracks buffer positions using that
+data type.  For 32-bit machines, the largest buffer size is 128
+megabytes.
+
 @menu
 * Select Buffer::       Creating a new buffer or reselecting an old one.
 * List Buffers::        Getting a list of buffers that exist.
@@ -68,18 +75,42 @@ Similar, but select @var{buffer} in a separate frame
 (@code{switch-to-buffer-other-frame}).
 @end table
 
-@kindex C-x 4 b
-@findex switch-to-buffer-other-window
-@kindex C-x 5 b
-@findex switch-to-buffer-other-frame
 @kindex C-x b
 @findex switch-to-buffer
   To select the buffer named @var{bufname}, type @kbd{C-x b @var{bufname}
 @key{RET}}.  This runs the command @code{switch-to-buffer} with argument
 @var{bufname}.  You can use completion on an abbreviation for the buffer
 name you want (@pxref{Completion}).  An empty argument to @kbd{C-x b}
-specifies the most recently selected buffer that is not displayed in any
-window.@refill
+specifies the buffer that was current most recently among those not
+now displayed in any window.
+
+@kindex C-x 4 b
+@findex switch-to-buffer-other-window
+@vindex even-window-heights
+  To select a buffer in a window other than the current one, type
+@kbd{C-x 4 b @var{bufname} @key{RET}}.  This runs the command
+@code{switch-to-buffer-other-window} which displays the buffer
+@var{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 @code{even-window-heights} to
+@code{nil}.
+
+@kindex C-x 5 b
+@findex switch-to-buffer-other-frame
+  Similarly, @kbd{C-x 5 b @var{buffer} @key{RET}} runs the command
+@code{switch-to-buffer-other-frame} which selects a buffer in another
+frame.
+
+@vindex display-buffer-reuse-frames
+  You can control how certain buffers are handled by these commands by
+customizing the variables @code{special-display-buffer-names},
+@code{special-display-regexps}, @code{same-window-buffer-names}, and
+@code{same-window-regexps}.  See @ref{Force Same Window}, and
+@ref{Special Buffer Frames}, for more about these variables.  In
+addition, if the value of @code{display-buffer-reuse-frames} is
+non-@code{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
@@ -118,7 +149,7 @@ buffers that were current most recently come first.
   @samp{*} at the beginning of a line indicates the buffer is ``modified.''
 If several buffers are modified, it may be time to save some with @kbd{C-x s}
 (@pxref{Saving}).  @samp{%} indicates a read-only buffer.  @samp{.} marks the
-selected buffer.  Here is an example of a buffer list:@refill
+current buffer.  Here is an example of a buffer list:@refill
 
 @smallexample
  MR Buffer         Size  Mode           File
@@ -141,6 +172,9 @@ directory @file{/u2/emacs/man/}.  You can list only buffers that are
 visiting files by giving the command a prefix; for instance, by typing
 @kbd{C-u C-x C-b}.
 
+@code{list-buffers} omits buffers whose name begins with a blank,
+unless they visit files: such buffers are used internally by Emacs.
+
 @need 2000
 @node Misc Buffer
 @section Miscellaneous Buffer Operations
@@ -218,7 +252,6 @@ the buffers you no longer need.  On most operating systems, killing a
 buffer releases its space back to the operating system so that other
 programs can use it.  Here are some commands for killing buffers:
 
-@c WideCommands
 @table @kbd
 @item C-x k @var{bufname} @key{RET}
 Kill buffer @var{bufname} (@code{kill-buffer}).
@@ -231,12 +264,13 @@ Offer to kill each buffer, one by one.
 @kindex C-x k
 
   @kbd{C-x k} (@code{kill-buffer}) kills one buffer, whose name you
-specify in the minibuffer.  The default, used if you type just @key{RET}
-in the minibuffer, is to kill the current buffer.  If you kill the
-current buffer, another buffer is selected; one that has been selected
-recently but does not appear in any window now.  If you ask to kill a
-file-visiting buffer that is modified (has unsaved editing), then you
-must confirm with @kbd{yes} before the buffer is killed.
+specify in the minibuffer.  The default, used if you type just
+@key{RET} in the minibuffer, is to kill the current buffer.  If you
+kill the current buffer, another buffer becomes current: one that was
+current in the recent past but is not displayed in any window now.  If
+you ask to kill a file-visiting buffer that is modified (has unsaved
+editing), then you must confirm with @kbd{yes} before the buffer is
+killed.
 
   The command @kbd{M-x kill-some-buffers} asks about each buffer, one by
 one.  An answer of @kbd{y} means to kill the buffer.  Killing the current
@@ -285,15 +319,22 @@ them.
 @table @kbd
 @item M-x buffer-menu
 Begin editing a buffer listing all Emacs buffers.
+@item M-x buffer-menu-other-window.
+Similar, but do it in another window.
 @end table
 
 @findex buffer-menu
-  The command @code{buffer-menu} writes a list of all Emacs buffers into
-the buffer @samp{*Buffer List*}, and selects that buffer in Buffer Menu
-mode.  The buffer is read-only, and can be changed only through the
-special commands described in this section.  The usual Emacs cursor
-motion commands can be used in the @samp{*Buffer List*} buffer.  The
-following commands apply to the buffer described on the current line.
+@findex buffer-menu-other-window
+  The command @code{buffer-menu} writes a list of all Emacs
+buffers@footnote{Buffers which don't visit files and whose names begin
+with a space are omitted: these are used internally by Emacs.} into the
+buffer @samp{*Buffer List*}, and selects that buffer in Buffer Menu
+mode.  The list in the @samp{*Buffer List*} buffer looks exactly as
+described in @ref{List Buffers}.  The buffer is read-only, and can be
+changed only through the special commands described in this section.
+The usual Emacs cursor motion commands can be used in the @samp{*Buffer
+List*} buffer.  The following commands apply to the buffer described on
+the current line.
 
 @table @kbd
 @item d
@@ -352,7 +393,7 @@ select the window.
 Immediately select this line's buffer in a full-screen window.
 @item 2
 Immediately set up two windows, with this line's buffer in one, and the
-previously selected buffer (aside from the buffer @samp{*Buffer List*})
+previously current buffer (aside from the buffer @samp{*Buffer List*})
 in the other.
 @item b
 Bury the buffer listed on this line.
@@ -389,6 +430,10 @@ created, deleted or renamed buffers, the way to update @samp{*Buffer
 List*} to show what you have done is to type @kbd{g}
 (@code{revert-buffer}) or repeat the @code{buffer-menu} command.
 
+  The command @code{buffer-menu-other-window} works the same as
+@code{buffer-menu}, except that it displays the buffers list in
+another window.
+
 @node Indirect Buffers
 @section Indirect Buffers
 @cindex indirect buffer