diff options
| author | Chong Yidong | 2008-11-07 19:02:36 +0000 |
|---|---|---|
| committer | Chong Yidong | 2008-11-07 19:02:36 +0000 |
| commit | fac6225b93e3c1cbc1ec07734b18e5f4e2d9e3f4 (patch) | |
| tree | fdc5e104b8df3069e54396168e446170988f3700 | |
| parent | 6337bbdeda237cc32a9dbd35a4d56ff84cf448cd (diff) | |
| download | emacs-fac6225b93e3c1cbc1ec07734b18e5f4e2d9e3f4.tar.gz emacs-fac6225b93e3c1cbc1ec07734b18e5f4e2d9e3f4.zip | |
(Dired): Mention C-x C-d too.
(Dired Enter): Document M-n in the Dired minibuffer.
(Dired Navigation): Explain dired-goto-file more clearly. Document
dired-isearch-filenames.
(Dired Deletion): Remove unnecessary "expunged" terminology.
(Flagging Many Files): & is now rebound to `% &'.
(Shell Commands in Dired): Document dired-do-async-shell-command.
Clarify how multi-file arguments are passed.
(Misc Dired Features): Document dired-do-isearch.
| -rw-r--r-- | doc/emacs/dired.texi | 268 |
1 files changed, 151 insertions, 117 deletions
diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi index 104c59fb67e..b556c7a9c40 100644 --- a/doc/emacs/dired.texi +++ b/doc/emacs/dired.texi | |||
| @@ -11,20 +11,24 @@ | |||
| 11 | 11 | ||
| 12 | Dired makes an Emacs buffer containing a listing of a directory, and | 12 | Dired makes an Emacs buffer containing a listing of a directory, and |
| 13 | optionally some of its subdirectories as well. You can use the normal | 13 | optionally some of its subdirectories as well. You can use the normal |
| 14 | Emacs commands to move around in this buffer, and special Dired commands | 14 | Emacs commands to move around in this buffer, and special Dired |
| 15 | to operate on the files listed. | 15 | commands to operate on the listed files. |
| 16 | 16 | ||
| 17 | The Dired buffer is ``read-only,'' and inserting text in it is not | 17 | The Dired buffer is ``read-only,'' and inserting text in it is not |
| 18 | useful, so ordinary printing characters such as @kbd{d} and @kbd{x} | 18 | allowed. Ordinary printing characters such as @kbd{d} and @kbd{x} are |
| 19 | are redefined for special Dired commands. Some Dired commands | 19 | redefined for special Dired commands. Some Dired commands @dfn{mark} |
| 20 | @dfn{mark} or @dfn{flag} the @dfn{current file} (that is, the file on | 20 | or @dfn{flag} the @dfn{current file} (that is, the file on the current |
| 21 | the current line); other commands operate on the marked files or on | 21 | line); other commands operate on the marked files or on the flagged |
| 22 | the flagged files. You first mark certain files in order to operate | 22 | files. You first mark certain files in order to operate on all of |
| 23 | on all of them with on command. | 23 | them with one command. |
| 24 | 24 | ||
| 25 | The Dired-X package provides various extra features for Dired mode. | 25 | The Dired-X package provides various extra features for Dired mode. |
| 26 | @xref{Top, Dired-X,,dired-x, Dired Extra Version 2 User's Manual}. | 26 | @xref{Top, Dired-X,,dired-x, Dired Extra Version 2 User's Manual}. |
| 27 | 27 | ||
| 28 | You can also view a list of files in a directory with @kbd{C-x C-d} | ||
| 29 | (@code{list-directory}). Unlike Dired, this command does not allow | ||
| 30 | you to operate on the listed files. @xref{Directories}. | ||
| 31 | |||
| 28 | @menu | 32 | @menu |
| 29 | * Enter: Dired Enter. How to invoke Dired. | 33 | * Enter: Dired Enter. How to invoke Dired. |
| 30 | * Navigation: Dired Navigation. Special motion commands in the Dired buffer. | 34 | * Navigation: Dired Navigation. Special motion commands in the Dired buffer. |
| @@ -56,12 +60,17 @@ on all of them with on command. | |||
| 56 | @findex dired | 60 | @findex dired |
| 57 | @kindex C-x d | 61 | @kindex C-x d |
| 58 | @vindex dired-listing-switches | 62 | @vindex dired-listing-switches |
| 59 | To invoke Dired, do @kbd{C-x d} or @kbd{M-x dired}. The command | 63 | To invoke Dired, type @kbd{C-x d} (@code{dired}). This reads a |
| 60 | reads a directory name or wildcard file name pattern as a minibuffer | 64 | directory name using the minibuffer, and opens a @dfn{Dired buffer} |
| 61 | argument to specify the files to list. @kbd{C-x C-f} given a | 65 | listing the files in that directory. You can also supply a wildcard |
| 62 | directory name also invokes Dired. Where @code{dired} differs from | 66 | file name pattern as the minibuffer argument, in which case the Dired |
| 63 | @code{list-directory} is that it puts the buffer into Dired mode, so | 67 | buffer lists all files matching that pattern. The usual history and |
| 64 | that the special commands of Dired are available. | 68 | completion commands can be used in the minibuffer; in particular, |
| 69 | @kbd{M-n} puts the name of the visited file (if any) in the minibuffer | ||
| 70 | (@pxref{Minibuffer History}). | ||
| 71 | |||
| 72 | You can also invoke Dired by giving @kbd{C-x C-f} (@code{find-file}) | ||
| 73 | a directory name. | ||
| 65 | 74 | ||
| 66 | The variable @code{dired-listing-switches} specifies the options to | 75 | The variable @code{dired-listing-switches} specifies the options to |
| 67 | give to @code{ls} for listing the directory; this string @emph{must} | 76 | give to @code{ls} for listing the directory; this string @emph{must} |
| @@ -76,7 +85,6 @@ options (starting with @samp{--}) whose arguments are specified with | |||
| 76 | On MS-Windows and MS-DOS systems, Emacs @emph{emulates} @code{ls}; | 85 | On MS-Windows and MS-DOS systems, Emacs @emph{emulates} @code{ls}; |
| 77 | see @ref{ls in Lisp}, for options and peculiarities of that emulation. | 86 | see @ref{ls in Lisp}, for options and peculiarities of that emulation. |
| 78 | 87 | ||
| 79 | |||
| 80 | @findex dired-other-window | 88 | @findex dired-other-window |
| 81 | @kindex C-x 4 d | 89 | @kindex C-x 4 d |
| 82 | @findex dired-other-frame | 90 | @findex dired-other-frame |
| @@ -98,14 +106,28 @@ the beginning of the line. | |||
| 98 | 106 | ||
| 99 | @kindex SPC @r{(Dired)} | 107 | @kindex SPC @r{(Dired)} |
| 100 | For extra convenience, @key{SPC} and @kbd{n} in Dired are equivalent | 108 | For extra convenience, @key{SPC} and @kbd{n} in Dired are equivalent |
| 101 | to @kbd{C-n}. @kbd{p} is equivalent to @kbd{C-p}. (Moving by lines is | 109 | to @kbd{C-n}. @kbd{p} is equivalent to @kbd{C-p}. (Moving by lines |
| 102 | so common in Dired that it deserves to be easy to type.) @key{DEL} | 110 | is so common in Dired that it deserves to be easy to type.) @key{DEL} |
| 103 | (move up and unflag) is often useful simply for moving up. | 111 | (move up and unflag) is also often useful simply for moving up |
| 112 | (@pxref{Dired Deletion}). | ||
| 104 | 113 | ||
| 105 | @findex dired-goto-file | 114 | @findex dired-goto-file |
| 106 | @kindex j @r{(Dired)} | 115 | @kindex j @r{(Dired)} |
| 107 | @kbd{j} (@code{dired-goto-file}) moves point to the line that | 116 | @kbd{j} (@code{dired-goto-file}) prompts for a file name using the |
| 108 | describes a specified file or directory. | 117 | minibuffer, and moves point to the line in the Dired buffer describing |
| 118 | that file. | ||
| 119 | |||
| 120 | @cindex searching Dired buffers | ||
| 121 | @vindex dired-isearch-filenames | ||
| 122 | @kbd{M-s f C-s} (@code{dired-isearch-filenames}) performs a forward | ||
| 123 | incremental search in the Dired buffer, looking for matches only | ||
| 124 | amongst the file names and ignoring the rest of the text in the | ||
| 125 | buffer. @kbd{M-s f M-C-s} (@code{dired-isearch-filenames-regexp}) | ||
| 126 | does the same, using a regular expression search. If you change the | ||
| 127 | variable @var{dired-isearch-filenames} to non-@code{nil}, then the | ||
| 128 | usual search commands also limit themselves to the file names; for | ||
| 129 | instance, @kbd{C-s} behaves like @kbd{M-s f C-s}. @xref{Search}, for | ||
| 130 | information about incremental search. | ||
| 109 | 131 | ||
| 110 | Some additional navigation commands are available when the Dired | 132 | Some additional navigation commands are available when the Dired |
| 111 | buffer includes several directories. @xref{Subdirectory Motion}. | 133 | buffer includes several directories. @xref{Subdirectory Motion}. |
| @@ -151,14 +173,12 @@ like @kbd{u} with argument @minus{}1. | |||
| 151 | 173 | ||
| 152 | @kindex x @r{(Dired)} | 174 | @kindex x @r{(Dired)} |
| 153 | @findex dired-do-flagged-delete | 175 | @findex dired-do-flagged-delete |
| 154 | @cindex expunging (Dired) | ||
| 155 | To delete the flagged files, type @kbd{x} | 176 | To delete the flagged files, type @kbd{x} |
| 156 | (@code{dired-do-flagged-delete}). (This is also known as | 177 | (@code{dired-do-flagged-delete}). This command first displays a list |
| 157 | @dfn{expunging}.) This command first displays a list of all the file | 178 | of all the file names flagged for deletion, and requests confirmation |
| 158 | names flagged for deletion, and requests confirmation with @kbd{yes}. | 179 | with @kbd{yes}. If you confirm, Dired deletes the flagged files, then |
| 159 | If you confirm, Dired deletes the flagged files, then deletes their | 180 | deletes their lines from the text of the Dired buffer. The Dired |
| 160 | lines from the text of the Dired buffer. The Dired buffer, with | 181 | buffer, with somewhat fewer lines, remains selected. |
| 161 | somewhat fewer lines, remains selected. | ||
| 162 | 182 | ||
| 163 | If you answer @kbd{no} or quit with @kbd{C-g} when asked to confirm, you | 183 | If you answer @kbd{no} or quit with @kbd{C-g} when asked to confirm, you |
| 164 | return immediately to Dired, with the deletion flags still present in | 184 | return immediately to Dired, with the deletion flags still present in |
| @@ -176,6 +196,9 @@ be somewhat risky. | |||
| 176 | @section Flagging Many Files at Once | 196 | @section Flagging Many Files at Once |
| 177 | @cindex flagging many files for deletion (in Dired) | 197 | @cindex flagging many files for deletion (in Dired) |
| 178 | 198 | ||
| 199 | The @kbd{#}, @kbd{~}, @kbd{.}, @kbd{% &}, and @kbd{% d} commands | ||
| 200 | flag many files for deletion, based on their file names: | ||
| 201 | |||
| 179 | @table @kbd | 202 | @table @kbd |
| 180 | @item # | 203 | @item # |
| 181 | Flag all auto-save files (files whose names start and end with @samp{#}) | 204 | Flag all auto-save files (files whose names start and end with @samp{#}) |
| @@ -185,59 +208,43 @@ for deletion (@pxref{Auto Save}). | |||
| 185 | Flag all backup files (files whose names end with @samp{~}) for deletion | 208 | Flag all backup files (files whose names end with @samp{~}) for deletion |
| 186 | (@pxref{Backup}). | 209 | (@pxref{Backup}). |
| 187 | 210 | ||
| 188 | @item & | ||
| 189 | Flag for deletion all files with certain kinds of names which suggest | ||
| 190 | you could easily create those files again. | ||
| 191 | |||
| 192 | @item .@: @r{(Period)} | 211 | @item .@: @r{(Period)} |
| 193 | Flag excess numeric backup files for deletion. The oldest and newest | 212 | Flag excess numeric backup files for deletion. The oldest and newest |
| 194 | few backup files of any one file are exempt; the middle ones are | 213 | few backup files of any one file are exempt; the middle ones are |
| 195 | flagged. | 214 | flagged. |
| 196 | 215 | ||
| 216 | @item % & | ||
| 217 | Flag for deletion all files with certain kinds of names which suggest | ||
| 218 | you could easily create those files again. | ||
| 219 | |||
| 197 | @item % d @var{regexp} @key{RET} | 220 | @item % d @var{regexp} @key{RET} |
| 198 | Flag for deletion all files whose names match the regular expression | 221 | Flag for deletion all files whose names match the regular expression |
| 199 | @var{regexp}. | 222 | @var{regexp}. |
| 200 | @end table | 223 | @end table |
| 201 | 224 | ||
| 202 | The @kbd{#}, @kbd{~}, @kbd{&}, and @kbd{.} commands flag many files for | ||
| 203 | deletion, based on their file names. These commands are useful | ||
| 204 | precisely because they do not themselves delete any files; you can | ||
| 205 | remove the deletion flags from any flagged files that you really wish to | ||
| 206 | keep.@refill | ||
| 207 | |||
| 208 | @kindex & @r{(Dired)} | ||
| 209 | @findex dired-flag-garbage-files | ||
| 210 | @vindex dired-garbage-files-regexp | ||
| 211 | @cindex deleting some backup files | ||
| 212 | @kbd{&} (@code{dired-flag-garbage-files}) flags files whose names | ||
| 213 | match the regular expression specified by the variable | ||
| 214 | @code{dired-garbage-files-regexp}. By default, this matches certain | ||
| 215 | files produced by @TeX{}, @samp{.bak} files, and the @samp{.orig} and | ||
| 216 | @samp{.rej} files produced by @code{patch}. | ||
| 217 | |||
| 218 | @kindex # @r{(Dired)} | 225 | @kindex # @r{(Dired)} |
| 219 | @findex dired-flag-auto-save-files | 226 | @findex dired-flag-auto-save-files |
| 220 | @cindex deleting auto-save files | 227 | @cindex deleting auto-save files |
| 221 | @kbd{#} (@code{dired-flag-auto-save-files}) flags for deletion all | 228 | @kbd{#} (@code{dired-flag-auto-save-files}) flags all files whose |
| 222 | files whose names look like auto-save files---that is, files whose | 229 | names look like auto-save files---that is, files whose names begin and |
| 223 | names begin and end with @samp{#}. @xref{Auto Save}. | 230 | end with @samp{#}. @xref{Auto Save}. |
| 224 | 231 | ||
| 225 | @kindex ~ @r{(Dired)} | 232 | @kindex ~ @r{(Dired)} |
| 226 | @findex dired-flag-backup-files | 233 | @findex dired-flag-backup-files |
| 227 | @kbd{~} (@code{dired-flag-backup-files}) flags for deletion all | 234 | @kbd{~} (@code{dired-flag-backup-files}) flags all files whose names |
| 228 | files whose names say they are backup files---that is, files whose | 235 | say they are backup files---that is, files whose names end in |
| 229 | names end in @samp{~}. @xref{Backup}. | 236 | @samp{~}. @xref{Backup}. |
| 230 | 237 | ||
| 231 | @kindex . @r{(Dired)} | 238 | @kindex . @r{(Dired)} |
| 232 | @vindex dired-kept-versions | 239 | @vindex dired-kept-versions |
| 233 | @findex dired-clean-directory | 240 | @findex dired-clean-directory |
| 234 | @kbd{.} (period, @code{dired-clean-directory}) flags just some of the | 241 | @kbd{.} (period, @code{dired-clean-directory}) flags just some of |
| 235 | backup files for deletion: all but the oldest few and newest few backups | 242 | the backup files for deletion: all but the oldest few and newest few |
| 236 | of any one file. Normally @code{dired-kept-versions} (@strong{not} | 243 | backups of any one file. Normally, the number of newest versions kept |
| 237 | @code{kept-new-versions}; that applies only when saving) specifies the | 244 | for each file is given by the variable @code{dired-kept-versions} |
| 238 | number of newest versions of each file to keep, and | 245 | (@strong{not} @code{kept-new-versions}; that applies only when |
| 239 | @code{kept-old-versions} specifies the number of oldest versions to | 246 | saving). The number of oldest versions to keep is given by the |
| 240 | keep. | 247 | variable @code{kept-old-versions}. |
| 241 | 248 | ||
| 242 | Period with a positive numeric argument, as in @kbd{C-u 3 .}, | 249 | Period with a positive numeric argument, as in @kbd{C-u 3 .}, |
| 243 | specifies the number of newest versions to keep, overriding | 250 | specifies the number of newest versions to keep, overriding |
| @@ -245,14 +252,24 @@ specifies the number of newest versions to keep, overriding | |||
| 245 | @code{kept-old-versions}, using minus the value of the argument to | 252 | @code{kept-old-versions}, using minus the value of the argument to |
| 246 | specify the number of oldest versions of each file to keep. | 253 | specify the number of oldest versions of each file to keep. |
| 247 | 254 | ||
| 255 | @kindex % & @r{(Dired)} | ||
| 256 | @findex dired-flag-garbage-files | ||
| 257 | @vindex dired-garbage-files-regexp | ||
| 258 | @cindex deleting some backup files | ||
| 259 | @kbd{% &} (@code{dired-flag-garbage-files}) flags files whose names | ||
| 260 | match the regular expression specified by the variable | ||
| 261 | @code{dired-garbage-files-regexp}. By default, this matches certain | ||
| 262 | files produced by @TeX{}, @samp{.bak} files, and the @samp{.orig} and | ||
| 263 | @samp{.rej} files produced by @code{patch}. | ||
| 264 | |||
| 248 | @findex dired-flag-files-regexp | 265 | @findex dired-flag-files-regexp |
| 249 | @kindex % d @r{(Dired)} | 266 | @kindex % d @r{(Dired)} |
| 250 | The @kbd{% d} command flags all files whose names match a specified | 267 | @kbd{% d} flags all files whose names match a specified regular |
| 251 | regular expression (@code{dired-flag-files-regexp}). Only the | 268 | expression (@code{dired-flag-files-regexp}). Only the non-directory |
| 252 | non-directory part of the file name is used in matching. You can use | 269 | part of the file name is used in matching. You can use @samp{^} and |
| 253 | @samp{^} and @samp{$} to anchor matches. You can exclude certain | 270 | @samp{$} to anchor matches. You can exclude certain subdirectories |
| 254 | subdirectories from marking by hiding them while you use @kbd{% d}. | 271 | from marking by hiding them while you use @kbd{% d}. @xref{Hiding |
| 255 | @xref{Hiding Subdirectories}. | 272 | Subdirectories}. |
| 256 | 273 | ||
| 257 | @node Dired Visiting | 274 | @node Dired Visiting |
| 258 | @section Visiting Files in Dired | 275 | @section Visiting Files in Dired |
| @@ -328,7 +345,7 @@ for @file{..} and typing @kbd{f} there. | |||
| 328 | Instead of flagging a file with @samp{D}, you can @dfn{mark} the | 345 | Instead of flagging a file with @samp{D}, you can @dfn{mark} the |
| 329 | file with some other character (usually @samp{*}). Most Dired | 346 | file with some other character (usually @samp{*}). Most Dired |
| 330 | commands to operate on files use the files marked with @samp{*}. The | 347 | commands to operate on files use the files marked with @samp{*}. The |
| 331 | only command that operates on flagged files is @kbd{x}, which expunges | 348 | only command that operates on flagged files is @kbd{x}, which deletes |
| 332 | them. | 349 | them. |
| 333 | 350 | ||
| 334 | Here are some commands for marking with @samp{*}, for unmarking, and | 351 | Here are some commands for marking with @samp{*}, for unmarking, and |
| @@ -708,18 +725,25 @@ more matches. @xref{Tags Search}. | |||
| 708 | @kindex X @r{(Dired)} | 725 | @kindex X @r{(Dired)} |
| 709 | The Dired command @kbd{!} (@code{dired-do-shell-command}) reads a | 726 | The Dired command @kbd{!} (@code{dired-do-shell-command}) reads a |
| 710 | shell command string in the minibuffer and runs that shell command on | 727 | shell command string in the minibuffer and runs that shell command on |
| 711 | all the specified files. (@kbd{X} is a synonym for @kbd{!}.) You can | 728 | one or more files. The files that the shell command operates on are |
| 712 | specify the files to operate on in the usual ways for Dired commands | 729 | determined in the usual way for Dired commands (@pxref{Operating on |
| 713 | (@pxref{Operating on Files}). | 730 | Files}). The command @kbd{X} is a synonym for @kbd{!}. |
| 714 | 731 | ||
| 715 | The working directory for the shell command is the top-level directory | 732 | The command @kbd{&} (@code{dired-do-async-shell-command}) does the |
| 716 | of the Dired buffer. | 733 | same, except that it runs the shell command asynchronously. You can |
| 734 | also do this with @kbd{!}, by appending a @samp{&} character to the | ||
| 735 | end of the shell command. | ||
| 717 | 736 | ||
| 718 | There are two ways of applying a shell command to multiple files: | 737 | For both @kbd{!} and @kbd{&}, the working directory for the shell |
| 738 | command is the top-level directory of the Dired buffer. | ||
| 739 | |||
| 740 | If you tell @kbd{!} or @kbd{&} to operate on more than one file, the | ||
| 741 | shell command string determines how those files are passed to the | ||
| 742 | shell command: | ||
| 719 | 743 | ||
| 720 | @itemize @bullet | 744 | @itemize @bullet |
| 721 | @item | 745 | @item |
| 722 | If you use @samp{*} surrounded by whitespace in the shell command, | 746 | If you use @samp{*} surrounded by whitespace in the command string, |
| 723 | then the command runs just once, with the list of file names | 747 | then the command runs just once, with the list of file names |
| 724 | substituted for the @samp{*}. The order of file names is the order of | 748 | substituted for the @samp{*}. The order of file names is the order of |
| 725 | appearance in the Dired buffer. | 749 | appearance in the Dired buffer. |
| @@ -729,22 +753,21 @@ list of file names, putting them into one tar file @file{foo.tar}. | |||
| 729 | 753 | ||
| 730 | If you want to use @samp{*} as a shell wildcard with whitespace around | 754 | If you want to use @samp{*} as a shell wildcard with whitespace around |
| 731 | it, write @samp{*""}. In the shell, this is equivalent to @samp{*}; | 755 | it, write @samp{*""}. In the shell, this is equivalent to @samp{*}; |
| 732 | but since the @samp{*} is not surrounded by whitespace, Dired does | 756 | but since the @samp{*} is not surrounded by whitespace, Dired does not |
| 733 | not treat it specially. | 757 | treat it specially. |
| 734 | 758 | ||
| 735 | @item | 759 | @item |
| 736 | If the command string doesn't contain @samp{*} surrounded by | 760 | Otherwise, if the command string contains @samp{?} surrounded by |
| 737 | whitespace, then it runs once @emph{for each file}. Normally the file | 761 | whitespace, Emacs runs the shell command once @emph{for each file}, |
| 738 | name is added at the end. | 762 | substituting the current file name for @samp{?} each time. You can |
| 739 | 763 | use @samp{?} more than once in the command; the same file name | |
| 740 | For example, @kbd{! uudecode @key{RET}} runs @code{uudecode} on each | 764 | replaces each occurrence. |
| 741 | file. | ||
| 742 | 765 | ||
| 743 | @item | 766 | @item |
| 744 | However, if the command string contains @samp{?} surrounded by | 767 | If the command string contains neither @samp{*} nor @samp{?}, Emacs |
| 745 | whitespace, the current file name is substituted for @samp{?} (rather | 768 | runs the shell command once for each file, adding the file name is |
| 746 | than added at the end). You can use @samp{?} this way more than once | 769 | added at the end. For example, @kbd{! uudecode @key{RET}} runs |
| 747 | in the command, and the same file name replaces each occurrence. | 770 | @code{uudecode} on each file. |
| 748 | @end itemize | 771 | @end itemize |
| 749 | 772 | ||
| 750 | To iterate over the file names in a more complicated fashion, use an | 773 | To iterate over the file names in a more complicated fashion, use an |
| @@ -756,11 +779,13 @@ name: | |||
| 756 | for file in * ; do uuencode "$file" "$file" >"$file".uu; done | 779 | for file in * ; do uuencode "$file" "$file" >"$file".uu; done |
| 757 | @end example | 780 | @end example |
| 758 | 781 | ||
| 759 | The @kbd{!} command does not attempt to update the Dired buffer to | 782 | The @kbd{!} and @kbd{&} commands do not attempt to update the Dired |
| 760 | show new or modified files, because it doesn't understand shell | 783 | buffer to show new or modified files, because they don't know what |
| 761 | commands, and does not know what files the shell command changed. Use | 784 | files will be changed. Use the @kbd{g} command to update the Dired |
| 762 | the @kbd{g} command to update the Dired buffer (@pxref{Dired | 785 | buffer (@pxref{Dired Updating}). |
| 763 | Updating}). | 786 | |
| 787 | @xref{Single Shell}, for information about running shell commands | ||
| 788 | outside Dired. | ||
| 764 | 789 | ||
| 765 | @node Transforming File Names | 790 | @node Transforming File Names |
| 766 | @section Transforming File Names in Dired | 791 | @section Transforming File Names in Dired |
| @@ -925,9 +950,6 @@ subdirectory's contents. Use @kbd{C-u k} on the subdirectory header | |||
| 925 | line to delete the subdirectory (@pxref{Dired Updating}). You can also | 950 | line to delete the subdirectory (@pxref{Dired Updating}). You can also |
| 926 | hide and show inserted subdirectories (@pxref{Hiding Subdirectories}). | 951 | hide and show inserted subdirectories (@pxref{Hiding Subdirectories}). |
| 927 | 952 | ||
| 928 | |||
| 929 | |||
| 930 | |||
| 931 | @ifnottex | 953 | @ifnottex |
| 932 | @include dired-xtra.texi | 954 | @include dired-xtra.texi |
| 933 | @end ifnottex | 955 | @end ifnottex |
| @@ -1103,7 +1125,7 @@ indicates which way it is currently sorted---by name, or by date. | |||
| 1103 | @cindex @code{find} and Dired | 1125 | @cindex @code{find} and Dired |
| 1104 | 1126 | ||
| 1105 | You can select a set of files for display in a Dired buffer more | 1127 | You can select a set of files for display in a Dired buffer more |
| 1106 | flexibly by using the @code{find} utility to choose the files. | 1128 | flexibly by using the @command{find} utility to choose the files. |
| 1107 | 1129 | ||
| 1108 | @findex find-name-dired | 1130 | @findex find-name-dired |
| 1109 | To search for files with names matching a wildcard pattern use | 1131 | To search for files with names matching a wildcard pattern use |
| @@ -1117,21 +1139,22 @@ ordinary Dired commands are available. | |||
| 1117 | @findex find-grep-dired | 1139 | @findex find-grep-dired |
| 1118 | If you want to test the contents of files, rather than their names, | 1140 | If you want to test the contents of files, rather than their names, |
| 1119 | use @kbd{M-x find-grep-dired}. This command reads two minibuffer | 1141 | use @kbd{M-x find-grep-dired}. This command reads two minibuffer |
| 1120 | arguments, @var{directory} and @var{regexp}; it chooses all the files in | 1142 | arguments, @var{directory} and @var{regexp}; it chooses all the files |
| 1121 | @var{directory} or its subdirectories that contain a match for | 1143 | in @var{directory} or its subdirectories that contain a match for |
| 1122 | @var{regexp}. It works by running the programs @code{find} and | 1144 | @var{regexp}. It works by running the programs @command{find} and |
| 1123 | @code{grep}. See also @kbd{M-x grep-find}, in @ref{Grep Searching}. | 1145 | @command{grep}. See also @kbd{M-x grep-find}, in @ref{Grep |
| 1124 | Remember to write the regular expression for @code{grep}, not for Emacs. | 1146 | Searching}. Remember to write the regular expression for |
| 1125 | (An alternative method of showing files whose contents match a given | 1147 | @command{grep}, not for Emacs. (An alternative method of showing |
| 1126 | regexp is the @kbd{% g @var{regexp}} command, see @ref{Marks vs Flags}.) | 1148 | files whose contents match a given regexp is the @kbd{% g |
| 1149 | @var{regexp}} command, see @ref{Marks vs Flags}.) | ||
| 1127 | 1150 | ||
| 1128 | @findex find-dired | 1151 | @findex find-dired |
| 1129 | The most general command in this series is @kbd{M-x find-dired}, which | 1152 | The most general command in this series is @kbd{M-x find-dired}, |
| 1130 | lets you specify any condition that @code{find} can test. It takes two | 1153 | which lets you specify any condition that @command{find} can test. It |
| 1131 | minibuffer arguments, @var{directory} and @var{find-args}; it runs | 1154 | takes two minibuffer arguments, @var{directory} and @var{find-args}; |
| 1132 | @code{find} in @var{directory}, passing @var{find-args} to tell | 1155 | it runs @command{find} in @var{directory}, passing @var{find-args} to |
| 1133 | @code{find} what condition to test. To use this command, you need to | 1156 | tell @command{find} what condition to test. To use this command, you |
| 1134 | know how to use @code{find}. | 1157 | need to know how to use @command{find}. |
| 1135 | 1158 | ||
| 1136 | @vindex find-ls-option | 1159 | @vindex find-ls-option |
| 1137 | The format of listing produced by these commands is controlled by the | 1160 | The format of listing produced by these commands is controlled by the |
| @@ -1144,7 +1167,7 @@ may need to change the value of this variable. | |||
| 1144 | @cindex file database (locate) | 1167 | @cindex file database (locate) |
| 1145 | @vindex locate-command | 1168 | @vindex locate-command |
| 1146 | The command @kbd{M-x locate} provides a similar interface to the | 1169 | The command @kbd{M-x locate} provides a similar interface to the |
| 1147 | @code{locate} program. @kbd{M-x locate-with-filter} is similar, but | 1170 | @command{locate} program. @kbd{M-x locate-with-filter} is similar, but |
| 1148 | keeps only files whose names match a given regular expression. | 1171 | keeps only files whose names match a given regular expression. |
| 1149 | 1172 | ||
| 1150 | These buffers don't work entirely like ordinary Dired buffers: file | 1173 | These buffers don't work entirely like ordinary Dired buffers: file |
| @@ -1159,9 +1182,9 @@ and erases all flags and marks. | |||
| 1159 | @findex wdired-change-to-wdired-mode | 1182 | @findex wdired-change-to-wdired-mode |
| 1160 | Wdired is a special mode that allows you to perform file operations | 1183 | Wdired is a special mode that allows you to perform file operations |
| 1161 | by editing the Dired buffer directly (the ``W'' in ``Wdired'' stands | 1184 | by editing the Dired buffer directly (the ``W'' in ``Wdired'' stands |
| 1162 | for ``writable.'') To enter Wdired mode, type @kbd{C-x C-q} or @kbd{M-x | 1185 | for ``writable.'') To enter Wdired mode, type @kbd{C-x C-q} |
| 1163 | wdired-change-to-wdired-mode} while in a Dired buffer. Alternatively, | 1186 | (@code{dired-toggle-read-only}) while in a Dired buffer. |
| 1164 | use @samp{Edit File Names} in the @samp{Immediate} menu bar menu. | 1187 | Alternatively, use the @samp{Immediate / Edit File Names} menu item. |
| 1165 | 1188 | ||
| 1166 | @findex wdired-finish-edit | 1189 | @findex wdired-finish-edit |
| 1167 | While in Wdired mode, you can rename files by editing the file names | 1190 | While in Wdired mode, you can rename files by editing the file names |
| @@ -1262,16 +1285,27 @@ rotation is lossless, and uses an external utility called JpegTRAN. | |||
| 1262 | 1285 | ||
| 1263 | @kindex + @r{(Dired)} | 1286 | @kindex + @r{(Dired)} |
| 1264 | @findex dired-create-directory | 1287 | @findex dired-create-directory |
| 1265 | An unusual Dired file-operation command is @kbd{+} | 1288 | The command @kbd{+} (@code{dired-create-directory}) reads a |
| 1266 | (@code{dired-create-directory}). This command reads a directory name, | 1289 | directory name, and creates the directory if it does not already |
| 1267 | and creates the directory if it does not already exist. | 1290 | exist. |
| 1291 | |||
| 1292 | @cindex searching multiple files via Dired | ||
| 1293 | The command @kbd{M-s a C-s} (@code{dired-do-isearch}) begins a | ||
| 1294 | ``multi-file'' incremental search on the marked files. If a search | ||
| 1295 | fails at the end of a file, typing @kbd{C-s} advances to the next | ||
| 1296 | marked file and repeats the search; at the end of the last marked | ||
| 1297 | file, the search wraps around to the first marked file. The command | ||
| 1298 | @kbd{M-s a M-C-s} (@code{dired-do-isearch-regexp}) does the same with | ||
| 1299 | a regular expression search. @xref{Repeat Isearch}, for information | ||
| 1300 | about search repetition. | ||
| 1268 | 1301 | ||
| 1269 | @cindex Adding to the kill ring in Dired. | 1302 | @cindex Adding to the kill ring in Dired. |
| 1270 | @kindex w @r{(Dired)} | 1303 | @kindex w @r{(Dired)} |
| 1271 | @findex dired-copy-filename-as-kill | 1304 | @findex dired-copy-filename-as-kill |
| 1272 | The @kbd{w} command (@code{dired-copy-filename-as-kill}) puts the | 1305 | The command @kbd{w} (@code{dired-copy-filename-as-kill}) puts the |
| 1273 | names of the marked (or next @var{n}) files into the kill ring, as if | 1306 | names of the marked (or next @var{n}) files into the kill ring, as if |
| 1274 | you had killed them with @kbd{C-w}. The names are separated by a space. | 1307 | you had killed them with @kbd{C-w}. The names are separated by a |
| 1308 | space. | ||
| 1275 | 1309 | ||
| 1276 | With a zero prefix argument, this uses the absolute file name of | 1310 | With a zero prefix argument, this uses the absolute file name of |
| 1277 | each marked file. With just @kbd{C-u} as the prefix argument, it uses | 1311 | each marked file. With just @kbd{C-u} as the prefix argument, it uses |