]> code.delx.au - gnu-emacs/blobdiff - man/dired.texi
Move defvars out of eval-when-compile. Use
[gnu-emacs] / man / dired.texi
index 6a35b2d7f8c19faceaea4ec6e35368d631b69165..13bd5115f1fc1e37d36c965772f1121476ca432d 100644 (file)
@@ -1,19 +1,30 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985, 86, 87, 93, 94, 95, 97, 2000
-@c   Free Software Foundation, Inc.
+@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
+@c   2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Dired, Calendar/Diary, Rmail, Top
 @chapter Dired, the Directory Editor
 @cindex Dired
+@cindex file management
 
   Dired makes an Emacs buffer containing a listing of a directory, and
 optionally some of its subdirectories as well.  You can use the normal
 Emacs commands to move around in this buffer, and special Dired commands
 to operate on the files listed.
 
+    The Dired buffer is ``read-only,'' and inserting text in it is not
+useful, so ordinary printing characters such as @kbd{d} and @kbd{x} are
+used for special Dired commands.  Some Dired commands @dfn{mark} or
+@dfn{flag} the @dfn{current file} (that is, the file on the current
+line); other commands operate on the marked files or on the flagged
+files.
+
+  The Dired-X package provides various extra features for Dired mode.
+@xref{Top, Dired-X,,dired-x, Dired Extra Version 2 User's Manual}.
+
 @menu
 * Enter: Dired Enter.         How to invoke Dired.
-* Commands: Dired Commands.   Commands in the Dired buffer.
+* Navigation: Dired Navigation.   Special motion commands in the Dired buffer.
 * Deletion: Dired Deletion.   Deleting files with Dired.
 * Flagging Many Files::       Flagging files based on their names.
 * Visit: Dired Visiting.      Other file operations through Dired.
@@ -28,7 +39,10 @@ to operate on the files listed.
 * Hiding Subdirectories::     Making subdirectories visible or invisible.
 * Updating: Dired Updating.   Discarding lines for files of no interest.
 * Find: Dired and Find.              Using `find' to choose the files for Dired.
-* Extra: Dired Extra Features. Dired-X provides more features.
+* Wdired::                    Operating on files by editing the Dired buffer.
+* Tumme::                     Image file and thumbnail viewing and 
+                              manipulation from the Dired buffer.
+* Misc: Misc Dired Features.  Various other features.
 @end menu
 
 @node Dired Enter
@@ -37,17 +51,20 @@ to operate on the files listed.
 @findex dired
 @kindex C-x d
 @vindex dired-listing-switches
-  To invoke Dired, do @kbd{C-x d} or @kbd{M-x dired}.  The command reads
-a directory name or wildcard file name pattern as a minibuffer argument
-to specify which files to list.  Where @code{dired} differs from
-@code{list-directory} is in putting the buffer into Dired mode so that
-the special commands of Dired are available.
+  To invoke Dired, do @kbd{C-x d} or @kbd{M-x dired}.  The command
+reads a directory name or wildcard file name pattern as a minibuffer
+argument to specify which files to list.  @kbd{C-x C-f} given a
+directory name also invokes Dired.  Where @code{dired} differs from
+@code{list-directory} is that it puts the buffer into Dired mode, so
+that the special commands of Dired are available.
 
   The variable @code{dired-listing-switches} specifies the options to
-give to @code{ls} for listing directory; this string @emph{must} contain
+give to @code{ls} for listing the directory; this string @emph{must} contain
 @samp{-l}.  If you use a numeric prefix argument with the @code{dired}
 command, you can specify the @code{ls} switches with the minibuffer
-before you enter the directory specification.
+before you enter the directory specification.  No matter how they are
+specified, the @code{ls} switches should all be short options (that
+is, single characters) requiring no arguments.
 
 @findex dired-other-window
 @kindex C-x 4 d
@@ -58,15 +75,8 @@ selected window, use @kbd{C-x 4 d} (@code{dired-other-window}) instead
 of @kbd{C-x d}.  @kbd{C-x 5 d} (@code{dired-other-frame}) uses a
 separate frame to display the Dired buffer.
 
-@node Dired Commands
-@section Commands in the Dired Buffer
-
-    The Dired buffer is ``read-only,'' and inserting text in it is not
-useful, so ordinary printing characters such as @kbd{d} and @kbd{x} are
-used for special Dired commands.  Some Dired commands @dfn{mark} or
-@dfn{flag} the @dfn{current file} (that is, the file on the current
-line); other commands operate on the marked files or on the flagged
-files.
+@node Dired Navigation
+@section Navigation in the Dired Buffer
 
 @kindex C-n @r{(Dired)}
 @kindex C-p @r{(Dired)}
@@ -82,13 +92,21 @@ to @kbd{C-n}.  @kbd{p} is equivalent to @kbd{C-p}.  (Moving by lines is
 so common in Dired that it deserves to be easy to type.)  @key{DEL}
 (move up and unflag) is often useful simply for moving up.
 
+@findex dired-goto-file
+@kindex M-g @r{(Dired)}
+  @kbd{M-g} (@code{dired-goto-file}) moves point to the line that
+describes a specified file or directory.
+
+  Some additional navigation commands are available when the Dired
+buffer includes several directories.  @xref{Subdirectory Motion}.
+
 @node Dired Deletion
 @section Deleting Files with Dired
 @cindex flagging files (in Dired)
 @cindex deleting files (in Dired)
 
-  The primary use of Dired is to @dfn{flag} files for deletion and then
-delete the files previously flagged.
+  One of the most frequent uses of Dired is to first @dfn{flag} files for
+deletion, then delete the files that were flagged.
 
 @table @kbd
 @item d
@@ -108,25 +126,28 @@ file and typing @kbd{d} (@code{dired-flag-file-deletion}).  The deletion flag is
 the beginning of the line.  This command moves point to the next line,
 so that repeated @kbd{d} commands flag successive files.  A numeric
 argument serves as a repeat count.
+
+@cindex recursive deletion
 @vindex dired-recursive-deletes
-The variable @code{dired-recursive-deletes} determines if the delete
-command will delete non-empty directories recursively.  The default
-is to delete only empty directories.
+  The variable @code{dired-recursive-deletes} controls whether the
+delete command will delete non-empty directories (including their
+contents).  The default is to delete only empty directories.
 
 @kindex u @r{(Dired deletion)}
 @kindex DEL @r{(Dired)}
   The files are flagged for deletion rather than deleted immediately to
 reduce the danger of deleting a file accidentally.  Until you direct
-Dired to expunge the flagged files, you can remove deletion flags using
+Dired to delete the flagged files, you can remove deletion flags using
 the commands @kbd{u} and @key{DEL}.  @kbd{u} (@code{dired-unmark}) works
 just like @kbd{d}, but removes flags rather than making flags.
 @key{DEL} (@code{dired-unmark-backward}) moves upward, removing flags;
 it is like @kbd{u} with argument @minus{}1.
 
 @kindex x @r{(Dired)}
-@findex dired-expunge
+@findex dired-do-flagged-delete
 @cindex expunging (Dired)
-  To delete the flagged files, type @kbd{x} (@code{dired-expunge}).
+  To delete the flagged files, type @kbd{x} (@code{dired-do-flagged-delete}).
+(This is also known as @dfn{expunging}.)
 This command first displays a list of all the file names flagged for
 deletion, and requests confirmation with @kbd{yes}.  If you confirm,
 Dired deletes the flagged files, then deletes their lines from the text
@@ -138,6 +159,7 @@ the buffer, and no files actually deleted.
 
 @node Flagging Many Files
 @section Flagging Many Files at Once
+@cindex flagging many files for deletion (in Dired)
 
 @table @kbd
 @item #
@@ -171,22 +193,25 @@ keep.@refill
 @kindex & @r{(Dired)}
 @findex dired-flag-garbage-files
 @vindex dired-garbage-files-regexp
+@cindex deleting some backup files
   @kbd{&} (@code{dired-flag-garbage-files}) flags files whose names
 match the regular expression specified by the variable
 @code{dired-garbage-files-regexp}.  By default, this matches certain
-files produced by @TeX{}, and the @samp{.orig} and @samp{.rej} files
-produced by @code{patch}.
+files produced by @TeX{}, @samp{.bak} files, and the @samp{.orig} and
+@samp{.rej} files produced by @code{patch}.
 
 @kindex # @r{(Dired)}
-@kindex ~ @r{(Dired)}
 @findex dired-flag-auto-save-files
-@findex dired-flag-backup-files
+@cindex deleting auto-save files
   @kbd{#} (@code{dired-flag-auto-save-files}) flags for deletion all
 files whose names look like auto-save files (@pxref{Auto Save})---that
-is, files whose names begin and end with @samp{#}.  @kbd{~}
-(@code{dired-flag-backup-files}) flags for deletion all files whose
-names say they are backup files (@pxref{Backup})---that is, whose names
-end in @samp{~}.
+is, files whose names begin and end with @samp{#}.
+
+@kindex ~ @r{(Dired)}
+@findex dired-flag-backup-files
+  @kbd{~} (@code{dired-flag-backup-files}) flags for deletion all files
+whose names say they are backup files (@pxref{Backup})---that is, files
+whose names end in @samp{~}.
 
 @kindex . @r{(Dired)}
 @vindex dired-kept-versions
@@ -229,14 +254,18 @@ Visit the file described on the current line, like typing @kbd{C-x C-f}
 and supplying that file name (@code{dired-find-file}).  @xref{Visiting}.
 
 @item @key{RET}
+@itemx e
 @kindex RET @r{(Dired)}
+@kindex e @r{(Dired)}
 Equivalent to @kbd{f}.
 
+@ignore  @c This command seems too risky to document at all.
 @item a
 @kindex a @r{(Dired)}
 @findex dired-find-alternate-file
 Like @kbd{f}, but replaces the contents of the Dired buffer with
-that of an alternate file or directory.
+that of an alternate file or directory (@code{dired-find-alternate-file}).
+@end ignore
 
 @item o
 @kindex o @r{(Dired)}
@@ -252,7 +281,8 @@ file.  @xref{Windows}.
 Visit the file described on the current line, and display the buffer in
 another window, but do not select that window (@code{dired-display-file}).
 
-@item Mouse-2
+@item Mouse-1
+@itemx Mouse-2
 @findex dired-mouse-find-file-other-window
 Visit the file named by the line you click on
 (@code{dired-mouse-find-file-other-window}).  This uses another window
@@ -262,21 +292,27 @@ to display the file, like the @kbd{o} command.
 @kindex v @r{(Dired)}
 @findex dired-view-file
 View the file described on the current line, using @kbd{M-x view-file}
-(@code{dired-view-file}).
-
-Viewing a file is like visiting it, but is slanted toward moving around
-in the file conveniently and does not allow changing the file.
-@xref{Misc File Ops,View File}.
+(@code{dired-view-file}).  Viewing a file with @code{view-file} is
+like visiting it, but is slanted toward moving around in the file
+conveniently and does not allow changing the file.  @xref{Misc File
+Ops, View File, Miscellaneous File Operations}.
+
+@item ^
+@kindex ^ @r{(Dired)}
+@findex dired-up-directory
+Visit the parent directory of the current directory
+(@code{dired-up-directory}).  This is more convenient than moving to
+the parent directory's line and typing @kbd{f} there.
 @end table
 
 @node Marks vs Flags
 @section Dired Marks vs. Flags
 
-@cindex marking in Dired
-  Instead of flagging a file with @samp{D}, you can @dfn{mark} the file
-with some other character (usually @samp{*}).  Most Dired commands to
-operate on files, aside from ``expunge'' (@kbd{x}), look for files
-marked with @samp{*}.
+@cindex marking many files (in Dired)
+  Instead of flagging a file with @samp{D}, you can @dfn{mark} the
+file with some other character (usually @samp{*}).  Most Dired
+commands to operate on files use the files marked with @samp{*}, the
+exception being @kbd{x} which deletes the flagged files.
 
   Here are some commands for marking with @samp{*}, or for unmarking or
 operating on marks.  (@xref{Dired Deletion}, for commands to flag and
@@ -296,6 +332,7 @@ files.)
 @item * *
 @kindex * * @r{(Dired)}
 @findex dired-mark-executables
+@cindex marking executable files (in Dired)
 Mark all executable files with @samp{*}
 (@code{dired-mark-executables}).  With a numeric argument, unmark all
 those files.
@@ -303,12 +340,14 @@ those files.
 @item * @@
 @kindex * @@ @r{(Dired)}
 @findex dired-mark-symlinks
+@cindex marking symbolic links (in Dired)
 Mark all symbolic links with @samp{*} (@code{dired-mark-symlinks}).
 With a numeric argument, unmark all those files.
 
 @item * /
 @kindex * / @r{(Dired)}
 @findex dired-mark-directories
+@cindex marking subdirectories (in Dired)
 Mark with @samp{*} all files which are actually directories, except for
 @file{.} and @file{..} (@code{dired-mark-directories}).  With a numeric
 argument, unmark all those files.
@@ -330,21 +369,28 @@ Remove any mark on this line (@code{dired-unmark}).
 @itemx * @key{DEL}
 @kindex * DEL @r{(Dired)}
 @findex dired-unmark-backward
+@cindex unmarking files (in Dired)
 Move point to previous line and remove any mark on that line
 (@code{dired-unmark-backward}).
 
 @item * !
+@itemx U
 @kindex * ! @r{(Dired)}
-@findex dired-unmark-all-files-no-query
+@kindex U @r{(Dired)}
+@findex dired-unmark-all-marks
 Remove all marks from all the files in this Dired buffer
-(@code{dired-unmark-all-files-no-query}).
+(@code{dired-unmark-all-marks}).
 
 @item * ? @var{markchar}
+@itemx M-@key{DEL}
 @kindex * ? @r{(Dired)}
+@kindex M-DEL @r{(Dired)}
 @findex dired-unmark-all-files
 Remove all marks that use the character @var{markchar}
 (@code{dired-unmark-all-files}).  The argument is a single
-character---do not use @key{RET} to terminate it.
+character---do not use @key{RET} to terminate it.  See the description
+of the @kbd{* c} command below, which lets you replace one mark
+character with another.
 
 With a numeric argument, this command queries about each marked file,
 asking whether to remove its mark.  You can answer @kbd{y} meaning yes,
@@ -352,36 +398,44 @@ asking whether to remove its mark.  You can answer @kbd{y} meaning yes,
 files without asking about them.
 
 @item * C-n
+@itemx M-@}
 @findex dired-next-marked-file
 @kindex * C-n @r{(Dired)}
+@kindex M-@} @r{(Dired)}
 Move down to the next marked file (@code{dired-next-marked-file})
 A file is ``marked'' if it has any kind of mark.
 
 @item * C-p
+@itemx M-@{
 @findex dired-prev-marked-file
 @kindex * C-p @r{(Dired)}
+@kindex M-@{ @r{(Dired)}
 Move up to the previous marked file (@code{dired-prev-marked-file})
 
-@item * t
+@item t
+@itemx * t
+@kindex t @r{(Dired)}
 @kindex * t @r{(Dired)}
-@findex dired-do-toggle
-Toggle all marks (@code{dired-do-toggle}): files marked with @samp{*}
+@findex dired-toggle-marks
+@cindex toggling marks (in Dired)
+Toggle all marks (@code{dired-toggle-marks}): files marked with @samp{*}
 become unmarked, and unmarked files are marked with @samp{*}.  Files
 marked in any other way are not affected.
 
-@item * c @var{old} @var{new}
+@item * c @var{old-markchar} @var{new-markchar}
 @kindex * c @r{(Dired)}
 @findex dired-change-marks
-Replace all marks that use the character @var{old} with marks that use
-the character @var{new} (@code{dired-change-marks}).  This command is
-the primary way to create or use marks other than @samp{*} or @samp{D}.
-The arguments are single characters---do not use @key{RET} to terminate
-them.
+Replace all marks that use the character @var{old-markchar} with marks
+that use the character @var{new-markchar} (@code{dired-change-marks}).
+This command is the primary way to create or use marks other than
+@samp{*} or @samp{D}.  The arguments are single characters---do not use
+@key{RET} to terminate them.
 
 You can use almost any character as a mark character by means of this
-command, to distinguish various classes of files.  If @var{old} is a
-space (@samp{ }), then the command operates on all unmarked files; if
-@var{new} is a space, then the command unmarks the files it acts on.
+command, to distinguish various classes of files.  If @var{old-markchar}
+is a space (@samp{ }), then the command operates on all unmarked files;
+if @var{new-markchar} is a space, then the command unmarks the files it
+acts on.
 
 To illustrate the power of this command, here is how to put @samp{D}
 flags on all the files that have no marks, while unflagging all those
@@ -391,7 +445,7 @@ that already have @samp{D} flags:
 * c D t  * c SPC D  * c t SPC
 @end example
 
-This assumes that no files are marked with @samp{t}.
+This assumes that no files were already marked with @samp{t}.
 
 @item % m @var{regexp} @key{RET}
 @itemx * % @var{regexp} @key{RET}
@@ -409,7 +463,8 @@ hiding them (@pxref{Hiding Subdirectories}).
 
 @item % g @var{regexp} @key{RET}
 @findex dired-mark-files-containing-regexp
-@kindex % m @r{(Dired)}
+@kindex % g @r{(Dired)}
+@cindex finding files containing regexp matches (in Dired)
 Mark (with @samp{*}) all files whose @emph{contents} contain a match for
 the regular expression @var{regexp}
 (@code{dired-mark-files-containing-regexp}).  This command is like
@@ -420,7 +475,12 @@ name.
 @kindex C-_ @r{(Dired)}
 @findex dired-undo
 Undo changes in the Dired buffer, such as adding or removing
-marks (@code{dired-undo}).
+marks (@code{dired-undo}).  @emph{This command does not revert the
+actual file operations, nor recover lost files!}  It just undoes
+changes in the buffer itself.  For example, if used after renaming one
+or more files, @code{dired-undo} restores the original names, which
+will get the Dired buffer out of sync with the actual contents of the
+directory.
 @end table
 
 @node Operating on Files
@@ -448,6 +508,15 @@ on all those files.
 Otherwise, the command operates on the current file only.
 @end itemize
 
+@vindex dired-dwim-target
+@cindex two directories (in Dired)
+  Commands which ask for a destination directory, such as those which
+copy and rename files or create links for them, try to guess the default
+target directory for the operation.  Normally, they suggest the Dired
+buffer's default directory, but if the variable @code{dired-dwim-target}
+is non-@code{nil}, and if there is another Dired buffer displayed in the
+next window, that other buffer's directory is suggested instead.
+
   Here are the file-manipulating commands that operate on files in this
 way.  (Some other Dired commands, such as @kbd{!} and the @samp{%}
 commands, also use these conventions to decide which files to work on.)
@@ -455,29 +524,34 @@ commands, also use these conventions to decide which files to work on.)
 @table @kbd
 @findex dired-do-copy
 @kindex C @r{(Dired)}
+@cindex copying files (in Dired)
 @item C @var{new} @key{RET}
 Copy the specified files (@code{dired-do-copy}).  The argument @var{new}
 is the directory to copy into, or (if copying a single file) the new
 name.
-@vindex dired-recursive-copies
-The variable @code{dired-recursive-copies} determines if directories are
-copied recursively.  The default is to not copy recursively.
 
 @vindex dired-copy-preserve-time
 If @code{dired-copy-preserve-time} is non-@code{nil}, then copying with
 this command sets the modification time of the new file to be the same
 as that of the old file.
 
+@vindex dired-recursive-copies
+@cindex recursive copying
+The variable @code{dired-recursive-copies} controls whether
+directories are copied recursively.  The default is to not copy
+recursively, which means that directories cannot be copied.
+
 @item D
 @findex dired-do-delete
 @kindex D @r{(Dired)}
 Delete the specified files (@code{dired-do-delete}).  Like the other
 commands in this section, this command operates on the @emph{marked}
 files, or the next @var{n} files.  By contrast, @kbd{x}
-(@code{dired-expunge}) deletes all @dfn{flagged} files.
+(@code{dired-do-flagged-delete}) deletes all @dfn{flagged} files.
 
 @findex dired-do-rename
 @kindex R @r{(Dired)}
+@cindex renaming files (in Dired)
 @item R @var{new} @key{RET}
 Rename the specified files (@code{dired-do-rename}).  The argument
 @var{new} is the directory to rename into, or (if renaming a single
@@ -488,6 +562,7 @@ with renamed files so that they refer to the new names.
 
 @findex dired-do-hardlink
 @kindex H @r{(Dired)}
+@cindex hard links (in Dired)
 @item H @var{new} @key{RET}
 Make hard links to the specified files (@code{dired-do-hardlink}).  The
 argument @var{new} is the directory to make the links in, or (if making
@@ -495,6 +570,7 @@ just one link) the name to give the link.
 
 @findex dired-do-symlink
 @kindex S @r{(Dired)}
+@cindex symbolic links (creation in Dired)
 @item S @var{new} @key{RET}
 Make symbolic links to the specified files (@code{dired-do-symlink}).
 The argument @var{new} is the directory to make the links in, or (if
@@ -502,6 +578,7 @@ making just one link) the name to give the link.
 
 @findex dired-do-chmod
 @kindex M @r{(Dired)}
+@cindex changing file permissions (in Dired)
 @item M @var{modespec} @key{RET}
 Change the mode (also called ``permission bits'') of the specified files
 (@code{dired-do-chmod}).  This uses the @code{chmod} program, so
@@ -509,12 +586,14 @@ Change the mode (also called ``permission bits'') of the specified files
 
 @findex dired-do-chgrp
 @kindex G @r{(Dired)}
+@cindex changing file group (in Dired)
 @item G @var{newgroup} @key{RET}
 Change the group of the specified files to @var{newgroup}
 (@code{dired-do-chgrp}).
 
 @findex dired-do-chown
 @kindex O @r{(Dired)}
+@cindex changing file owner (in Dired)
 @item O @var{newowner} @key{RET}
 Change the owner of the specified files to @var{newowner}
 (@code{dired-do-chown}).  (On most systems, only the superuser can do
@@ -525,29 +604,39 @@ The variable @code{dired-chown-program} specifies the name of the
 program to use to do the work (different systems put @code{chown} in
 different places).
 
+@findex dired-do-touch
+@kindex T @r{(Dired)}
+@cindex changing file time (in Dired)
+@item T @var{timestamp} @key{RET}
+Change the time of the specified files (@code{dired-do-touch}).
+
 @findex dired-do-print
 @kindex P @r{(Dired)}
+@cindex printing files (in Dired)
 @item P @var{command} @key{RET}
 Print the specified files (@code{dired-do-print}).  You must specify the
 command to print them with, but the minibuffer starts out with a
 suitable guess made using the variables @code{lpr-command} and
 @code{lpr-switches} (the same variables that @code{lpr-buffer} uses;
-@pxref{Hardcopy}).
+@pxref{Printing}).
 
 @findex dired-do-compress
 @kindex Z @r{(Dired)}
+@cindex compressing files (in Dired)
 @item Z
 Compress the specified files (@code{dired-do-compress}).  If the file
 appears to be a compressed file already, it is uncompressed instead.
 
 @findex dired-do-load
 @kindex L @r{(Dired)}
+@cindex loading several files (in Dired)
 @item L
 Load the specified Emacs Lisp files (@code{dired-do-load}).
 @xref{Lisp Libraries}.
 
 @findex dired-do-byte-compile
 @kindex B @r{(Dired)}
+@cindex byte-compiling several files (in Dired)
 @item B
 Byte compile the specified Emacs Lisp files
 (@code{dired-do-byte-compile}).  @xref{Byte Compilation,, Byte
@@ -555,6 +644,7 @@ Compilation, elisp, The Emacs Lisp Reference Manual}.
 
 @kindex A @r{(Dired)}
 @findex dired-do-search
+@cindex search multiple files (in Dired)
 @item A @var{regexp} @key{RET}
 Search all the specified files for the regular expression @var{regexp}
 (@code{dired-do-search}).
@@ -564,21 +654,16 @@ the first match it finds; use @kbd{M-,} to resume the search and find
 the next match.  @xref{Tags Search}.
 
 @kindex Q @r{(Dired)}
-@findex dired-do-query-replace
-@item Q @var{from} @key{RET} @var{to} @key{RET}
+@findex dired-do-query-replace-regexp
+@cindex search and replace in multiple files (in Dired)
+@item Q @var{regexp} @key{RET} @var{to} @key{RET}
 Perform @code{query-replace-regexp} on each of the specified files,
-replacing matches for @var{from} (a regular expression) with the string
-@var{to} (@code{dired-do-query-replace}).
+replacing matches for @var{regexp} with the string
+@var{to} (@code{dired-do-query-replace-regexp}).
 
 This command is a variant of @code{tags-query-replace}.  If you exit the
 query replace loop, you can use @kbd{M-,} to resume the scan and replace
 more matches.  @xref{Tags Search}.
-
-@kindex a @r{(Dired)}
-@findex dired-do-apply
-@item a @var{function} @kbd{RET}
-Apply an arbitrary Lisp function to the name of each marked file
-(@code{dired-do-apply}).
 @end table
 
 @kindex + @r{(Dired)}
@@ -593,44 +678,53 @@ creates the directory if it does not already exist.
 
 @findex dired-do-shell-command
 @kindex ! @r{(Dired)}
-The dired command @kbd{!} (@code{dired-do-shell-command}) reads a shell
+@kindex X @r{(Dired)}
+The Dired command @kbd{!} (@code{dired-do-shell-command}) reads a shell
 command string in the minibuffer and runs that shell command on all the
-specified files.  You can specify the files to operate on in the usual
-ways for Dired commands (@pxref{Operating on Files}).  There are two
-ways of applying a shell command to multiple files:
+specified files.  @kbd{X} is a synonym for @kbd{!}.  You can specify the
+files to operate on in the usual ways for Dired commands
+(@pxref{Operating on Files}).  There are two ways of applying a shell
+command to multiple files:
 
 @itemize @bullet
 @item
-If you use @samp{*} in the shell command, then it runs just once, with
-the list of file names substituted for the @samp{*}.  The order of file
-names is the order of appearance in the Dired buffer.
+If you use @samp{*} surrounded by whitespace in the shell command,
+then the command runs just once, with the list of file names
+substituted for the @samp{*}.  The order of file names is the order of
+appearance in the Dired buffer.
 
 Thus, @kbd{! tar cf foo.tar * @key{RET}} runs @code{tar} on the entire
 list of file names, putting them into one tar file @file{foo.tar}.
 
+If you want to use @samp{*} as a shell wildcard with whitespace around
+it, write @samp{*""}.  In the shell, this is equivalent to @samp{*};
+but since the @samp{*} is not surrounded by whitespace, Dired does
+not treat it specially.
+
 @item
-If the command string doesn't contain @samp{*}, then it runs once
-@emph{for each file}, with the file name added at the end.
+If the command string doesn't contain @samp{*} surrounded by
+whitespace, then it runs once @emph{for each file}.  Normally the file
+name is added at the end.
 
 For example, @kbd{! uudecode @key{RET}} runs @code{uudecode} on each
 file.
+
+@item
+However, if the command string contains @samp{?} surrounded by
+whitespace, the current file name is substituted for @samp{?}  (rather
+than added at the end).  You can use @samp{?} this way more than once
+in the command, and the same file name replaces each occurrence.
 @end itemize
 
-What if you want to run the shell command once for each file but with
-the file name inserted in the middle?  Or if you want to use the file
-names in a more complicated fashion?  Use a shell loop.  For example,
-this shell command would run @code{uuencode} on each of the specified
-files, writing the output into a corresponding @file{.uu} file:
+To iterate over the file names in a more complicated fashion, use an
+explicit shell loop.  For example, here is how to uuencode each file,
+making the output file name by appending @samp{.uu} to the input file
+name:
 
 @example
-for file in *; do uuencode $file $file >$file.uu; done
+for file in * ; do uuencode "$file" "$file" >"$file".uu; done
 @end example
 
-@noindent
-In simple cases you can instead use @samp{?} in the command.  This is
-similar to @samp{*} but the command will be run on each file
-individually.
-
 The working directory for the shell command is the top-level directory
 of the Dired buffer.
 
@@ -643,11 +737,26 @@ Updating}).
 @node Transforming File Names
 @section Transforming File Names in Dired
 
-  Here are commands that alter file names in a systematic way:
+  This section describes Dired commands which alter file names in a
+systematic way.
+
+  Like the basic Dired file-manipulation commands (@pxref{Operating on
+Files}), the commands described here operate either on the next
+@var{n} files, or on all files marked with @samp{*}, or on the current
+file.  (To mark files, use the commands described in @ref{Marks vs
+Flags}.)
+
+  All of the commands described in this section work
+@emph{interactively}: they ask you to confirm the operation for each
+candidate file.  Thus, you can select more files than you actually
+need to operate on (e.g., with a regexp that matches many files), and
+then refine the selection by typing @kbd{y} or @kbd{n} when the
+command prompts for confirmation.
 
 @table @kbd
 @findex dired-upcase
 @kindex % u @r{(Dired)}
+@cindex upcase file names
 @item % u
 Rename each of the selected files to an upper-case name
 (@code{dired-upcase}).  If the old file names are @file{Foo}
@@ -656,6 +765,7 @@ and @file{bar}, the new names are @file{FOO} and @file{BAR}.
 @item % l
 @findex dired-downcase
 @kindex % l @r{(Dired)}
+@cindex downcase file names
 Rename each of the selected files to a lower-case name
 (@code{dired-downcase}).  If the old file names are @file{Foo} and
 @file{bar}, the new names are @file{foo} and @file{bar}.
@@ -699,7 +809,8 @@ matches that should span the whole filename.)
   Normally, the replacement process does not consider the files'
 directory names; it operates on the file name within the directory.  If
 you specify a numeric argument of zero, then replacement affects the
-entire absolute file name including directory name.
+entire absolute file name including directory name.  (Non-zero
+argument specifies the number of files to operate on.)
 
   Often you will want to select the set of files to operate on using the
 same @var{regexp} that you will use to operate on them.  To do this,
@@ -710,6 +821,8 @@ regular expression specified in any @kbd{%} command as a default.
 
 @node Comparison in Dired
 @section File Comparison with Dired
+@cindex file comparison (in Dired)
+@cindex compare files (in Dired)
 
   Here are two Dired commands that compare specified files using
 @code{diff}.
@@ -721,7 +834,10 @@ regular expression specified in any @kbd{%} command as a default.
 Compare the current file (the file at point) with another file (the file
 at the mark) using the @code{diff} program (@code{dired-diff}).  The
 file at the mark is the first argument of @code{diff}, and the file at
-point is the second argument.
+point is the second argument.  Use @kbd{C-@key{SPC}}
+(@code{set-mark-command}) to set the mark at the first file's line
+(@pxref{Setting Mark}), since @code{dired-diff} ignores the files marked
+with the Dired's @kbd{m} command.
 
 @findex dired-backup-diff
 @kindex M-= @r{(Dired)}
@@ -775,14 +891,15 @@ C-@key{SPC}} takes you back to the old position in the buffer (the line
 describing that subdirectory).
 
 Use the @kbd{l} command (@code{dired-do-redisplay}) to update the
-subdirectory's contents.  Use @kbd{k} to delete the subdirectory.
-@xref{Dired Updating}.
+subdirectory's contents.  Use @kbd{C-u k} on the subdirectory header
+line to delete the subdirectory.  @xref{Dired Updating}.
 
 @node Subdirectory Motion
 @section Moving Over Subdirectories
 
   When a Dired buffer lists subdirectories, you can use the page motion
-commands @kbd{C-x [} and @kbd{C-x ]} to move by entire directories.
+commands @kbd{C-x [} and @kbd{C-x ]} to move by entire directories
+(@pxref{Pages}).
 
 @cindex header line (Dired)
 @cindex directory header lines
@@ -859,11 +976,10 @@ ignore files in hidden directories even if they are marked.  Thus you
 can use hiding to temporarily exclude subdirectories from operations
 without having to remove the markers.
 
-  The subdirectory hiding commands toggle; that is, they hide what was
-visible, and show what was hidden.
-
 @node Dired Updating
 @section Updating the Dired Buffer
+@cindex updating Dired buffer
+@cindex refreshing displayed files
 
   This section describes commands to update the Dired buffer to reflect
 outside (non-Dired) changes in the directories and files, and to delete
@@ -899,29 +1015,32 @@ Hidden subdirectories are updated but remain hidden.
 @kindex l @r{(Dired)}
 @findex dired-do-redisplay
   To update only some of the files, type @kbd{l}
-(@code{dired-do-redisplay}).  This command applies to the next @var{n}
-files, or to the marked files if any, or to the current file.  Updating
-them means reading their current status from the file system and
-changing the buffer to reflect it properly.
+(@code{dired-do-redisplay}).  Like the Dired file-operating commands,
+this command operates on the next @var{n} files (or previous
+@minus{}@var{n} files), or on the marked files if any, or on the
+current file.  Updating the files means reading their current status,
+then updating their lines in the buffer to indicate that status.
 
   If you use @kbd{l} on a subdirectory header line, it updates the
 contents of the corresponding subdirectory.
 
 @kindex k @r{(Dired)}
 @findex dired-do-kill-lines
-  To delete the specified @emph{file lines}---not the files, just the
-lines---type @kbd{k} (@code{dired-do-kill-lines}).  With a numeric
-argument @var{n}, this command applies to the next @var{n} files;
-otherwise, it applies to the marked files.
-
-  If you kill the line for a file that is a directory, the directory's
-contents are also deleted from the buffer.  Typing @kbd{C-u k} on the
-header line for a subdirectory is another way to delete a subdirectory
-from the Dired buffer.
+  To delete the specified @emph{file lines} from the buffer---not
+delete the files---type @kbd{k} (@code{dired-do-kill-lines}).  Like
+the file-operating commands, this command operates on the next @var{n}
+files, or on the marked files if any; but it does not operate on the
+current file as a last resort.
+
+  If you use @kbd{k} with a numeric prefix argument to kill the line
+for a file that is a directory, which you have inserted in the Dired
+buffer as a subdirectory, then this deletes that subdirectory from the
+buffer as well.  Typing @kbd{C-u k} on the header line for a subdirectory
+is another way to delete a subdirectory from the Dired buffer.
 
   The @kbd{g} command brings back any individual lines that you have
 killed in this way, but not subdirectories---you must use @kbd{i} to
-reinsert each subdirectory.
+reinsert a subdirectory.
 
 @cindex Dired sorting
 @cindex sorting Dired buffer
@@ -958,8 +1077,10 @@ use @kbd{M-x find-grep-dired}.  This command reads two minibuffer
 arguments, @var{directory} and @var{regexp}; it chooses all the files in
 @var{directory} or its subdirectories that contain a match for
 @var{regexp}.  It works by running the programs @code{find} and
-@code{grep}.  See also @kbd{M-x grep-find}, in @ref{Compilation}.
+@code{grep}.  See also @kbd{M-x grep-find}, in @ref{Grep Searching}.
 Remember to write the regular expression for @code{grep}, not for Emacs.
+(An alternative method of showing files whose contents match a given
+regexp is the @kbd{% g @var{regexp}} command, see @ref{Marks vs Flags}.)
 
 @findex find-dired
   The most general command in this series is @kbd{M-x find-dired}, which
@@ -975,10 +1096,190 @@ variable @code{find-ls-option}, whose default value specifies using
 options @samp{-ld} for @code{ls}.  If your listings are corrupted, you
 may need to change the value of this variable.
 
-@node Dired Extra Features
-@section Extra Features for Dired
-
-The Dired-X package provides various extra features for Dired mode.  You
-can load it with @code{M-x load-library} or customize
-@code{dired-load-hook} to add @code{dired-require-dired-x}.
-@xref{,Dired-X,,dired-x, Dired Extra Version 2 User's Manual}.
+@findex locate
+@findex locate-with-filter
+@cindex file database (locate)
+@vindex locate-command
+  @kbd{M-x locate} provides a similar interface to the @code{locate}
+program.  @kbd{M-x locate-with-filter} is similar, but keeps only lines
+matching a given regular expression.
+
+  These buffers don't work entirely like ordinary Dired buffers.  File
+operations work, but do not always automatically update the buffer.
+Reverting the buffer with @kbd{g} deletes all inserted subdirectories,
+and erases all flags and marks.
+
+@node Wdired
+@section Editing the Dired Buffer
+
+@cindex wdired mode
+@findex wdired-change-to-wdired-mode
+  Wdired is a special mode that allows you to perform file operations
+by editing the Dired buffer directly (the ``W'' in ``Wdired'' stands
+for ``writable''.)  To enter Wdired mode, type @kbd{M-x
+wdired-change-to-wdired-mode} while in a Dired buffer.  Alternatively,
+use @samp{Edit File Names} in the @samp{Immediate} menu bar menu.
+
+@findex wdired-finish-edit
+  While in Wdired mode, you can rename files by editing the file names
+displayed in the Dired buffer.  All the ordinary Emacs editing
+commands, including rectangle operations and @code{query-replace}, are
+available for this.  Once you are done editing, type @kbd{C-c C-c}
+(@code{wdired-finish-edit}).  This applies your changes and switches
+back to ordinary Dired mode.
+
+  Apart from simply renaming files, you can move a file to another
+directory by typing in the new file name (either absolute or
+relative).  To mark a file for deletion, delete the entire filename.
+To change the target of a symbolic link, just edit the target name
+displayed next to the link name.
+
+  The rest of the text in the buffer, such as the file sizes and
+modification dates, is marked read-only, so you can't edit it.
+However, if you set @code{wdired-allow-to-change-permissions} to
+@code{t}, the file permission bits can also be edited.  For example,
+you can change @samp{-rw-r--r--} to @samp{-rw-rw-rw-} to make a file
+world-writable.  These changes also take effect when you type @kbd{C-c
+C-c}.
+
+@node Tumme
+@section Thumbnail and image file viewing and manipulation
+
+@cindex tumme mode
+
+  Tumme provides for simple viewing of thumbnails of image files.  It
+provides viewing of the original file, sized or in full size, inside
+Emacs or in an external viewer.
+
+  Tumme aims to be both easy to use for a beginner but also powerful
+and useful to an experienced user.
+
+  The quickest way to try out Tumme is to use the command
+@code{tumme}.  It will prompt for a directory where there are images
+files.  All images in that directory will get thumbnail files created
+for them, and the thumbnails will be displayed in the ``thumbnail
+buffer''.
+
+  If the directory contains many image files and becayse thumbnails
+are created on the fly before they can be displayed, the above command
+might take a long time, especially the first time (consecutive
+viewings will use the cached thumbnail files).  Also, if the number of
+image files is higher than @code{tumme-show-all-from-dir-max-files},
+the command will be aborted.  To work around this you can instead mark
+the files you want to look at, using @kbd{m} as usual in Dired, and
+then type @kbd{C-t d} (@code{tumme-display-thumbs}).
+
+  Regardless of which command you chose to display the thumbnails, a
+new buffer will open up, displaying thumbnail images of the files that
+were marked in dired.  The new buffer will be the active one.
+
+  With point in the thumbnail buffer, type @kbd{RET}
+(@code{tumme-display-thumbnail-original-image}) to display a sized
+version of it in another window.  The image will be sized to fit the
+window.  Use the arrow keys to move around in the buffer.  For easy
+browing, type @kbd{SPC} (@code{tumme-display-next-thumbnail-original})
+to advance and display the next image.  Typing @kbd{DEL}
+(@code{tumme-display-previous-thumbnail-original}) backs up to the
+previous thumbnail and displays that instead.
+
+  If you want to see the image in its original size, either provide a
+prefix argument (@kbd{C-u}) before pressing @kbd{RET}, or type
+@kbd{C-return} (@code{tumme-thumbnail-display-external}) to display
+the image in an external viewer.  To use the latter,
+@code{tumme-external-viewer} must be configured.
+
+  If you find in image that you want to delete, type @kbd{d}
+(@code{tumme-flag-thumb-original-file}) and the file will be flagged
+for deletion in the dired buffer.  If you just want visually to delete
+the thumbnail image from the thumbnail buffer, type @kbd{C-d}
+(@code{tumme-delete-char}).
+
+  More advanced features include commands for using ``tags''.  ``Tag''
+is just another word for ``keyword'', ``label'' or ``category''.  In
+short, it is meta data used to categorize an image file.  Commands
+exist to add tags for one or many image files from dired, to mark
+files having a certain tag in Dired and to remove tags from files.
+The tags put on image files are stored in a database file (currently a
+plain text file).
+
+  To tag image files, mark them in the dired buffer and type @kbd{C-t
+t} (@code{tumme-tag-files}).  You will be prompted for a tag. To mark
+files having a certain tag, type @kbd{C-t f}
+(@code{tumme-mark-tagged-files}). After marking image files with a
+certain tag, they can be viewed as explained earlier, by typing
+@key{C-t d}.
+
+  You can also tag a file from the thumbnail buffer by typing @kbd{t
+t} and remove it by typing @kbd{t r}.  There is also a special ``tag''
+called ``comment'' for each file (it is not a tag in the exact same
+sense as the other tags, it is handled slightly different).  That is
+used to enter a comment or description about the image.  You comment a
+file from the thumbnail buffer by typing @kbd{c}.  You will be
+prompted for a comment.  Comments can also be added from Dired, and
+then also to multiple files at once, by typing @kbd{C-t c}
+(@code{tumme-dired-comment-files}).
+
+  Tumme also provides simple image manipulation commands, like
+rotating thumbnails and original image files.  In the thumbnail
+buffer, type @kbd{L} to rotate the original image 90 degrees anti
+clockwise, and @kbd{R} to rotate it 90 degrees clockwise.  This
+rotation will be done lossless (the image quality will not be reduced)
+and needs an external utility called JpegTRAN to work.
+
+@node Misc Dired Features
+@section Other Dired Features
+
+@cindex Adding to the kill ring in Dired.
+@kindex w @r{(Dired)}
+@findex dired-copy-filename-as-kill
+  The @kbd{w} command (@code{dired-copy-filename-as-kill}) puts the
+names of the marked (or next @var{n}) files into the kill ring, as if
+you had killed them with @kbd{C-w}.  The names are separated by a space.
+
+  The main purpose of this command is so that you can yank the file
+names into arguments for other Emacs commands.  It also displays what
+was pushed onto the kill ring, so you can use it to display the list
+of currently marked files in the echo area.  With a zero prefix
+argument, this uses the absolute file name of each marked file.  With
+just @kbd{C-u} as the prefix argument, it uses file names relative to
+the Dired buffer's default directory.  (This can still contain slashes
+if in a subdirectory.)  As a special case, if point is on a directory
+headerline, @kbd{w} gives you the absolute name of that directory.
+Any prefix argument or marked files are ignored in this case.
+
+@findex dired-compare-directories
+  The command @kbd{M-x dired-compare-directories} is used to compare
+the current Dired buffer with another directory.  It marks all the files
+that are ``different'' between the two directories.  It puts these marks
+in all Dired buffers where these files are listed, which of course includes
+the current buffer.
+
+  The default comparison method (used if you type @key{RET} at the
+prompt) is to compare just the file names---each file name that does
+not appear in the other directory is ``different''.  You can specify
+more stringent comparisons by entering a Lisp expression, which can
+refer to the variables @code{size1} and @code{size2}, the respective
+file sizes; @code{mtime1} and @code{mtime2}, the last modification
+times in seconds, as floating point numers; and @code{fa1} and
+@code{fa2}, the respective file attribute lists (as returned by the
+function @code{file-attributes}).  This expression is evaluated for
+each pair of like-named files, and if the expression's value is
+non-@code{nil}, those files are considered ``different''.
+
+  For instance, @code{M-x dired-compare-directories @key{RET} (>
+mtime1 mtime2) @key{RET}} marks files newer in this directory than in
+the other, and marks files older in the other directory than in this
+one.  It also marks files with no counterpart, in both directories, as
+always.
+
+@cindex drag and drop, Dired
+  On the X window system, Emacs supports the ``drag and drop''
+protocol.  You can drag a file object from another program, and drop
+it onto a Dired buffer; this either moves, copies, or creates a link
+to the file in that directory.  Precisely which action is taken is
+determined by the originating program.  Dragging files out of a Dired
+buffer is currently not supported.
+
+@ignore
+   arch-tag: d105f9b9-fc1b-4c5f-a949-9b2cf3ca2fc1
+@end ignore