(Input Methods): Refer to the command C-u C-x =.
[bpt/emacs.git] / man / dired.texi
index fd26981..b50ac82 100644 (file)
@@ -39,7 +39,8 @@ files.
 * 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.
-* Misc: Misc Dired Commands.  Various other features.
+* Wdired::                    Operating on files by editing the Dired buffer.
+* Misc: Misc Dired Features.  Various other features.
 @end menu
 
 @node Dired Enter
@@ -48,17 +49,20 @@ files.
 @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
@@ -87,7 +91,7 @@ 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
+@kindex M-g @r{(Dired)}
   @kbd{M-g} (@code{dired-goto-file}) moves point to the line that
 describes a specified file or directory.
 
@@ -253,11 +257,13 @@ and supplying that file name (@code{dired-find-file}).  @xref{Visiting}.
 @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 (@code{dired-find-alternate-file}).
+@end ignore
 
 @item o
 @kindex o @r{(Dired)}
@@ -273,7 +279,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
@@ -589,6 +596,12 @@ 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)
@@ -689,29 +702,21 @@ For example, @kbd{! uudecode @key{RET}} runs @code{uudecode} on each
 file.
 
 @item
-If the command string contains @samp{?} surrounded by whitespace, the
-current file name is substituted for @samp{?}.  You can use @samp{?}
-this way more than once in the command, and each occurrence is
-replaced.  For instance, here is how to uuencode each file, making the
-output file name by appending @samp{.uu} to the input file name:
-
-@example
-uuencode ? ? > ?.uu
-@end example
+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
 
 To iterate over the file names in a more complicated fashion, use an
-explicit shell loop.  For example, this shell command is another way
-to uuencode each file:
+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
 @end example
 
-@noindent
-This simple example doesn't require a shell loop (you can do it
-with @samp{?}, but it illustrates the technique.
-
 The working directory for the shell command is the top-level directory
 of the Dired buffer.
 
@@ -1022,10 +1027,11 @@ 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 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.
+  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
@@ -1093,31 +1099,71 @@ may need to change the value of this variable.
 program.  @kbd{M-x locate-with-filter} is similar, but keeps only lines
 matching a given regular expression.
 
-@node Misc Dired Commands
-@section Other Dired Commands
+  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 Misc Dired Features
+@section Other Dired Features
 
-@table @kbd
-@item w
 @cindex Adding to the kill ring in Dired.
-@kindex w
+@kindex w @r{(Dired)}
 @findex dired-copy-filename-as-kill
-The @kbd{w} command (@code{dired-copy-filename-as-kill}) puts the
+  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}.  With a zero prefix argument
-@var{n}=0, use the absolute file name of each marked file.  With just
-@kbd{C-u} as the prefix argument, use the relative file name of each
-marked file.  As a special case, if no prefix argument is given and
-point is on a directory headerline, @kbd{w} gives you the name of that
-directory without looking for marked files.
-
-@vindex dired-marked-files
-The main purpose of the @kbd{w} 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.  It also stores the
-list of names in the variable @code{dired-marked-files}, for use in
-Lisp expressions.
-@end table
+you had killed them with @kbd{C-w}.
+
+  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 @var{n}=0, this uses the absolute file name of each marked
+file.  With just @kbd{C-u} as the prefix argument, it uses the
+relative file name of each marked file.  As a special case, if no
+prefix argument is given and point is on a directory headerline,
+@kbd{w} gives you the name of that directory without looking for
+marked files.
+
+  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