aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2006-03-31 17:35:51 +0000
committerRichard M. Stallman2006-03-31 17:35:51 +0000
commite01a5bb586fab71ec1403339c40e7b3b53815e5e (patch)
tree32d55c5000cfb23e960041948919d90cc6018c6b
parentdc5d7d59d682962f3a591614d496071d9fc803f3 (diff)
downloademacs-e01a5bb586fab71ec1403339c40e7b3b53815e5e.tar.gz
emacs-e01a5bb586fab71ec1403339c40e7b3b53815e5e.zip
Many cleanups.
(Dired Deletion): Describe dired-recursive-deletes. (Operating on Files): dired-create-directory moved. (Misc Dired Features): Moved to here. (Tumme): Node moved to misc.texi.
-rw-r--r--man/dired.texi410
1 files changed, 174 insertions, 236 deletions
diff --git a/man/dired.texi b/man/dired.texi
index 13bd5115f1f..5face67a7b3 100644
--- a/man/dired.texi
+++ b/man/dired.texi
@@ -13,11 +13,12 @@ Emacs commands to move around in this buffer, and special Dired commands
13to operate on the files listed. 13to operate on the files listed.
14 14
15 The Dired buffer is ``read-only,'' and inserting text in it is not 15 The Dired buffer is ``read-only,'' and inserting text in it is not
16useful, so ordinary printing characters such as @kbd{d} and @kbd{x} are 16useful, so ordinary printing characters such as @kbd{d} and @kbd{x}
17used for special Dired commands. Some Dired commands @dfn{mark} or 17are redefined for special Dired commands. Some Dired commands
18@dfn{flag} the @dfn{current file} (that is, the file on the current 18@dfn{mark} or @dfn{flag} the @dfn{current file} (that is, the file on
19line); other commands operate on the marked files or on the flagged 19the current line); other commands operate on the marked files or on
20files. 20the flagged files. You first mark certain files in order to operate
21on all of them with on command.
21 22
22 The Dired-X package provides various extra features for Dired mode. 23 The Dired-X package provides various extra features for Dired mode.
23@xref{Top, Dired-X,,dired-x, Dired Extra Version 2 User's Manual}. 24@xref{Top, Dired-X,,dired-x, Dired Extra Version 2 User's Manual}.
@@ -40,8 +41,6 @@ files.
40* Updating: Dired Updating. Discarding lines for files of no interest. 41* Updating: Dired Updating. Discarding lines for files of no interest.
41* Find: Dired and Find. Using `find' to choose the files for Dired. 42* Find: Dired and Find. Using `find' to choose the files for Dired.
42* Wdired:: Operating on files by editing the Dired buffer. 43* Wdired:: Operating on files by editing the Dired buffer.
43* Tumme:: Image file and thumbnail viewing and
44 manipulation from the Dired buffer.
45* Misc: Misc Dired Features. Various other features. 44* Misc: Misc Dired Features. Various other features.
46@end menu 45@end menu
47 46
@@ -53,18 +52,20 @@ files.
53@vindex dired-listing-switches 52@vindex dired-listing-switches
54 To invoke Dired, do @kbd{C-x d} or @kbd{M-x dired}. The command 53 To invoke Dired, do @kbd{C-x d} or @kbd{M-x dired}. The command
55reads a directory name or wildcard file name pattern as a minibuffer 54reads a directory name or wildcard file name pattern as a minibuffer
56argument to specify which files to list. @kbd{C-x C-f} given a 55argument to specify the files to list. @kbd{C-x C-f} given a
57directory name also invokes Dired. Where @code{dired} differs from 56directory name also invokes Dired. Where @code{dired} differs from
58@code{list-directory} is that it puts the buffer into Dired mode, so 57@code{list-directory} is that it puts the buffer into Dired mode, so
59that the special commands of Dired are available. 58that the special commands of Dired are available.
60 59
61 The variable @code{dired-listing-switches} specifies the options to 60 The variable @code{dired-listing-switches} specifies the options to
62give to @code{ls} for listing the directory; this string @emph{must} contain 61give to @code{ls} for listing the directory; this string @emph{must}
63@samp{-l}. If you use a numeric prefix argument with the @code{dired} 62contain @samp{-l}. If you use a numeric prefix argument with the
64command, you can specify the @code{ls} switches with the minibuffer 63@code{dired} command, you can specify the @code{ls} switches with the
65before you enter the directory specification. No matter how they are 64minibuffer before you enter the directory specification. No matter
66specified, the @code{ls} switches should all be short options (that 65how they are specified, the @code{ls} switches can include short
67is, single characters) requiring no arguments. 66options (that is, single characters) requiring no arguments, and long
67options (starting with @samp{--}) whose arguments are specified with
68@samp{=}.
68 69
69@findex dired-other-window 70@findex dired-other-window
70@kindex C-x 4 d 71@kindex C-x 4 d
@@ -81,10 +82,9 @@ separate frame to display the Dired buffer.
81@kindex C-n @r{(Dired)} 82@kindex C-n @r{(Dired)}
82@kindex C-p @r{(Dired)} 83@kindex C-p @r{(Dired)}
83 All the usual Emacs cursor motion commands are available in Dired 84 All the usual Emacs cursor motion commands are available in Dired
84buffers. Some special-purpose cursor motion commands are also 85buffers. The keys @kbd{C-n} and @kbd{C-p} are redefined to put the
85provided. The keys @kbd{C-n} and @kbd{C-p} are redefined to put the 86cursor at the beginning of the file name on the line, rather than at
86cursor at the beginning of the file name on the line, rather than at the 87the beginning of the line.
87beginning of the line.
88 88
89@kindex SPC @r{(Dired)} 89@kindex SPC @r{(Dired)}
90 For extra convenience, @key{SPC} and @kbd{n} in Dired are equivalent 90 For extra convenience, @key{SPC} and @kbd{n} in Dired are equivalent
@@ -121,42 +121,47 @@ Delete the files that are flagged for deletion.
121 121
122@kindex d @r{(Dired)} 122@kindex d @r{(Dired)}
123@findex dired-flag-file-deletion 123@findex dired-flag-file-deletion
124 You can flag a file for deletion by moving to the line describing the 124 You can flag a file for deletion by moving to the line describing
125file and typing @kbd{d} (@code{dired-flag-file-deletion}). The deletion flag is visible as a @samp{D} at 125the file and typing @kbd{d} (@code{dired-flag-file-deletion}). The
126the beginning of the line. This command moves point to the next line, 126deletion flag is visible as a @samp{D} at the beginning of the line.
127so that repeated @kbd{d} commands flag successive files. A numeric 127This command moves point to the next line, so that repeated @kbd{d}
128argument serves as a repeat count. 128commands flag successive files. A numeric argument serves as a repeat
129 129count.
130@cindex recursive deletion
131@vindex dired-recursive-deletes
132 The variable @code{dired-recursive-deletes} controls whether the
133delete command will delete non-empty directories (including their
134contents). The default is to delete only empty directories.
135 130
136@kindex u @r{(Dired deletion)} 131@kindex u @r{(Dired deletion)}
137@kindex DEL @r{(Dired)} 132@kindex DEL @r{(Dired)}
138 The files are flagged for deletion rather than deleted immediately to 133 The reason for flagging files for deletion, rather than deleting
139reduce the danger of deleting a file accidentally. Until you direct 134files immediately, is to reduce the danger of deleting a file
140Dired to delete the flagged files, you can remove deletion flags using 135accidentally. Until you direct Dired to delete the flagged files, you
141the commands @kbd{u} and @key{DEL}. @kbd{u} (@code{dired-unmark}) works 136can remove deletion flags using the commands @kbd{u} and @key{DEL}.
142just like @kbd{d}, but removes flags rather than making flags. 137@kbd{u} (@code{dired-unmark}) works just like @kbd{d}, but removes
143@key{DEL} (@code{dired-unmark-backward}) moves upward, removing flags; 138flags rather than making flags. @key{DEL}
144it is like @kbd{u} with argument @minus{}1. 139(@code{dired-unmark-backward}) moves upward, removing flags; it is
140like @kbd{u} with argument @minus{}1.
145 141
146@kindex x @r{(Dired)} 142@kindex x @r{(Dired)}
147@findex dired-do-flagged-delete 143@findex dired-do-flagged-delete
148@cindex expunging (Dired) 144@cindex expunging (Dired)
149 To delete the flagged files, type @kbd{x} (@code{dired-do-flagged-delete}). 145 To delete the flagged files, type @kbd{x}
150(This is also known as @dfn{expunging}.) 146(@code{dired-do-flagged-delete}). (This is also known as
151This command first displays a list of all the file names flagged for 147@dfn{expunging}.) This command first displays a list of all the file
152deletion, and requests confirmation with @kbd{yes}. If you confirm, 148names flagged for deletion, and requests confirmation with @kbd{yes}.
153Dired deletes the flagged files, then deletes their lines from the text 149If you confirm, Dired deletes the flagged files, then deletes their
154of the Dired buffer. The shortened Dired buffer remains selected. 150lines from the text of the Dired buffer. The Dired buffer, with
151somewhat fewer lines, remains selected.
155 152
156 If you answer @kbd{no} or quit with @kbd{C-g} when asked to confirm, you 153 If you answer @kbd{no} or quit with @kbd{C-g} when asked to confirm, you
157return immediately to Dired, with the deletion flags still present in 154return immediately to Dired, with the deletion flags still present in
158the buffer, and no files actually deleted. 155the buffer, and no files actually deleted.
159 156
157@cindex recursive deletion
158@vindex dired-recursive-deletes
159 You can delete empty directories just like other files, but normally
160Dired cannot delete directories that are nonempty. If the variable
161@code{dired-recursive-deletes} is non-@code{nil}, then Dired can
162delete nonempty directories including all their contents. That can
163be somewhat risky.
164
160@node Flagging Many Files 165@node Flagging Many Files
161@section Flagging Many Files at Once 166@section Flagging Many Files at Once
162@cindex flagging many files for deletion (in Dired) 167@cindex flagging many files for deletion (in Dired)
@@ -171,8 +176,8 @@ Flag all backup files (files whose names end with @samp{~}) for deletion
171(@pxref{Backup}). 176(@pxref{Backup}).
172 177
173@item & 178@item &
174Flag for deletion all files with certain kinds of names, names that 179Flag for deletion all files with certain kinds of names which suggest
175suggest you could easily create the files again. 180you could easily create those files again.
176 181
177@item .@: @r{(Period)} 182@item .@: @r{(Period)}
178Flag excess numeric backup files for deletion. The oldest and newest 183Flag excess numeric backup files for deletion. The oldest and newest
@@ -204,14 +209,14 @@ files produced by @TeX{}, @samp{.bak} files, and the @samp{.orig} and
204@findex dired-flag-auto-save-files 209@findex dired-flag-auto-save-files
205@cindex deleting auto-save files 210@cindex deleting auto-save files
206 @kbd{#} (@code{dired-flag-auto-save-files}) flags for deletion all 211 @kbd{#} (@code{dired-flag-auto-save-files}) flags for deletion all
207files whose names look like auto-save files (@pxref{Auto Save})---that 212files whose names look like auto-save files---that is, files whose
208is, files whose names begin and end with @samp{#}. 213names begin and end with @samp{#}. @xref{Auto Save}.
209 214
210@kindex ~ @r{(Dired)} 215@kindex ~ @r{(Dired)}
211@findex dired-flag-backup-files 216@findex dired-flag-backup-files
212 @kbd{~} (@code{dired-flag-backup-files}) flags for deletion all files 217 @kbd{~} (@code{dired-flag-backup-files}) flags for deletion all
213whose names say they are backup files (@pxref{Backup})---that is, files 218files whose names say they are backup files---that is, files whose
214whose names end in @samp{~}. 219names end in @samp{~}. @xref{Backup}.
215 220
216@kindex . @r{(Dired)} 221@kindex . @r{(Dired)}
217@vindex dired-kept-versions 222@vindex dired-kept-versions
@@ -235,8 +240,9 @@ specify the number of oldest versions of each file to keep.
235 The @kbd{% d} command flags all files whose names match a specified 240 The @kbd{% d} command flags all files whose names match a specified
236regular expression (@code{dired-flag-files-regexp}). Only the 241regular expression (@code{dired-flag-files-regexp}). Only the
237non-directory part of the file name is used in matching. You can use 242non-directory part of the file name is used in matching. You can use
238@samp{^} and @samp{$} to anchor matches. You can exclude subdirectories 243@samp{^} and @samp{$} to anchor matches. You can exclude certain
239by hiding them (@pxref{Hiding Subdirectories}). 244subdirectories from marking by hiding them while you use @kbd{% d}.
245@xref{Hiding Subdirectories}.
240 246
241@node Dired Visiting 247@node Dired Visiting
242@section Visiting Files in Dired 248@section Visiting Files in Dired
@@ -301,8 +307,8 @@ Ops, View File, Miscellaneous File Operations}.
301@kindex ^ @r{(Dired)} 307@kindex ^ @r{(Dired)}
302@findex dired-up-directory 308@findex dired-up-directory
303Visit the parent directory of the current directory 309Visit the parent directory of the current directory
304(@code{dired-up-directory}). This is more convenient than moving to 310(@code{dired-up-directory}). This is equivalent to moving to the line
305the parent directory's line and typing @kbd{f} there. 311for @file{..} and typing @kbd{f} there.
306@end table 312@end table
307 313
308@node Marks vs Flags 314@node Marks vs Flags
@@ -311,12 +317,13 @@ the parent directory's line and typing @kbd{f} there.
311@cindex marking many files (in Dired) 317@cindex marking many files (in Dired)
312 Instead of flagging a file with @samp{D}, you can @dfn{mark} the 318 Instead of flagging a file with @samp{D}, you can @dfn{mark} the
313file with some other character (usually @samp{*}). Most Dired 319file with some other character (usually @samp{*}). Most Dired
314commands to operate on files use the files marked with @samp{*}, the 320commands to operate on files use the files marked with @samp{*}. The
315exception being @kbd{x} which deletes the flagged files. 321only command that operates on flagged flies is @kbd{x}, which expunges
322them.
316 323
317 Here are some commands for marking with @samp{*}, or for unmarking or 324 Here are some commands for marking with @samp{*}, for unmarking, and
318operating on marks. (@xref{Dired Deletion}, for commands to flag and 325for operating on marks. (@xref{Dired Deletion}, for commands to flag
319unflag files.) 326and unflag files.)
320 327
321@table @kbd 328@table @kbd
322@item m 329@item m
@@ -348,7 +355,7 @@ With a numeric argument, unmark all those files.
348@kindex * / @r{(Dired)} 355@kindex * / @r{(Dired)}
349@findex dired-mark-directories 356@findex dired-mark-directories
350@cindex marking subdirectories (in Dired) 357@cindex marking subdirectories (in Dired)
351Mark with @samp{*} all files which are actually directories, except for 358Mark with @samp{*} all files which are directories, except for
352@file{.} and @file{..} (@code{dired-mark-directories}). With a numeric 359@file{.} and @file{..} (@code{dired-mark-directories}). With a numeric
353argument, unmark all those files. 360argument, unmark all those files.
354 361
@@ -455,11 +462,12 @@ This assumes that no files were already marked with @samp{t}.
455Mark (with @samp{*}) all files whose names match the regular expression 462Mark (with @samp{*}) all files whose names match the regular expression
456@var{regexp} (@code{dired-mark-files-regexp}). This command is like 463@var{regexp} (@code{dired-mark-files-regexp}). This command is like
457@kbd{% d}, except that it marks files with @samp{*} instead of flagging 464@kbd{% d}, except that it marks files with @samp{*} instead of flagging
458with @samp{D}. @xref{Flagging Many Files}. 465with @samp{D}.
459 466
460Only the non-directory part of the file name is used in matching. Use 467Only the non-directory part of the file name is used in matching. Use
461@samp{^} and @samp{$} to anchor matches. Exclude subdirectories by 468@samp{^} and @samp{$} to anchor matches. You can exclude
462hiding them (@pxref{Hiding Subdirectories}). 469subdirectories by temporarily hiding them (@pxref{Hiding
470Subdirectories}).
463 471
464@item % g @var{regexp} @key{RET} 472@item % g @var{regexp} @key{RET}
465@findex dired-mark-files-containing-regexp 473@findex dired-mark-files-containing-regexp
@@ -471,16 +479,21 @@ the regular expression @var{regexp}
471@kbd{% m}, except that it searches the file contents instead of the file 479@kbd{% m}, except that it searches the file contents instead of the file
472name. 480name.
473 481
474@item C-_ 482@item C-x u
483@itemx C-_
484@itemx C-/
475@kindex C-_ @r{(Dired)} 485@kindex C-_ @r{(Dired)}
476@findex dired-undo 486@findex dired-undo
477Undo changes in the Dired buffer, such as adding or removing 487Undo changes in the Dired buffer, such as adding or removing
478marks (@code{dired-undo}). @emph{This command does not revert the 488marks (@code{dired-undo}). @emph{This command does not revert the
479actual file operations, nor recover lost files!} It just undoes 489actual file operations, nor recover lost files!} It just undoes
480changes in the buffer itself. For example, if used after renaming one 490changes in the buffer itself.
481or more files, @code{dired-undo} restores the original names, which 491
482will get the Dired buffer out of sync with the actual contents of the 492In some cases, using this after commands that operate on files can
483directory. 493cause trouble. For example, after renaming one or more files,
494@code{dired-undo} restores the original names in the Dired buffer,
495which gets the Dired buffer out of sync with the actual contents of
496the directory.
484@end table 497@end table
485 498
486@node Operating on Files 499@node Operating on Files
@@ -490,8 +503,8 @@ directory.
490 This section describes the basic Dired commands to operate on one file 503 This section describes the basic Dired commands to operate on one file
491or several files. All of these commands are capital letters; all of 504or several files. All of these commands are capital letters; all of
492them use the minibuffer, either to read an argument or to ask for 505them use the minibuffer, either to read an argument or to ask for
493confirmation, before they act. All of them give you several ways to 506confirmation, before they act. All of them let you specify the
494specify which files to manipulate: 507files to manipulate in these ways:
495 508
496@itemize @bullet 509@itemize @bullet
497@item 510@item
@@ -508,6 +521,10 @@ on all those files.
508Otherwise, the command operates on the current file only. 521Otherwise, the command operates on the current file only.
509@end itemize 522@end itemize
510 523
524@noindent
525Certain other Dired commands, such as @kbd{!} and the @samp{%}
526commands, use the same conventions to decide which files to work on.
527
511@vindex dired-dwim-target 528@vindex dired-dwim-target
512@cindex two directories (in Dired) 529@cindex two directories (in Dired)
513 Commands which ask for a destination directory, such as those which 530 Commands which ask for a destination directory, such as those which
@@ -517,9 +534,7 @@ buffer's default directory, but if the variable @code{dired-dwim-target}
517is non-@code{nil}, and if there is another Dired buffer displayed in the 534is non-@code{nil}, and if there is another Dired buffer displayed in the
518next window, that other buffer's directory is suggested instead. 535next window, that other buffer's directory is suggested instead.
519 536
520 Here are the file-manipulating commands that operate on files in this 537 Here are the file-manipulating Dired commands that operate on files.
521way. (Some other Dired commands, such as @kbd{!} and the @samp{%}
522commands, also use these conventions to decide which files to work on.)
523 538
524@table @kbd 539@table @kbd
525@findex dired-do-copy 540@findex dired-do-copy
@@ -531,15 +546,15 @@ is the directory to copy into, or (if copying a single file) the new
531name. 546name.
532 547
533@vindex dired-copy-preserve-time 548@vindex dired-copy-preserve-time
534If @code{dired-copy-preserve-time} is non-@code{nil}, then copying with 549If @code{dired-copy-preserve-time} is non-@code{nil}, then copying
535this command sets the modification time of the new file to be the same 550with this command preserves the modification time of the old file in
536as that of the old file. 551the copy.
537 552
538@vindex dired-recursive-copies 553@vindex dired-recursive-copies
539@cindex recursive copying 554@cindex recursive copying
540The variable @code{dired-recursive-copies} controls whether 555The variable @code{dired-recursive-copies} controls whether to copy
541directories are copied recursively. The default is to not copy 556directories recursively. The default is @code{nil}, which means that
542recursively, which means that directories cannot be copied. 557directories cannot be copied.
543 558
544@item D 559@item D
545@findex dired-do-delete 560@findex dired-do-delete
@@ -608,7 +623,8 @@ different places).
608@kindex T @r{(Dired)} 623@kindex T @r{(Dired)}
609@cindex changing file time (in Dired) 624@cindex changing file time (in Dired)
610@item T @var{timestamp} @key{RET} 625@item T @var{timestamp} @key{RET}
611Change the time of the specified files (@code{dired-do-touch}). 626Touch the specified files (@code{dired-do-touch}). This means
627updating their modification times to the present time.
612 628
613@findex dired-do-print 629@findex dired-do-print
614@kindex P @r{(Dired)} 630@kindex P @r{(Dired)}
@@ -625,7 +641,7 @@ suitable guess made using the variables @code{lpr-command} and
625@cindex compressing files (in Dired) 641@cindex compressing files (in Dired)
626@item Z 642@item Z
627Compress the specified files (@code{dired-do-compress}). If the file 643Compress the specified files (@code{dired-do-compress}). If the file
628appears to be a compressed file already, it is uncompressed instead. 644appears to be a compressed file already, uncompress it instead.
629 645
630@findex dired-do-load 646@findex dired-do-load
631@kindex L @r{(Dired)} 647@kindex L @r{(Dired)}
@@ -666,12 +682,6 @@ query replace loop, you can use @kbd{M-,} to resume the scan and replace
666more matches. @xref{Tags Search}. 682more matches. @xref{Tags Search}.
667@end table 683@end table
668 684
669@kindex + @r{(Dired)}
670@findex dired-create-directory
671 One special file-operation command is @kbd{+}
672(@code{dired-create-directory}). This command reads a directory name and
673creates the directory if it does not already exist.
674
675@node Shell Commands in Dired 685@node Shell Commands in Dired
676@section Shell Commands in Dired 686@section Shell Commands in Dired
677@cindex shell commands, Dired 687@cindex shell commands, Dired
@@ -679,12 +689,16 @@ creates the directory if it does not already exist.
679@findex dired-do-shell-command 689@findex dired-do-shell-command
680@kindex ! @r{(Dired)} 690@kindex ! @r{(Dired)}
681@kindex X @r{(Dired)} 691@kindex X @r{(Dired)}
682The Dired command @kbd{!} (@code{dired-do-shell-command}) reads a shell 692The Dired command @kbd{!} (@code{dired-do-shell-command}) reads a
683command string in the minibuffer and runs that shell command on all the 693shell command string in the minibuffer and runs that shell command on
684specified files. @kbd{X} is a synonym for @kbd{!}. You can specify the 694all the specified files. (@kbd{X} is a synonym for @kbd{!}.) You can
685files to operate on in the usual ways for Dired commands 695specify the files to operate on in the usual ways for Dired commands
686(@pxref{Operating on Files}). There are two ways of applying a shell 696(@pxref{Operating on Files}).
687command to multiple files: 697
698 The working directory for the shell command is the top-level directory
699of the Dired buffer.
700
701 There are two ways of applying a shell command to multiple files:
688 702
689@itemize @bullet 703@itemize @bullet
690@item 704@item
@@ -711,12 +725,12 @@ file.
711 725
712@item 726@item
713However, if the command string contains @samp{?} surrounded by 727However, if the command string contains @samp{?} surrounded by
714whitespace, the current file name is substituted for @samp{?} (rather 728whitespace, the current file name is substituted for @samp{?} (rather
715than added at the end). You can use @samp{?} this way more than once 729than added at the end). You can use @samp{?} this way more than once
716in the command, and the same file name replaces each occurrence. 730in the command, and the same file name replaces each occurrence.
717@end itemize 731@end itemize
718 732
719To iterate over the file names in a more complicated fashion, use an 733 To iterate over the file names in a more complicated fashion, use an
720explicit shell loop. For example, here is how to uuencode each file, 734explicit shell loop. For example, here is how to uuencode each file,
721making the output file name by appending @samp{.uu} to the input file 735making the output file name by appending @samp{.uu} to the input file
722name: 736name:
@@ -725,11 +739,8 @@ name:
725for file in * ; do uuencode "$file" "$file" >"$file".uu; done 739for file in * ; do uuencode "$file" "$file" >"$file".uu; done
726@end example 740@end example
727 741
728The working directory for the shell command is the top-level directory 742 The @kbd{!} command does not attempt to update the Dired buffer to
729of the Dired buffer. 743show new or modified files, because it doesn't understand shell
730
731The @kbd{!} command does not attempt to update the Dired buffer to show
732new or modified files, because it doesn't really understand shell
733commands, and does not know what files the shell command changed. Use 744commands, and does not know what files the shell command changed. Use
734the @kbd{g} command to update the Dired buffer (@pxref{Dired 745the @kbd{g} command to update the Dired buffer (@pxref{Dired
735Updating}). 746Updating}).
@@ -738,7 +749,8 @@ Updating}).
738@section Transforming File Names in Dired 749@section Transforming File Names in Dired
739 750
740 This section describes Dired commands which alter file names in a 751 This section describes Dired commands which alter file names in a
741systematic way. 752systematic way. Each command operates on some or all of the marked
753files, using a new name made by transforming the existing name.
742 754
743 Like the basic Dired file-manipulation commands (@pxref{Operating on 755 Like the basic Dired file-manipulation commands (@pxref{Operating on
744Files}), the commands described here operate either on the next 756Files}), the commands described here operate either on the next
@@ -750,7 +762,7 @@ Flags}.)
750@emph{interactively}: they ask you to confirm the operation for each 762@emph{interactively}: they ask you to confirm the operation for each
751candidate file. Thus, you can select more files than you actually 763candidate file. Thus, you can select more files than you actually
752need to operate on (e.g., with a regexp that matches many files), and 764need to operate on (e.g., with a regexp that matches many files), and
753then refine the selection by typing @kbd{y} or @kbd{n} when the 765then filter the selected names by typing @kbd{y} or @kbd{n} when the
754command prompts for confirmation. 766command prompts for confirmation.
755 767
756@table @kbd 768@table @kbd
@@ -787,17 +799,16 @@ in each case computing the new name by regular-expression substitution
787from the name of the old file. 799from the name of the old file.
788@end table 800@end table
789 801
790 The four regular-expression substitution commands effectively perform 802 The four regular-expression substitution commands effectively
791a search-and-replace on the selected file names in the Dired buffer. 803perform a search-and-replace on the selected file names. They read
792They read two arguments: a regular expression @var{from}, and a 804two arguments: a regular expression @var{from}, and a substitution
793substitution pattern @var{to}. 805pattern @var{to}; they match each ``old'' file name against
794 806@var{from}, and then replace the matching part with @var{to}. You can
795 The commands match each ``old'' file name against the regular 807use @samp{\&} and @samp{\@var{digit}} in @var{to} to refer to all or
796expression @var{from}, and then replace the matching part with @var{to}. 808part of what the pattern matched in the old file name, as in
797You can use @samp{\&} and @samp{\@var{digit}} in @var{to} to refer to 809@code{replace-regexp} (@pxref{Regexp Replace}). If the regular
798all or part of what the pattern matched in the old file name, as in 810expression matches more than once in a file name, only the first match
799@code{replace-regexp} (@pxref{Regexp Replace}). If the regular expression 811is replaced.
800matches more than once in a file name, only the first match is replaced.
801 812
802 For example, @kbd{% R ^.*$ @key{RET} x-\& @key{RET}} renames each 813 For example, @kbd{% R ^.*$ @key{RET} x-\& @key{RET}} renames each
803selected file by prepending @samp{x-} to its name. The inverse of this, 814selected file by prepending @samp{x-} to its name. The inverse of this,
@@ -809,15 +820,16 @@ matches that should span the whole filename.)
809 Normally, the replacement process does not consider the files' 820 Normally, the replacement process does not consider the files'
810directory names; it operates on the file name within the directory. If 821directory names; it operates on the file name within the directory. If
811you specify a numeric argument of zero, then replacement affects the 822you specify a numeric argument of zero, then replacement affects the
812entire absolute file name including directory name. (Non-zero 823entire absolute file name including directory name. (A non-zero
813argument specifies the number of files to operate on.) 824argument specifies the number of files to operate on.)
814 825
815 Often you will want to select the set of files to operate on using the 826 You may want to select the set of files to operate on using the same
816same @var{regexp} that you will use to operate on them. To do this, 827regexp @var{from} that you will use to operate on them. To do this,
817mark those files with @kbd{% m @var{regexp} @key{RET}}, then use the 828mark those files with @kbd{% m @var{from} @key{RET}}, then use the
818same regular expression in the command to operate on the files. To make 829same regular expression in the command to operate on the files. To
819this easier, the @kbd{%} commands to operate on files use the last 830make this more convenient, the @kbd{%} commands to operate on files
820regular expression specified in any @kbd{%} command as a default. 831use the last regular expression specified in any @kbd{%} command as a
832default.
821 833
822@node Comparison in Dired 834@node Comparison in Dired
823@section File Comparison with Dired 835@section File Comparison with Dired
@@ -825,19 +837,20 @@ regular expression specified in any @kbd{%} command as a default.
825@cindex compare files (in Dired) 837@cindex compare files (in Dired)
826 838
827 Here are two Dired commands that compare specified files using 839 Here are two Dired commands that compare specified files using
828@code{diff}. 840@code{diff}. They show the output in a buffer using Diff mode
841(@pxref{Comparing Files}).
829 842
830@table @kbd 843@table @kbd
831@item = 844@item =
832@findex dired-diff 845@findex dired-diff
833@kindex = @r{(Dired)} 846@kindex = @r{(Dired)}
834Compare the current file (the file at point) with another file (the file 847Compare the current file (the file at point) with another file (the
835at the mark) using the @code{diff} program (@code{dired-diff}). The 848file at the mark) using the @code{diff} program (@code{dired-diff}).
836file at the mark is the first argument of @code{diff}, and the file at 849The file at the mark is the first argument of @code{diff}, and the
837point is the second argument. Use @kbd{C-@key{SPC}} 850file at point is the second argument. This refers to the ordinary
851Emacs mark, not Dired marks; use @kbd{C-@key{SPC}}
838(@code{set-mark-command}) to set the mark at the first file's line 852(@code{set-mark-command}) to set the mark at the first file's line
839(@pxref{Setting Mark}), since @code{dired-diff} ignores the files marked 853(@pxref{Setting Mark}).
840with the Dired's @kbd{m} command.
841 854
842@findex dired-backup-diff 855@findex dired-backup-diff
843@kindex M-= @r{(Dired)} 856@kindex M-= @r{(Dired)}
@@ -845,7 +858,7 @@ with the Dired's @kbd{m} command.
845Compare the current file with its latest backup file 858Compare the current file with its latest backup file
846(@code{dired-backup-diff}). If the current file is itself a backup, 859(@code{dired-backup-diff}). If the current file is itself a backup,
847compare it with the file it is a backup of; this way, you can compare 860compare it with the file it is a backup of; this way, you can compare
848a file with any backup version of your choice. 861a file with any one of its backups.
849 862
850The backup file is the first file given to @code{diff}. 863The backup file is the first file given to @code{diff}.
851@end table 864@end table
@@ -864,9 +877,8 @@ numeric argument when you run Dired, then you can specify these options
864in the minibuffer.) That produces a recursive directory listing showing 877in the minibuffer.) That produces a recursive directory listing showing
865all subdirectories at all levels. 878all subdirectories at all levels.
866 879
867 But usually all the subdirectories are too many; usually you will 880 More often, you will want to show only specific subdirectories. You
868prefer to include specific subdirectories only. You can do this with 881can do this with the @kbd{i} command:
869the @kbd{i} command:
870 882
871@table @kbd 883@table @kbd
872@findex dired-maybe-insert-subdir 884@findex dired-maybe-insert-subdir
@@ -950,7 +962,7 @@ Move down to the next directory-file line (@code{dired-prev-dirline}).
950 962
951@cindex hiding in Dired (Dired) 963@cindex hiding in Dired (Dired)
952 @dfn{Hiding} a subdirectory means to make it invisible, except for its 964 @dfn{Hiding} a subdirectory means to make it invisible, except for its
953header line, via selective display (@pxref{Selective Display}). 965header line.
954 966
955@table @kbd 967@table @kbd
956@item $ 968@item $
@@ -974,7 +986,8 @@ subdirectories far away.
974subdirectory. For example, the commands to operate on marked files 986subdirectory. For example, the commands to operate on marked files
975ignore files in hidden directories even if they are marked. Thus you 987ignore files in hidden directories even if they are marked. Thus you
976can use hiding to temporarily exclude subdirectories from operations 988can use hiding to temporarily exclude subdirectories from operations
977without having to remove the markers. 989without having to remove the Dired marks on files in those
990subdirectories.
978 991
979@node Dired Updating 992@node Dired Updating
980@section Updating the Dired Buffer 993@section Updating the Dired Buffer
@@ -990,7 +1003,8 @@ part of the Dired buffer.
990Update the entire contents of the Dired buffer (@code{revert-buffer}). 1003Update the entire contents of the Dired buffer (@code{revert-buffer}).
991 1004
992@item l 1005@item l
993Update the specified files (@code{dired-do-redisplay}). 1006Update the specified files (@code{dired-do-redisplay}). You specify the
1007files for @kbd{l} in the same way as for file operations.
994 1008
995@item k 1009@item k
996Delete the specified @emph{file lines}---not the files, just the lines 1010Delete the specified @emph{file lines}---not the files, just the lines
@@ -1034,9 +1048,9 @@ current file as a last resort.
1034 1048
1035 If you use @kbd{k} with a numeric prefix argument to kill the line 1049 If you use @kbd{k} with a numeric prefix argument to kill the line
1036for a file that is a directory, which you have inserted in the Dired 1050for a file that is a directory, which you have inserted in the Dired
1037buffer as a subdirectory, then this deletes that subdirectory from the 1051buffer as a subdirectory, it deletes that subdirectory from the buffer
1038buffer as well. Typing @kbd{C-u k} on the header line for a subdirectory 1052as well. Typing @kbd{C-u k} on the header line for a subdirectory
1039is another way to delete a subdirectory from the Dired buffer. 1053also deletes the subdirectory from the Dired buffer.
1040 1054
1041 The @kbd{g} command brings back any individual lines that you have 1055 The @kbd{g} command brings back any individual lines that you have
1042killed in this way, but not subdirectories---you must use @kbd{i} to 1056killed in this way, but not subdirectories---you must use @kbd{i} to
@@ -1068,7 +1082,7 @@ flexibly by using the @code{find} utility to choose the files.
1068@var{pattern}, and chooses all the files in @var{directory} or its 1082@var{pattern}, and chooses all the files in @var{directory} or its
1069subdirectories whose individual names match @var{pattern}. 1083subdirectories whose individual names match @var{pattern}.
1070 1084
1071 The files thus chosen are displayed in a Dired buffer in which the 1085 The files thus chosen are displayed in a Dired buffer, in which the
1072ordinary Dired commands are available. 1086ordinary Dired commands are available.
1073 1087
1074@findex find-grep-dired 1088@findex find-grep-dired
@@ -1101,10 +1115,10 @@ may need to change the value of this variable.
1101@cindex file database (locate) 1115@cindex file database (locate)
1102@vindex locate-command 1116@vindex locate-command
1103 @kbd{M-x locate} provides a similar interface to the @code{locate} 1117 @kbd{M-x locate} provides a similar interface to the @code{locate}
1104program. @kbd{M-x locate-with-filter} is similar, but keeps only lines 1118program. @kbd{M-x locate-with-filter} is similar, but keeps only files
1105matching a given regular expression. 1119whose names match a given regular expression.
1106 1120
1107 These buffers don't work entirely like ordinary Dired buffers. File 1121 These buffers don't work entirely like ordinary Dired buffers: file
1108operations work, but do not always automatically update the buffer. 1122operations work, but do not always automatically update the buffer.
1109Reverting the buffer with @kbd{g} deletes all inserted subdirectories, 1123Reverting the buffer with @kbd{g} deletes all inserted subdirectories,
1110and erases all flags and marks. 1124and erases all flags and marks.
@@ -1131,104 +1145,26 @@ back to ordinary Dired mode.
1131 Apart from simply renaming files, you can move a file to another 1145 Apart from simply renaming files, you can move a file to another
1132directory by typing in the new file name (either absolute or 1146directory by typing in the new file name (either absolute or
1133relative). To mark a file for deletion, delete the entire filename. 1147relative). To mark a file for deletion, delete the entire filename.
1134To change the target of a symbolic link, just edit the target name 1148To change the target of a symbolic link, edit the link target name
1135displayed next to the link name. 1149which appears next to the link name.
1136 1150
1137 The rest of the text in the buffer, such as the file sizes and 1151 The rest of the text in the buffer, such as the file sizes and
1138modification dates, is marked read-only, so you can't edit it. 1152modification dates, is marked read-only, so you can't edit it.
1139However, if you set @code{wdired-allow-to-change-permissions} to 1153However, if you set @code{wdired-allow-to-change-permissions} to
1140@code{t}, the file permission bits can also be edited. For example, 1154@code{t}, you can edit the file permissions. For example, you can
1141you can change @samp{-rw-r--r--} to @samp{-rw-rw-rw-} to make a file 1155change @samp{-rw-r--r--} to @samp{-rw-rw-rw-} to make a file
1142world-writable. These changes also take effect when you type @kbd{C-c 1156world-writable. These changes also take effect when you type @kbd{C-c
1143C-c}. 1157C-c}.
1144 1158
1145@node Tumme
1146@section Thumbnail and image file viewing and manipulation
1147
1148@cindex tumme mode
1149
1150 Tumme provides for simple viewing of thumbnails of image files. It
1151provides viewing of the original file, sized or in full size, inside
1152Emacs or in an external viewer.
1153
1154 Tumme aims to be both easy to use for a beginner but also powerful
1155and useful to an experienced user.
1156
1157 The quickest way to try out Tumme is to use the command
1158@code{tumme}. It will prompt for a directory where there are images
1159files. All images in that directory will get thumbnail files created
1160for them, and the thumbnails will be displayed in the ``thumbnail
1161buffer''.
1162
1163 If the directory contains many image files and becayse thumbnails
1164are created on the fly before they can be displayed, the above command
1165might take a long time, especially the first time (consecutive
1166viewings will use the cached thumbnail files). Also, if the number of
1167image files is higher than @code{tumme-show-all-from-dir-max-files},
1168the command will be aborted. To work around this you can instead mark
1169the files you want to look at, using @kbd{m} as usual in Dired, and
1170then type @kbd{C-t d} (@code{tumme-display-thumbs}).
1171
1172 Regardless of which command you chose to display the thumbnails, a
1173new buffer will open up, displaying thumbnail images of the files that
1174were marked in dired. The new buffer will be the active one.
1175
1176 With point in the thumbnail buffer, type @kbd{RET}
1177(@code{tumme-display-thumbnail-original-image}) to display a sized
1178version of it in another window. The image will be sized to fit the
1179window. Use the arrow keys to move around in the buffer. For easy
1180browing, type @kbd{SPC} (@code{tumme-display-next-thumbnail-original})
1181to advance and display the next image. Typing @kbd{DEL}
1182(@code{tumme-display-previous-thumbnail-original}) backs up to the
1183previous thumbnail and displays that instead.
1184
1185 If you want to see the image in its original size, either provide a
1186prefix argument (@kbd{C-u}) before pressing @kbd{RET}, or type
1187@kbd{C-return} (@code{tumme-thumbnail-display-external}) to display
1188the image in an external viewer. To use the latter,
1189@code{tumme-external-viewer} must be configured.
1190
1191 If you find in image that you want to delete, type @kbd{d}
1192(@code{tumme-flag-thumb-original-file}) and the file will be flagged
1193for deletion in the dired buffer. If you just want visually to delete
1194the thumbnail image from the thumbnail buffer, type @kbd{C-d}
1195(@code{tumme-delete-char}).
1196
1197 More advanced features include commands for using ``tags''. ``Tag''
1198is just another word for ``keyword'', ``label'' or ``category''. In
1199short, it is meta data used to categorize an image file. Commands
1200exist to add tags for one or many image files from dired, to mark
1201files having a certain tag in Dired and to remove tags from files.
1202The tags put on image files are stored in a database file (currently a
1203plain text file).
1204
1205 To tag image files, mark them in the dired buffer and type @kbd{C-t
1206t} (@code{tumme-tag-files}). You will be prompted for a tag. To mark
1207files having a certain tag, type @kbd{C-t f}
1208(@code{tumme-mark-tagged-files}). After marking image files with a
1209certain tag, they can be viewed as explained earlier, by typing
1210@key{C-t d}.
1211
1212 You can also tag a file from the thumbnail buffer by typing @kbd{t
1213t} and remove it by typing @kbd{t r}. There is also a special ``tag''
1214called ``comment'' for each file (it is not a tag in the exact same
1215sense as the other tags, it is handled slightly different). That is
1216used to enter a comment or description about the image. You comment a
1217file from the thumbnail buffer by typing @kbd{c}. You will be
1218prompted for a comment. Comments can also be added from Dired, and
1219then also to multiple files at once, by typing @kbd{C-t c}
1220(@code{tumme-dired-comment-files}).
1221
1222 Tumme also provides simple image manipulation commands, like
1223rotating thumbnails and original image files. In the thumbnail
1224buffer, type @kbd{L} to rotate the original image 90 degrees anti
1225clockwise, and @kbd{R} to rotate it 90 degrees clockwise. This
1226rotation will be done lossless (the image quality will not be reduced)
1227and needs an external utility called JpegTRAN to work.
1228
1229@node Misc Dired Features 1159@node Misc Dired Features
1230@section Other Dired Features 1160@section Other Dired Features
1231 1161
1162@kindex + @r{(Dired)}
1163@findex dired-create-directory
1164 An unusual Dired file-operation command is @kbd{+}
1165(@code{dired-create-directory}). This command reads a directory name,
1166and creates the directory if it does not already exist.
1167
1232@cindex Adding to the kill ring in Dired. 1168@cindex Adding to the kill ring in Dired.
1233@kindex w @r{(Dired)} 1169@kindex w @r{(Dired)}
1234@findex dired-copy-filename-as-kill 1170@findex dired-copy-filename-as-kill
@@ -1236,16 +1172,18 @@ and needs an external utility called JpegTRAN to work.
1236names of the marked (or next @var{n}) files into the kill ring, as if 1172names of the marked (or next @var{n}) files into the kill ring, as if
1237you had killed them with @kbd{C-w}. The names are separated by a space. 1173you had killed them with @kbd{C-w}. The names are separated by a space.
1238 1174
1175 With a zero prefix argument, this uses the absolute file name of
1176each marked file. With just @kbd{C-u} as the prefix argument, it uses
1177file names relative to the Dired buffer's default directory. (This
1178can still contain slashes if in a subdirectory.) As a special case,
1179if point is on a directory headerline, @kbd{w} gives you the absolute
1180name of that directory. Any prefix argument or marked files are
1181ignored in this case.
1182
1239 The main purpose of this command is so that you can yank the file 1183 The main purpose of this command is so that you can yank the file
1240names into arguments for other Emacs commands. It also displays what 1184names into arguments for other Emacs commands. It also displays what
1241was pushed onto the kill ring, so you can use it to display the list 1185it added to the kill ring, so you can use it to display the list of
1242of currently marked files in the echo area. With a zero prefix 1186currently marked files in the echo area.
1243argument, this uses the absolute file name of each marked file. With
1244just @kbd{C-u} as the prefix argument, it uses file names relative to
1245the Dired buffer's default directory. (This can still contain slashes
1246if in a subdirectory.) As a special case, if point is on a directory
1247headerline, @kbd{w} gives you the absolute name of that directory.
1248Any prefix argument or marked files are ignored in this case.
1249 1187
1250@findex dired-compare-directories 1188@findex dired-compare-directories
1251 The command @kbd{M-x dired-compare-directories} is used to compare 1189 The command @kbd{M-x dired-compare-directories} is used to compare