]> code.delx.au - gnu-emacs/blobdiff - doc/emacs/buffers.texi
Fix another shr infloop in the filling code
[gnu-emacs] / doc / emacs / buffers.texi
index c4880af2b5ddec76769bf4ea4abfdad0377e1d59..516eedca7729e15ee34952eee8b9a7e634d23ed0 100644 (file)
@@ -1,17 +1,17 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2011
-@c   Free Software Foundation, Inc.
+@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2013 Free Software
+@c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
-@node Buffers, Windows, Files, Top
+@node Buffers
 @chapter Using Multiple Buffers
 
 @cindex buffers
   The text you are editing in Emacs resides in an object called a
-@dfn{buffer}.  Each time you visit a file, a buffer is created to hold the
-file's text.  Each time you invoke Dired, a buffer is created to hold the
-directory listing.  If you send a message with @kbd{C-x m}, a buffer named
-@samp{*mail*} is used to hold the text of the message.  When you ask for a
-command's documentation, that appears in a buffer called @samp{*Help*}.
+@dfn{buffer}.  Each time you visit a file, a buffer is used to hold
+the file's text.  Each time you invoke Dired, a buffer is used to hold
+the directory listing.  If you send a message with @kbd{C-x m}, a
+buffer is used to hold the text of the message.  When you ask for a
+command's documentation, that appears in a buffer named @file{*Help*}.
 
   Each buffer has a unique name, which can be of any length.  When a
 buffer is displayed in a window, its name is shown in the mode line
@@ -19,35 +19,34 @@ buffer is displayed in a window, its name is shown in the mode line
 matters in buffer names.  Most buffers are made by visiting files, and
 their names are derived from the files' names; however, you can also
 create an empty buffer with any name you want.  A newly started Emacs
-has a buffer named @samp{*scratch*}, which is not associated with any
-file and can be used for evaluating Lisp expressions in Emacs
-(@pxref{Lisp Interaction}).
+has several buffers, including one named @file{*scratch*}, which can
+be used for evaluating Lisp expressions and is not associated with any
+file (@pxref{Lisp Interaction}).
 
 @cindex selected buffer
 @cindex current buffer
-  At any time, one and only one buffer is @dfn{current}.  This is also
-called the @dfn{selected buffer}.  We often say that a command
-operates on ``the buffer''; this really means that the command
-operates on the current buffer (most commands do).  When there is only
-one Emacs window, the buffer displayed in that window is current.
-When there are multiple windows present, the buffer displayed in the
-@dfn{selected window} is current.  @xref{Windows}.
-
-  Each buffer records individually what file it is visiting (if any),
-whether it is modified, and what major mode and minor modes are in
-effect (@pxref{Major Modes}).  Any Emacs variable can be made
-@dfn{local to} a particular buffer, meaning its value in that buffer
-can be different from the value in other buffers.  @xref{Locals}.
+  At any time, one and only one buffer is @dfn{selected}; we call it
+the @dfn{current buffer}.  We sometimes say that a command operates on
+``the buffer''; this really means that it operates on the current
+buffer.  When there is only one Emacs window, the buffer displayed in
+that window is current.  When there are multiple windows, the buffer
+displayed in the @dfn{selected window} is current.  @xref{Windows}.
+
+  Aside from its textual contents, each buffer records several pieces
+of information, such as what file it is visiting (if any), whether it
+is modified, and what major mode and minor modes are in effect
+(@pxref{Modes}).  These are stored in @dfn{buffer-local
+variables}---variables that can have a different value in each buffer.
+@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 typical 64-bit machines, the maximum buffer size
-enforced by the data types is @math{2^61 - 2} bytes, or about 2 EiB.
-For typical 32-bit machines, the maximum is @math{2^29 - 2} bytes, or
-about 512 MiB.  Buffer sizes are also limited by the size of Emacs's
-virtual memory.
+by the largest buffer position representable by @dfn{Emacs integers}.
+This is because Emacs tracks buffer positions using that data type.
+For typical 64-bit machines, this maximum buffer size is @math{2^61 -
+2} bytes, or about 2 EiB@.  For typical 32-bit machines, the maximum is
+usually @math{2^29 - 2} bytes, or about 512 MiB@.  Buffer sizes are
+also limited by the amount of memory in the system.
 
 @menu
 * Select Buffer::       Creating a new buffer or reselecting an old one.
@@ -76,9 +75,9 @@ Similar, but select @var{buffer} in another window
 Similar, but select @var{buffer} in a separate frame
 (@code{switch-to-buffer-other-frame}).
 @item C-x @key{LEFT}
-Select the previous buffer in the list of existing buffers.
+Select the previous buffer in the buffer list (@code{previous-buffer}).
 @item C-x @key{RIGHT}
-Select the next buffer in the list of existing buffers.
+Select the next buffer in the buffer list (@code{next-buffer}).
 @item C-u M-g M-g
 @itemx C-u M-g g
 Read a number @var{n} and move to line @var{n} in the most recently
@@ -87,85 +86,63 @@ selected buffer other than the current buffer.
 
 @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}.  While entering
-the buffer name, you can use the usual minibuffer completion and
-history commands (@pxref{Minibuffer}).  An empty argument to @kbd{C-x
-b} specifies the buffer that was current most recently among those not
+  The @kbd{C-x b} (@code{switch-to-buffer}) command reads a buffer
+name using the minibuffer.  Then it makes that buffer current, and
+displays it in the currently-selected window.  An empty input
+specifies the buffer that was current most recently among those not
 now displayed in any window.
 
-@cindex minibuffer confirmation
-@cindex confirming in the minibuffer
+  While entering the buffer name, you can use the usual completion and
+history commands (@pxref{Minibuffer}).  Note that @kbd{C-x b}, and
+related commands, use ``permissive completion with confirmation'' for
+minibuffer completion: if you type @key{RET} immediately after
+completing up to a nonexistent buffer name, Emacs prints
+@samp{[Confirm]} and you must type a second @key{RET} to submit that
+buffer name.  @xref{Completion Exit}, for details.
+
   If you specify a buffer that does not exist, @kbd{C-x b} creates a
 new, empty buffer that is not visiting any file, and selects it for
-editing.  First, however, Emacs might prompt you for confirmation, in
-case you entered the wrong buffer name.  Emacs asks for confirmation
-only if the last key you typed, before submitting the minibuffer input
-with @key{RET}, was @key{TAB} (@code{minibuffer-complete}).  This
-catches a common mistake, in which one types @key{RET} before
-realizing that @key{TAB} did not complete far enough to yield the
-desired buffer name (@pxref{Completion}).  Emacs asks for confirmation
-by putting the message @samp{[Confirm]} in the minibuffer; type
-@key{RET} again to confirm and visit the buffer.
-
-@vindex confirm-nonexistent-file-or-buffer
-  The variable @code{confirm-nonexistent-file-or-buffer} controls
-whether Emacs asks for confirmation before visiting a buffer that did
-not previously exist.  The default value, @code{after-completion},
-gives the behavior we have just described.  If the value is
-@code{nil}, Emacs never asks for confirmation; for any other
-non-@code{nil} value, Emacs always asks for confirmation.  This
-variable also affects the @code{find-file} command (@pxref{Visiting}).
-
-  One reason to create a new buffer is to use it for making temporary
-notes.  If you try to save it, Emacs asks for the file name to use.
-The default value of the variable @code{major-mode} determines the new
-buffer's major mode; the default value is Fundamental mode.  @xref{Major
-Modes}.
+editing.  The default value of the variable @code{major-mode}
+determines the new buffer's major mode; the default value is
+Fundamental mode.  @xref{Major Modes}.  One reason to create a new
+buffer is to use it for making temporary notes.  If you try to save
+it, Emacs asks for the file name to use, and the buffer's major mode
+is re-established taking that file name into account (@pxref{Choosing
+Modes}).
 
 @kindex C-x @key{LEFT}
 @kindex C-x @key{RIGHT}
 @findex next-buffer
 @findex previous-buffer
   For conveniently switching between a few buffers, use the commands
-@kbd{C-x @key{LEFT}} and @kbd{C-x @key{RIGHT}}.  @kbd{C-x @key{RIGHT}}
-(@code{previous-buffer}) selects the previous buffer (following the order
-of most recent selection in the current frame), while @kbd{C-x @key{LEFT}}
-(@code{next-buffer}) moves through buffers in the reverse direction.
+@kbd{C-x @key{LEFT}} and @kbd{C-x @key{RIGHT}}.  @kbd{C-x @key{LEFT}}
+(@code{previous-buffer}) selects the previous buffer (following the
+order of most recent selection in the current frame), while @kbd{C-x
+@key{RIGHT}} (@code{next-buffer}) moves through buffers in the reverse
+direction.
 
 @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} (@code{switch-to-buffer-other-window}).  This prompts
 for a buffer name using the minibuffer, displays that buffer in
-another window, and selects that 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}.
+another window, and selects that window.
 
 @kindex C-x 5 b
 @findex switch-to-buffer-other-frame
   Similarly, @kbd{C-x 5 b} (@code{switch-to-buffer-other-frame})
 prompts for a buffer name, displays that buffer in another frame, and
-selects that frame.
+selects that frame.  If the buffer is already being shown in a window
+on another frame, Emacs selects that window and frame instead of
+creating a new frame.
+
+  @xref{Displaying Buffers}, for how the @kbd{C-x 4 b} and @kbd{C-x 5
+b} commands get the window and/or frame to display in.
 
   In addition, @kbd{C-x C-f}, and any other command for visiting a
 file, can also be used to switch to an existing file-visiting buffer.
 @xref{Visiting}.
 
-@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 just raise that frame.
-
 @findex goto-line
   @kbd{C-u M-g M-g}, that is @code{goto-line} with a plain prefix
 argument, reads a number @var{n} using the minibuffer, selects the
@@ -203,7 +180,7 @@ buffers that were current most recently come first.
 
   @samp{.} in the first field of a line indicates that the buffer is
 current.  @samp{%} indicates a read-only buffer.  @samp{*} indicates
-that the buffer is ``modified.''  If several buffers are modified, it
+that the buffer is ``modified''.  If several buffers are modified, it
 may be time to save some with @kbd{C-x s} (@pxref{Save Commands}).
 Here is an example of a buffer list:
 
@@ -217,11 +194,11 @@ CRM Buffer                Size  Mode              File
  %  HELLO                 1607  Fundamental       ~/cvs/emacs/etc/HELLO
  %  NEWS                481184  Outline           ~/cvs/emacs/etc/NEWS
     *scratch*              191  Lisp Interaction
-  * *Messages*            1554  Fundamental
+  * *Messages*            1554  Messages
 @end smallexample
 
 @noindent
-The buffer @samp{*Help*} was made by a help request (@pxref{Help}); it
+The buffer @file{*Help*} was made by a help request (@pxref{Help}); it
 is not visiting any file.  The buffer @code{src} was made by Dired on
 the directory @file{~/cvs/emacs/src/}.  You can list only buffers that
 are visiting files by giving the command a prefix argument, as in
@@ -235,13 +212,13 @@ unless they visit files: such buffers are used internally by Emacs.
 
 @table @kbd
 @item C-x C-q
-Toggle read-only status of buffer (@code{toggle-read-only}).
+Toggle read-only status of buffer (@code{read-only-mode}).
 @item M-x rename-buffer @key{RET} @var{name} @key{RET}
 Change the name of the current buffer.
 @item M-x rename-uniquely
 Rename the current buffer by adding @samp{<@var{number}>} to the end.
 @item M-x view-buffer @key{RET} @var{buffer} @key{RET}
-Scroll through buffer @var{buffer}.
+Scroll through buffer @var{buffer}.  @xref{View Mode}.
 @end table
 
 @kindex C-x C-q
@@ -254,16 +231,15 @@ buffers are usually made by subsystems such as Dired and Rmail that
 have special commands to operate on the text; also by visiting a file
 whose access control says you cannot write it.
 
-@findex toggle-read-only
-  If you wish to make changes in a read-only buffer, use the command
-@kbd{C-x C-q} (@code{toggle-read-only}).  It makes a read-only buffer
-writable, and makes a writable buffer read-only.  This
-works by setting the variable @code{buffer-read-only}, which has a local
-value in each buffer and makes the buffer read-only if its value is
-non-@code{nil}.  If you have files under version control, you may find
-it convenient to bind @kbd{C-x C-q} to @code{vc-toggle-read-only}
-instead.  This will guard you against an operation that will confuse
-most modern version-conmtrol systems. @xref{Version Control}.
+@findex read-only-mode
+@vindex view-read-only
+ The command @kbd{C-x C-q} (@code{read-only-mode}) makes a read-only
+buffer writable, and makes a writable buffer read-only.  This works by
+setting the variable @code{buffer-read-only}, which has a local value
+in each buffer and makes the buffer read-only if its value is
+non-@code{nil}.  If you change the option @code{view-read-only} to a
+non-@code{nil} value, making the buffer read-only with @kbd{C-x C-q}
+also enables View mode in the buffer (@pxref{View Mode}).
 
 @findex rename-buffer
   @kbd{M-x rename-buffer} changes the name of the current buffer.  You
@@ -275,19 +251,19 @@ happens and no renaming is done.
   @kbd{M-x rename-uniquely} renames the current buffer to a similar
 name with a numeric suffix added to make it both different and unique.
 This command does not need an argument.  It is useful for creating
-multiple shell buffers: if you rename the @samp{*shell*} buffer, then
+multiple shell buffers: if you rename the @file{*shell*} buffer, then
 do @kbd{M-x shell} again, it makes a new shell buffer named
-@samp{*shell*}; meanwhile, the old shell buffer continues to exist
+@file{*shell*}; meanwhile, the old shell buffer continues to exist
 under its new name.  This method is also good for mail buffers,
 compilation buffers, and most Emacs features that create special
 buffers with particular names.  (With some of these features, such as
-@kbd{M-x compile}, @kbd{M-x grep} an @kbd{M-x info}, you need to
-switch to some other buffer before using the command, in order for it
-to make a different buffer.)
+@kbd{M-x compile}, @kbd{M-x grep}, you need to switch to some other
+buffer before using the command again, otherwise it will reuse the
+current buffer despite the name change.)
 
   The commands @kbd{M-x append-to-buffer} and @kbd{M-x insert-buffer}
-can be used to copy text from one buffer to another.  @xref{Accumulating
-Text}.
+can also be used to copy text from one buffer to another.
+@xref{Accumulating Text}.
 
 @node Kill Buffer
 @section Killing Buffers
@@ -333,7 +309,7 @@ whose names begin with a space, which are used internally by Emacs.
 To kill internal buffers as well, call @code{kill-matching-buffers}
 with a prefix argument.
 
-  The buffer menu feature is also convenient for killing various
+  The Buffer Menu feature is also convenient for killing various
 buffers.  @xref{Several Buffers}.
 
 @vindex kill-buffer-hook
@@ -353,8 +329,8 @@ for a mere hour.
 @cindex Midnight mode
 @vindex midnight-mode
 @vindex midnight-hook
-  You can also have this buffer purging done for you, every day at
-midnight, by enabling Midnight mode.  Midnight mode operates each day
+  You can also have this buffer purging done for you, once a day,
+by enabling Midnight mode.  Midnight mode operates each day
 at midnight; at that time, it runs @code{clean-buffer-list}, or
 whichever functions you have placed in the normal hook
 @code{midnight-hook} (@pxref{Hooks}).  To enable Midnight mode, use
@@ -363,7 +339,7 @@ the Customization buffer to set the variable @code{midnight-mode} to
 
 @node Several Buffers
 @section Operating on Several Buffers
-@cindex buffer menu
+@cindex Buffer Menu
 
 @table @kbd
 @item M-x buffer-menu
@@ -372,7 +348,7 @@ Begin editing a buffer listing all Emacs buffers.
 Similar, but do it in another window.
 @end table
 
-  The @dfn{buffer menu} opened by @kbd{C-x C-b} (@pxref{List Buffers})
+  The @dfn{Buffer Menu} opened by @kbd{C-x C-b} (@pxref{List Buffers})
 does not merely list buffers.  It also allows you to perform various
 operations on buffers, through an interface similar to Dired
 (@pxref{Dired}).  You can save buffers, kill them (here called
@@ -380,114 +356,177 @@ operations on buffers, through an interface similar to Dired
 
 @findex buffer-menu
 @findex buffer-menu-other-window
-  To use the buffer menu, type @kbd{C-x C-b} and switch to the window
-displaying the @samp{*Buffer List*} buffer.  You can also type
-@kbd{M-x buffer-menu} to open the buffer menu in the selected window.
+  To use the Buffer Menu, type @kbd{C-x C-b} and switch to the window
+displaying the @file{*Buffer List*} buffer.  You can also type
+@kbd{M-x buffer-menu} to open the Buffer Menu in the selected window.
 Alternatively, the command @kbd{M-x buffer-menu-other-window} opens
-the buffer menu in another window, and selects that window.
+the Buffer Menu in another window, and selects that window.
 
-  The buffer menu is a read-only buffer, and can be changed only
+  The Buffer Menu is a read-only buffer, and can be changed only
 through the special commands described in this section.  The usual
-Emacs cursor motion commands can be used in this buffer.  The
-following commands apply to the buffer described on the current line:
+cursor motion commands can be used in this buffer.  The following
+commands apply to the buffer described on the current line:
 
 @table @kbd
 @item d
-Request to delete (kill) the buffer, then move down.  The request
-shows as a @samp{D} on the line, before the buffer name.  Requested
-deletions take place when you type the @kbd{x} command.
+@findex Buffer-menu-delete
+@kindex d @r{(Buffer Menu)}
+Flag the buffer for deletion (killing), then move point to the next
+line (@code{Buffer-menu-delete}).  The deletion flag is indicated by
+the character @samp{D} on the line, before the buffer name.  The
+deletion occurs only when you type the @kbd{x} command (see below).
+
 @item C-d
-Like @kbd{d} but move up afterwards instead of down.
+@findex Buffer-menu-delete-backwards
+@kindex C-d @r{(Buffer Menu)}
+Like @kbd{d}, but move point up instead of down
+(@code{Buffer-menu-delete-backwards}).
+
 @item s
-Request to save the buffer.  The request shows as an @samp{S} on the
-line.  Requested saves take place when you type the @kbd{x} command.
-You may request both saving and deletion for the same buffer.
+@findex Buffer-menu-save
+@kindex s @r{(Buffer Menu)}
+Flag the buffer for saving (@code{Buffer-menu-save}).  The save flag
+is indicated by the character @samp{S} on the line, before the buffer
+name.  The saving occurs only when you type @kbd{x}.  You may request
+both saving and deletion for the same buffer.
+
 @item x
-Perform previously requested deletions and saves.
+@findex Buffer-menu-execute
+@kindex x @r{(Buffer Menu)}
+Perform all flagged deletions and saves (@code{Buffer-menu-execute}).
+
 @item u
-Remove any request made for the current line, and move down.
+@findex Buffer-menu-unmark
+@kindex u @r{(Buffer Menu)}
+Remove all flags from the current line, and move down
+(@code{Buffer-menu-unmark}).
+
 @item @key{DEL}
-Move to previous line and remove any request made for that line.
+@findex Buffer-menu-backup-unmark
+@kindex DEL @r{(Buffer Menu)}
+Move to the previous line and remove all flags on that line
+(@code{Buffer-menu-backup-unmark}).
 @end table
 
-  The @kbd{d}, @kbd{C-d}, @kbd{s} and @kbd{u} commands to add or remove
-flags also move down (or up) one line.  They accept a numeric argument
-as a repeat count.
+@noindent
+The commands for adding or removing flags, @kbd{d}, @kbd{C-d}, @kbd{s}
+and @kbd{u}, all accept a numeric argument as a repeat count.
 
-  These commands operate immediately on the buffer listed on the current
-line:
+  The following commands operate immediately on the buffer listed on
+the current line.  They also accept a numeric argument as a repeat
+count.
 
 @table @kbd
 @item ~
-Mark the buffer ``unmodified.''  The command @kbd{~} does this
-immediately when you type it.
+@findex Buffer-menu-not-modified
+@kindex ~ @r{(Buffer Menu)}
+Mark the buffer as unmodified (@code{Buffer-menu-not-modified}).
+@xref{Save Commands}.
+
 @item %
-Toggle the buffer's read-only flag.  The command @kbd{%} does
-this immediately when you type it.
+@findex Buffer-menu-toggle-read-only
+@kindex % @r{(Buffer Menu)}
+Toggle the buffer's read-only status
+(@code{Buffer-menu-toggle-read-only}).  @xref{Misc Buffer}.
+
 @item t
-Visit the buffer as a tags table.  @xref{Select Tags Table}.
+@findex Buffer-menu-visit-tags-table
+@kindex % @r{(Buffer Menu)}
+Visit the buffer as a tags table
+(@code{Buffer-menu-visit-tags-table}).  @xref{Select Tags Table}.
 @end table
 
-  There are also commands to select another buffer or buffers:
+  The following commands are used to select another buffer or buffers:
 
 @table @kbd
 @item q
-Quit the buffer menu---immediately display the most recent formerly
-visible buffer in its place.
+@findex quit-window
+@kindex q @r{(Buffer Menu)}
+Quit the Buffer Menu (@code{quit-window}).  The most recent formerly
+visible buffer is displayed in its place.
+
 @item @key{RET}
 @itemx f
-Immediately select this line's buffer in place of the @samp{*Buffer
-List*} buffer.
+@findex Buffer-menu-this-window
+@kindex f @r{(Buffer Menu)}
+@kindex RET @r{(Buffer Menu)}
+Select this line's buffer, replacing the @file{*Buffer List*} buffer
+in its window (@code{Buffer-menu-this-window}).
+
 @item o
-Immediately select this line's buffer in another window as if by
-@kbd{C-x 4 b}, leaving @samp{*Buffer List*} visible.
+@findex Buffer-menu-other-window
+@kindex o @r{(Buffer Menu)}
+Select this line's buffer in another window, as if by @kbd{C-x 4 b},
+leaving @file{*Buffer List*} visible
+(@code{Buffer-menu-other-window}).
+
 @item C-o
-Immediately display this line's buffer in another window, but don't
-select the window.
+@findex Buffer-menu-switch-other-window
+@kindex C-o @r{(Buffer Menu)}
+Display this line's buffer in another window, without selecting it
+(@code{Buffer-menu-switch-other-window}).
+
 @item 1
-Immediately select this line's buffer in a full-screen window.
+@findex Buffer-menu-1-window
+@kindex 1 @r{(Buffer Menu)}
+Select this line's buffer in a full-frame window
+(@code{Buffer-menu-1-window}).
+
 @item 2
-Immediately set up two windows, with this line's buffer selected in
-one, and the previously current buffer (aside from the buffer
-@samp{*Buffer List*}) displayed in the other.
+@findex Buffer-menu-2-window
+@kindex 2 @r{(Buffer Menu)}
+Set up two windows on the current frame, with this line's buffer
+selected in one, and a previously current buffer (aside from
+@file{*Buffer List*}) in the other (@code{Buffer-menu-2-window}).
+
 @item b
-Bury the buffer listed on this line.
+@findex Buffer-menu-bury
+@kindex b @r{(Buffer Menu)}
+Bury this line's buffer (@code{Buffer-menu-bury}).
+
 @item m
+@findex Buffer-menu-mark
+@kindex m @r{(Buffer Menu)}
 Mark this line's buffer to be displayed in another window if you exit
-with the @kbd{v} command.  The request shows as a @samp{>} at the
-beginning of the line.  (A single buffer may not have both a delete
-request and a display request.)
+with the @kbd{v} command (@code{Buffer-menu-mark}).  The display flag
+is indicated by the character @samp{>} at the beginning of the line.
+(A single buffer may not have both deletion and display flags.)
+
 @item v
-Immediately select this line's buffer, and also display in other windows
-any buffers previously marked with the @kbd{m} command.  If you have not
-marked any buffers, this command is equivalent to @kbd{1}.
+@findex Buffer-menu-select
+@kindex v @r{(Buffer Menu)}
+Select this line's buffer, and also display in other windows any
+buffers flagged with the @kbd{m} command (@code{Buffer-menu-select}).
+If you have not flagged any buffers, this command is equivalent to
+@kbd{1}.
 @end table
 
-  There is also a command that affects the entire buffer list:
+  The following commands affect the entire buffer list:
 
 @table @kbd
+@item S
+@findex tabulated-list-sort
+@kindex S @r{(Buffer Menu)}
+Sort the Buffer Menu entries according to their values in the column
+at point.  With a numeric prefix argument @var{n}, sort according to
+the @var{n}-th column (@code{tabulated-list-sort}).
+
 @item T
-Delete, or reinsert, lines for non-file buffers.  This command toggles
-the inclusion of such buffers in the buffer list.
+@findex Buffer-menu-toggle-files-only
+@kindex T @r{(Buffer Menu)}
+Delete, or reinsert, lines for non-file buffers
+@code{Buffer-menu-toggle-files-only}).  This command toggles the
+inclusion of such buffers in the buffer list.
 @end table
 
-  What @code{buffer-menu} actually does is create and switch to a
-suitable buffer, and turn on Buffer Menu mode in it.  Everything else
-described above is implemented by the special commands provided in
-Buffer Menu mode.  One consequence of this is that you can switch from
-the @samp{*Buffer List*} buffer to another Emacs buffer, and edit
-there.  You can reselect the @samp{*Buffer List*} buffer later, to
-perform the operations already requested, or you can kill it, or pay
-no further attention to it.
-
-  Normally, the buffer @samp{*Buffer List*} is not updated
+  Normally, the buffer @file{*Buffer List*} is not updated
 automatically when buffers are created and killed; its contents are
 just text.  If you have created, deleted or renamed buffers, the way
-to update @samp{*Buffer List*} to show what you have done is to type
+to update @file{*Buffer List*} to show what you have done is to type
 @kbd{g} (@code{revert-buffer}).  You can make this happen regularly
 every @code{auto-revert-interval} seconds if you enable Auto Revert
 mode in this buffer, as long as it is not marked modified.  Global
-Auto Revert mode applies to the @samp{*Buffer List*} buffer only if
+Auto Revert mode applies to the @file{*Buffer List*} buffer only if
 @code{global-auto-revert-non-file-buffers} is non-@code{nil}.
 @iftex
 @inforef{Autorevert,, emacs-xtra}, for details.
@@ -503,13 +542,13 @@ Auto Revert mode applies to the @samp{*Buffer List*} buffer only if
 
   An @dfn{indirect buffer} shares the text of some other buffer, which
 is called the @dfn{base buffer} of the indirect buffer.  In some ways it
-is the analogue, for buffers, of a symbolic link between files.
+is a buffer analogue of a symbolic link between files.
 
 @table @kbd
 @findex make-indirect-buffer
 @item M-x make-indirect-buffer @key{RET} @var{base-buffer} @key{RET} @var{indirect-name} @key{RET}
-Create an indirect buffer named @var{indirect-name} whose base buffer
-is @var{base-buffer}.
+Create an indirect buffer named @var{indirect-name} with base buffer
+@var{base-buffer}.
 @findex clone-indirect-buffer
 @item M-x clone-indirect-buffer @key{RET}
 Create an indirect buffer that is a twin copy of the current buffer.
@@ -547,10 +586,9 @@ buffer in another window.  These functions run the hook
 @code{clone-indirect-buffer-hook} after creating the indirect buffer.
 
   The more general way to make an indirect buffer is with the command
-@kbd{M-x make-indirect-buffer}.  It creates an indirect buffer from
-buffer @var{base-buffer}, under the name @var{indirect-name}.  It
-prompts for both @var{base-buffer} and @var{indirect-name} using the
-minibuffer.
+@kbd{M-x make-indirect-buffer}.  It creates an indirect buffer
+named @var{indirect-name} from a buffer @var{base-buffer}, prompting for
+both using the minibuffer.
 
 @node Buffer Convenience
 @section Convenience Features and Customization of Buffer Handling
@@ -560,7 +598,7 @@ convenient to switch between buffers.
 
 @menu
 * Uniquify::               Making buffer names unique with directory parts.
-* Iswitchb::               Switching between buffers with substrings.
+* Icomplete::              Fast minibuffer selection.
 * Buffer Menus::           Configurable buffer menu.
 @end menu
 
@@ -570,32 +608,37 @@ convenient to switch between buffers.
 @cindex unique buffer names
 @cindex directories in buffer names
   When several buffers visit identically-named files, Emacs must give
-the buffers distinct names.  The usual method for making buffer names
-unique adds @samp{<2>}, @samp{<3>}, etc. to the end of the buffer
-names (all but one of them).
+the buffers distinct names.  The default method
+(@code{uniquify-buffer-name-style} set to
+@code{post-forward-angle-brackets}) for making buffer names unique
+adds @samp{<dir1>}, @samp{<dir2>}, etc. to the end of the buffer
+names.
 
 @vindex uniquify-buffer-name-style
-  Other methods work by adding parts of each file's directory to the
-buffer name.  To select one, load the library @file{uniquify} (e.g.
-using @code{(require 'uniquify)}), and customize the variable
-@code{uniquify-buffer-name-style} (@pxref{Easy Customization}).
-
-  To begin with, the @code{forward} naming method includes part of the
-file's directory name at the beginning of the buffer name; using this
-method, buffers visiting the files @file{/u/rms/tmp/Makefile} and
+  There are several styles to make buffer names unique.  To select
+one, customize the variable @code{uniquify-buffer-name-style}
+(@pxref{Easy Customization}).
+
+  The @code{forward} naming method includes part of the file's
+directory name at the beginning of the buffer name; using this method,
+buffers visiting the files @file{/u/rms/tmp/Makefile} and
 @file{/usr/projects/zaphod/Makefile} would be named
-@samp{tmp/Makefile} and @samp{zaphod/Makefile}, respectively (instead
-of @samp{Makefile} and @samp{Makefile<2>}).
+@samp{tmp/Makefile} and @samp{zaphod/Makefile}.
 
   In contrast, the @code{post-forward} naming method would call the
-buffers @samp{Makefile|tmp} and @samp{Makefile|zaphod}, and the
+buffers @samp{Makefile|tmp} and @samp{Makefile|zaphod}.  The default
+method @code{post-forward-angle-brackets} is like @code{post-forward}
+except that it prepends the unique path in angle brackets.  The
 @code{reverse} naming method would call them @samp{Makefile\tmp} and
 @samp{Makefile\zaphod}.  The nontrivial difference between
 @code{post-forward} and @code{reverse} occurs when just one directory
 name is not enough to distinguish two files; then @code{reverse} puts
 the directory names in reverse order, so that @file{/top/middle/file}
 becomes @samp{file\middle\top}, while @code{post-forward} puts them in
-forward order after the file name, as in @samp{file|top/middle}.
+forward order after the file name, as in @samp{file|top/middle}.  If
+@code{uniquify-buffer-name-style} is set to @code{nil}, the buffer
+names simply get a @samp{<2>} etc. prepended.  This used to be the
+default behavior in Emacs versions up to 24.4.
 
   Which rule to follow for putting the directory names in the buffer
 name is not very important if you are going to @emph{look} at the
@@ -603,39 +646,31 @@ buffer names before you type one.  But as an experienced user, if you
 know the rule, you won't have to look.  And then you may find that one
 rule or another is easier for you to remember and apply quickly.
 
-@node Iswitchb
-@subsection Switching Between Buffers using Substrings
-
-@findex iswitchb-mode
-@cindex Iswitchb mode
-@cindex mode, Iswitchb
-@kindex C-x b @r{(Iswitchb mode)}
-@kindex C-x 4 b @r{(Iswitchb mode)}
-@kindex C-x 5 b @r{(Iswitchb mode)}
-@kindex C-x 4 C-o @r{(Iswitchb mode)}
-
-  Iswitchb global minor mode provides convenient switching between
-buffers using substrings of their names.  It replaces the normal
-definitions of @kbd{C-x b}, @kbd{C-x 4 b}, @kbd{C-x 5 b}, and @kbd{C-x
-4 C-o} with alternative commands that are somewhat ``smarter.''
-
-  When one of these commands prompts you for a buffer name, you can
-type in just a substring of the name you want to choose.  As you enter
-the substring, Iswitchb mode continuously displays a list of buffers
-that match the substring you have typed.
-
-  At any time, you can type @key{RET} to select the first buffer in
-the list.  So the way to select a particular buffer is to make it the
+@node Icomplete
+@subsection Fast minibuffer selection
+
+@findex icomplete-mode
+@cindex Icomplete mode
+
+  Icomplete global minor mode provides a convenient way to quickly select an
+element among the possible completions in a minibuffer.  When enabled, typing
+in the minibuffer continuously displays a list of possible completions that
+match the string you have typed.
+
+  At any time, you can type @key{C-j} to select the first completion in
+the list.  So the way to select a particular completion is to make it the
 first in the list.  There are two ways to do this.  You can type more
-of the buffer name and thus narrow down the list, excluding unwanted
-buffers above the desired one.  Alternatively, you can use @kbd{C-s}
-and @kbd{C-r} to rotate the list until the desired buffer is first.
+of the completion name and thus narrow down the list, excluding unwanted
+completions above the desired one.  Alternatively, you can use @kbd{C-.}
+and @kbd{C-,} to rotate the list until the desired buffer is first.
 
-  @key{TAB} while entering the buffer name performs completion on the
-string you have entered, based on the displayed list of buffers.
+  @key{M-TAB} will select the first completion in the list, like @key{C-j} but
+without exiting the minibuffer, so you can edit it further.  This is typically
+used when entering a file name, where @key{M-TAB} can be used a few times to
+descend in the hierarchy of directories.
 
-  To enable Iswitchb mode, type @kbd{M-x iswitchb-mode}, or customize
-the variable @code{iswitchb-mode} to @code{t} (@pxref{Easy
+  To enable Icomplete mode, type @kbd{M-x icomplete-mode}, or customize
+the variable @code{icomplete-mode} to @code{t} (@pxref{Easy
 Customization}).
 
 @node Buffer Menus
@@ -658,7 +693,6 @@ C-b}.  To customize this buffer list, use the @code{bs} Custom group
 @findex msb-mode
 @cindex mode, MSB
 @cindex MSB mode
-@cindex buffer menu
 @findex mouse-buffer-menu
 @kindex C-Down-Mouse-1
   MSB global minor mode (``MSB'' stands for ``mouse select buffer'')