Emacs commands to move around in this buffer, and special Dired
commands to operate on the listed files.
- The Dired buffer is ``read-only,'' and inserting text in it is not
+ The Dired buffer is ``read-only'', and inserting text in it is not
allowed. Ordinary printing characters such as @kbd{d} and @kbd{x} are
redefined for special Dired commands. Some Dired commands @dfn{mark}
or @dfn{flag} the @dfn{current file} (that is, the file on the current
either one file or several files.
* Shell Commands in Dired:: Running a shell command on the marked files.
* Transforming File Names:: Using patterns to rename multiple files.
-* Comparison in Dired:: Running `diff' by way of Dired.
+* Comparison in Dired:: Running @code{diff} by way of Dired.
* Subdirectories in Dired:: Adding subdirectories to the Dired buffer.
@ifnottex
* Subdir Switches:: Subdirectory switches in Dired.
* Subdirectory Motion:: Moving across subdirectories, and up and down.
* 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.
+* Find: Dired and Find. Using @code{find} to choose the files for Dired.
* Wdired:: Operating on files by editing the Dired buffer.
* Image-Dired:: Viewing image thumbnails in Dired.
* Misc: Misc Dired Features. Various other features.
@findex dired-other-frame
@kindex C-x 5 d
To display the Dired buffer in another 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-window}). @kbd{C-x 5 d}
(@code{dired-other-frame}) displays the Dired buffer in a separate
frame.
@table @kbd
@item d
-Flag this file for deletion.
+Flag this file for deletion (@code{dired-flag-file-deletion}).
@item u
-Remove deletion flag on this line.
+Remove the deletion flag (@code{dired-unmark}).
@item @key{DEL}
-Move point to previous line and remove the deletion flag on that line.
+Move point to previous line and remove the deletion flag on that line
+(@code{dired-unmark-backward}).
@item x
-Delete the files that are flagged for deletion.
+Delete files flagged for deletion (@code{dired-do-flagged-delete}).
@end table
@kindex d @r{(Dired)}
the file and typing @kbd{d} (@code{dired-flag-file-deletion}). The
deletion flag is visible as a @samp{D} at 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.
+commands flag successive files. A numeric prefix argument serves as a
+repeat count; a negative count means to flag preceding files.
+
+ If the region is active, the @kbd{d} command flags all files in the
+region for deletion; in this case, the command does not move point,
+and ignores any prefix argument.
@kindex u @r{(Dired deletion)}
@kindex DEL @r{(Dired)}
@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.
+like @kbd{u} with argument @minus{}1. A numeric prefix argument to
+either command serves as a repeat count, with a negative count meaning
+to unflag in the opposite direction. If the region is active, these
+commands instead unflag all files in the region, without moving point.
@kindex x @r{(Dired)}
@findex dired-do-flagged-delete
- To delete the flagged files, type @kbd{x}
-(@code{dired-do-flagged-delete}). 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
+ To delete flagged files, type @kbd{x}
+(@code{dired-do-flagged-delete}). This command 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 of the Dired buffer. The Dired
buffer, with somewhat fewer lines, remains selected.
@kindex m @r{(Dired)}
@kindex * m @r{(Dired)}
@findex dired-mark
-Mark the current file with @samp{*} (@code{dired-mark}). With a numeric
-argument @var{n}, mark the next @var{n} files starting with the current
-file. (If @var{n} is negative, mark the previous @minus{}@var{n}
-files.)
+Mark the current file with @samp{*} (@code{dired-mark}). If the
+region is active, mark all files in the region instead; otherwise, if
+a numeric argument @var{n} is supplied, mark the next @var{n} files
+instead, starting with the current file (if @var{n} is negative, mark
+the previous @minus{}@var{n} files).
@item * *
@kindex * * @r{(Dired)}
@kindex u @r{(Dired)}
@kindex * u @r{(Dired)}
@findex dired-unmark
-Remove any mark on this line (@code{dired-unmark}).
+Remove any mark on this line (@code{dired-unmark}). If the region is
+active, unmark all files in the region instead; otherwise, if a
+numeric argument @var{n} is supplied, unmark the next @var{n} files
+instead, starting with the current file (if @var{n} is negative,
+unmark the previous @minus{}@var{n} files).
@item @key{DEL}
@itemx * @key{DEL}
@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}).
+(@code{dired-unmark-backward}). If the region is active, unmark all
+files in the region instead; otherwise, if a numeric argument @var{n}
+is supplied, unmark the @var{n} preceding files instead, starting with
+the current file (if @var{n} is negative, unmark the next
+@minus{}@var{n} files).
@item * !
@itemx U
@cindex recursive copying
The variable @code{dired-recursive-copies} controls whether to copy
directories recursively (like @samp{cp -r}). The default is
-@code{nil}, which means that directories cannot be copied.
+@code{top}, which means to ask before recursively copying a directory.
@item D
@findex dired-do-delete
@item
If the command string contains neither @samp{*} nor @samp{?}, Emacs
-runs the shell command once for each file, adding the file name is
-added at the end. For example, @kbd{! uudecode @key{RET}} runs
-@code{uudecode} on each file.
+runs the shell command once for each file, adding the file name at the
+end. For example, @kbd{! uudecode @key{RET}} runs @code{uudecode} on
+each file.
@end itemize
To iterate over the file names in a more complicated fashion, use an
@cindex file comparison (in Dired)
@cindex compare files (in Dired)
- Here are two Dired commands that compare specified files using
-@code{diff}. They show the output in a buffer using Diff mode
-(@pxref{Comparing Files}).
-
-@table @kbd
-@item =
@findex dired-diff
@kindex = @r{(Dired)}
-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. This refers to the ordinary
-Emacs mark, not Dired marks; use @kbd{C-@key{SPC}}
-(@code{set-mark-command}) to set the mark at the first file's line
-(@pxref{Setting Mark}).
-
-@findex dired-backup-diff
-@kindex M-= @r{(Dired)}
-@item M-=
-Compare the current file with its latest backup file
-(@code{dired-backup-diff}). If the current file is itself a backup,
-compare it with the file it is a backup of; this way, you can compare
-a file with any one of its backups.
-
-The backup file is the first file given to @code{diff}.
-@end table
+ The @kbd{=} (@code{dired-diff}) command compares the current file
+(the file at point) with another file (read using the minibuffer)
+using the @command{diff} program. The file specified with the
+minibuffer is the first argument of @command{diff}, and file at point
+is the second argument. The output of the @command{diff} program is
+shown in a buffer using Diff mode (@pxref{Comparing Files}).
+
+ If the region is active, the default for the file read using the
+minibuffer is the file at the mark (i.e.@: the ordinary Emacs mark,
+not a Dired mark; @pxref{Setting Mark}). Otherwise, if the file at
+point has a backup file (@pxref{Backup}), that is the default.
@node Subdirectories in Dired
@section Subdirectories in Dired
@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{C-x C-q}
+for ``writable''.) To enter Wdired mode, type @kbd{C-x C-q}
(@code{dired-toggle-read-only}) while in a Dired buffer.
Alternatively, use the @samp{Immediate / Edit File Names} menu item.
You can also enter Image-Dired directly by typing @kbd{M-x
image-dired}. This prompts for a directory; specify one that has
image files. This creates thumbnails for all the images in that
-directory, and displays them all in the ``thumbnail buffer.'' This
+directory, and displays them all in the ``thumbnail buffer''. This
takes a long time if the directory contains many image files, and it
asks for confirmation if the number of image files exceeds
@code{image-dired-show-all-from-dir-max-files}.
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
+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
@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.''
+non-@code{nil}, those files are considered ``different''.
For instance, the sequence @code{M-x dired-compare-directories
@key{RET} (> mtime1 mtime2) @key{RET}} marks files newer in this