]> code.delx.au - gnu-emacs/blobdiff - doc/emacs/buffers.texi
Use grep-find-ignored-directories instead of vc-directory-exclusion-list
[gnu-emacs] / doc / emacs / buffers.texi
index 2d3ff5b05d8ac92b213c96b5b71f1e8a3c8b583d..2eb837f151029588bbc4ef0f3a6a023fda4408be 100644 (file)
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2013 Free Software
+@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2016 Free Software
 @c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Buffers
@@ -43,15 +43,15 @@ variables}---variables that can have a different value in each buffer.
   A buffer's size cannot be larger than some maximum, which is defined
 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
+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.
 * List Buffers::        Getting a list of buffers that exist.
-* Misc Buffer::         Renaming; changing read-onlyness; copying text.
+* Misc Buffer::         Renaming; changing read-only status; copying text.
 * Kill Buffer::         Killing buffers you no longer need.
 * Several Buffers::     How to go through the list of all buffers
                           and operate variously on several of them.
@@ -94,7 +94,7 @@ now displayed in any window.
 
   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
+related commands, use @dfn{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
@@ -174,13 +174,13 @@ List the existing buffers (@code{list-buffers}).
 @kindex C-x C-b
 @findex list-buffers
   To display a list of existing buffers, type @kbd{C-x C-b}.  Each
-line in the list shows one buffer's name, major mode and visited file.
+line in the list shows one buffer's name, size, major mode and visited file.
 The buffers are listed in the order that they were current; the
 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:
 
@@ -194,7 +194,7 @@ 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
@@ -226,10 +226,10 @@ Scroll through buffer @var{buffer}.  @xref{View Mode}.
 @cindex read-only buffer
   A buffer can be @dfn{read-only}, which means that commands to change
 its contents are not allowed.  The mode line indicates read-only
-buffers with @samp{%%} or @samp{%*} near the left margin.  Read-only
-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.
+buffers with @samp{%%} or @samp{%*} near the left margin.  @xref{Mode
+Line}.  Read-only 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 read-only-mode
 @vindex view-read-only
@@ -269,11 +269,16 @@ can also be used to copy text from one buffer to another.
 @section Killing Buffers
 
 @cindex killing buffers
+@cindex close buffer
+@cindex close file
   If you continue an Emacs session for a while, you may accumulate a
 large number of buffers.  You may then find it convenient to @dfn{kill}
-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:
+the buffers you no longer need.  (Some other editors call this
+operation @dfn{close}, and talk about ``closing the buffer'' or
+``closing the file'' visited in the buffer.)  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:
 
 @table @kbd
 @item C-x k @var{bufname} @key{RET}
@@ -344,7 +349,7 @@ the Customization buffer to set the variable @code{midnight-mode} to
 @table @kbd
 @item M-x buffer-menu
 Begin editing a buffer listing all Emacs buffers.
-@item M-x buffer-menu-other-window.
+@item M-x buffer-menu-other-window
 Similar, but do it in another window.
 @end table
 
@@ -515,7 +520,7 @@ the @var{n}-th column (@code{tabulated-list-sort}).
 @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
+(@code{Buffer-menu-toggle-files-only}).  This command toggles the
 inclusion of such buffers in the buffer list.
 @end table
 
@@ -598,7 +603,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
 
@@ -608,32 +613,36 @@ 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 adds a suffix based on
+the names of the directories that contain the files.  For example, if
+you visit files @file{/foo/bar/mumble/name} and
+@file{/baz/quux/mumble/name} at the same time, their buffers will be
+named @samp{name<bar/mumble>} and @samp{name<quux/mumble>}, respectively.
+Emacs adds as many directory parts as are needed to make a unique name.
 
 @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
+  You can choose from several different styles for constructing unique
+buffer names, by customizing the option @code{uniquify-buffer-name-style}.
+
+  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 encloses 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 @samp{<2>}, @samp{<3>}, etc.@: appended.
 
   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
@@ -641,39 +650,32 @@ 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
-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.
+@node Icomplete
+@subsection Fast minibuffer selection
 
-  @key{TAB} while entering the buffer name performs completion on the
-string you have entered, based on the displayed list of buffers.
+@findex icomplete-mode
+@cindex Icomplete mode
 
-  To enable Iswitchb mode, type @kbd{M-x iswitchb-mode}, or customize
-the variable @code{iswitchb-mode} to @code{t} (@pxref{Easy
+  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 @kbd{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 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.
+
+  @kbd{M-@key{TAB}} will select the first completion in the list, like
+@kbd{C-j} but without exiting the minibuffer, so you can edit it
+further.  This is typically used when entering a file name, where
+@kbd{M-@key{TAB}} can be used a few times to descend in the hierarchy
+of directories.
+
+  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
@@ -697,9 +699,10 @@ C-b}.  To customize this buffer list, use the @code{bs} Custom group
 @cindex mode, MSB
 @cindex MSB mode
 @findex mouse-buffer-menu
-@kindex C-Down-Mouse-1
+@kindex C-Down-mouse-1
   MSB global minor mode (``MSB'' stands for ``mouse select buffer'')
 provides a different and customizable mouse buffer menu which you may
 prefer.  It replaces the bindings of @code{mouse-buffer-menu},
-normally on @kbd{C-Down-Mouse-1}, and the menu bar buffer menu.  You
-can customize the menu in the @code{msb} Custom group.
+normally on @kbd{C-Down-mouse-1} and @kbd{C-@key{F10}}, and the menu
+bar buffer menu.  You can customize the menu in the @code{msb} Custom
+group.