annotate man/dired.texi @ 72:b9518feda344 r20-0b31

Import from CVS: tag r20-0b31
author cvs
date Mon, 13 Aug 2007 09:03:46 +0200
parents ac2d302a0011
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 \input texinfo @c -*-texinfo-*-
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 @comment !Date: 1993/12/21 22:31:56 ! !Revision: 1.1 !
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 @comment %**start of header (This is for running Texinfo on a region.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 @setfilename ../info/dired.info
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 @settitle Tree Dired Version 6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 @c @setchapternewpage odd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 @comment %**end of header (This is for running Texinfo on a region.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 @iftex
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 @finalout
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 @end iftex
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 @ifinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 This file documents Tree Dired, the GNU Emacs Directory Browser, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 most of the extra features available as an option.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 Copyright (C) 1991, 1992 Free Software Foundation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 Permission is granted to make and distribute verbatim copies of this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 manual provided the copyright notice and this permission notice are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 preserved on all copies.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 @ignore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 Permission is granted to process this file through TeX and print the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 results, provided the printed document carries copying permission notice
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 identical to this one except for the removal of this paragraph (this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 paragraph not being relevant to the printed manual).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 @end ignore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 Permission is granted to copy and distribute modified versions of this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 manual under the conditions for verbatim copying, provided also that the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 section entitled ``GNU General Public License'' is included exactly as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 in the original, and provided that the entire resulting derived work is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 distributed under the terms of a permission notice identical to this one.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 Permission is granted to copy and distribute translations of this manual
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 into another language, under the above conditions for modified versions,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 except that the section entitled ``GNU General Public License'' may be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 included in a translation approved by the author instead of in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 original English.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 @end ifinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 @titlepage
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 @sp 6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 @center @titlefont{Tree Dired}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 @sp 2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 @center @titlefont{The GNU Emacs}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 @sp 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 @center @titlefont{Directory Editor}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 @sp 4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 @c @@center !Date: 1993/12/21 22:31:56 !
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 @sp 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 @c @@center !Revision: 1.1 !
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 @sp 5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 @center Sebastian Kremer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 @center sk@@thp.uni-koeln.de
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 @page
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 !Date: 1993/12/21 22:31:56 !
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 !Revision: 1.1 !
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 @vskip 0pt plus 1filll
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 Copyright @copyright{} 1991, 1992 Free Software Foundation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 Permission is granted to make and distribute verbatim copies of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 this manual provided the copyright notice and this permission notice
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 are preserved on all copies.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 @ignore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 Permission is granted to process this file through TeX and print the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 results, provided the printed document carries copying permission notice
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 identical to this one except for the removal of this paragraph (this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 paragraph not being relevant to the printed manual).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 @end ignore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 Permission is granted to copy and distribute modified versions of this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 manual under the conditions for verbatim copying, provided also that the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 section entitled ``GNU General Public License'' is included exactly as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 in the original, and provided that the entire resulting derived work is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 distributed under the terms of a permission notice identical to this one.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 Permission is granted to copy and distribute translations of this manual
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 into another language, under the above conditions for modified versions,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 except that the section entitled ``GNU General Public License'' may be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 included in a translation approved by the author instead of in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 original English.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 @end titlepage
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 @ifinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 @node Top, Dired, (dir), (dir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 This file documents Tree Dired (version 6), the GNU Emacs Directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 Editor, including the optional ``Dired Extra'' features.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 Tree Dired is an enhanced version of the Classic (18.xx Emacs) Dired and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 will be the Dired of Emacs 19. It is known to work with Emacs 18.55 and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 18.57 (and probably most earlier versions).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 @c and also with prerelease versions of Emacs 19, but I don't write that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 @c since I don't want to be bombarded with questions like `when it will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 @c be ready'...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 Revision of this manual:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 !Id: dired.texinfo,v 1.1 1993/12/21 22:31:56 jwz Exp !
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 Report bugs to:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 Sebastian Kremer <sk@@thp.uni-koeln.de>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 * Dired:: Dired, the Directory Editor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 * Tree Dired Extra:: Tree Dired Extra features
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 * Dired Internals:: Dired Internals
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 * Dired Known Problems:: Known Problems with Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 --- Indices ---
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 * Dired Variable Index::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 * Dired Function Index::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 * Dired Key Index::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 * Dired Concept Index::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 --- The Detailed Node Listing ---
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 Dired, the Directory Editor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 * Entering Dired::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 * Editing in Dired::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 * Listing Files in Dired::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 * Marking Files in Dired::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 * Mark-using Commands::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 * Commands That Do Not Use Marks::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 * Subdirectories in Dired::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 * Hiding Directories in Dired::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 * Acknowledgement::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 * Dired Customization::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 Mark-using Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 * Copy and Move Into a Directory::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 * Renaming and More With Regexps::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 * Other File Creating Commands::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 * Deleting Files With Dired::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 * Dired Shell Commands::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 * Compressing and Uncompressing::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 * Changing File Attributes::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 * Loading and Byte-compiling Emacs Lisp Files::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 * Printing the Marked Files::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 Dired Customization
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 * Dired User Options::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 * Dired Configuration::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 * Dired Hooks::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 Tree Dired Extra features
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 * Tree Dired Extra Features::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 * Dired Minibuffer History::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 * Inserting All Marked Subdirectories::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 * Dynamic Dired Markers::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 * Omitting Files in Dired::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 * Advanced Dired Mark Commands::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 * Virtual Dired::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 * Multiple Dired Directories::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 * Dired Local Variables::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 * Making Relative Symbolic Links in Dired::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 * Letting Dired Guess What Shell Command to Apply::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 * dired-trns.el:: Filename Transformers for Dired Shell Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 * dired-cd.el:: Changing the Working Directory for Dired Shell Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 * dired-nstd.el:: Nested Dired format
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 * find-dired.el:: Feeding Find Output to Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 Dired Internals
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 * Tree Dired Internals::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 * Dired Mark Internals::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 @end ifinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 @node Dired, Tree Dired Extra, Top, Top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 @chapter Dired, the Directory Editor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 @cindex Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 @cindex Deletion (of files)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 Dired makes it easy to delete or visit many of the files in a single
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 directory (and possibly its subdirectories) at once. It makes an Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 buffer containing a listing of the directories, in the format of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 @code{ls -lR}. You can use the normal Emacs commands to move around in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 this buffer, and special Dired commands to operate on the files. You
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 can run shell commands on files, visit, compress, load or byte-compile
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 them, change their file attributes and insert subdirectories into the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 same buffer. You can ``mark'' files for later commands or ``flag'' them
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 for deletion, either file by file or all files matching certain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 criteria.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 * Entering Dired::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 * Editing in Dired::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 * Listing Files in Dired::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 * Marking Files in Dired::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 * Mark-using Commands::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 * Commands That Do Not Use Marks::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 * Subdirectories in Dired::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 * Hiding Directories in Dired::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 * Acknowledgement::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 * Dired Customization::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 @node Entering Dired, Editing in Dired, Dired, Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 @section Entering Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 @findex Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 @kindex C-x d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 @vindex dired-listing-switches
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 To invoke Dired, do @kbd{C-x d} or @kbd{M-x dired}. The command reads a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 directory name or wildcard file name pattern as a minibuffer argument
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 just like the @code{list-directory} command, @kbd{C-x C-d}. Invoking
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 Dired with a prefix argument lets you enter the listing switches for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 directory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 Dired assumes you meant to use a wildcard if the last component of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 name is not an existing file. Note that only the last pathname
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 component may contain wildcards. With wildcards it uses the shell to do
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 the filename globbing, whereas usually it calls @samp{ls} directly.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 Because of this, you might have to quote characters that are special to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 the shell. For example, to dired all auto-save files in your
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 @file{~/mail/} directory, use @samp{~/mail/\#*} as argument to Dired.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 Note the backslash needed to quote @samp{#} (at the beginning of a word)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 to the shell.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 Where @code{dired} differs from @code{list-directory} is in naming the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 buffer after the directory name or the wildcard pattern used for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 listing, and putting the buffer into Dired mode so that the special
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 commands of Dired are available in it. The variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 @code{dired-listing-switches} is a string used as an argument to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 @code{ls} in making the directory; this string @i{must} contain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 @samp{-l}. Most other switches are also allowed, especially @samp{-F},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 @samp{-i} and @samp{-s}. For the @samp{-F} switch to work you may have
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 to set the variable @code{dired-ls-F-marks-symlinks}, depending on what
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 kind of @samp{ls} program you are using.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 @xref{Dired Configuration}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 @refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 When a Dired buffer for the given directory already exists, it is simply
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 selected without refreshing it. You can type @kbd{g} if you suspect it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 is out of date.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 @findex dired-other-window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 @kindex C-x 4 d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 To display the Dired buffer in another window rather than in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 selected window, use @kbd{C-x 4 d} (@code{dired-other-window)} instead
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 of @kbd{C-x d}.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 @node Editing in Dired, Listing Files in Dired, Entering Dired, Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 @section Editing in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 Once the Dired buffer exists, you can switch freely between it and other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 Emacs buffers. Whenever the Dired buffer is selected, certain special
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 commands are provided that operate on files that are listed. The Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 buffer is ``read-only'', and inserting text in it is not useful, so
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 ordinary printing characters such as @kbd{d} and @kbd{x} are used for Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 commands, and digits are prefix arguments.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 @cindex Current file (in Dired)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 The file described by the line that point is on is called the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 @dfn{current file}. The directory this file is in is the @dfn{current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 Dired directory}. Note that there may be several directories in one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 Dired buffer as long as they belong to the same tree. The top level
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 directory, the @dfn{root} of the tree, is used as the working directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 of the buffer.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 Some or all directories can be @dfn{hidden}, leaving only their
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 headerlines visible, and exlcuding their files from Dired operations.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 @cindex Marking files (in Dired)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 Files can be @dfn{marked} for later commands. Marking means putting a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 special character, usually @samp{*}, in the first column of the file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 line. To @dfn{flag} a file means to mark it for later deletion. This
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 special case of ``marking'' is distinguished so that you do not delete
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 files accidentally. Internally, the only difference between marking and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 flagging is the character used to mark the file: @samp{*} (an asterisk)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 for a marked file, and @samp{D} for files flagged for deletion.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 @cindex Mark-using commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 Most Dired commands operate on the ``marked'' files and default to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 current file. They are the @dfn{mark-using} commands. Deleting is the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 only mark-using command that does not default to the current file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 Dired buffers ``know'' about each other. For example, copying from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 @var{dir1} into @var{dir2} will update @var{dir2}'s Dired buffer(s).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 When you move files or directories, file and dired buffers are kept up
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 to date and refer to the new location. But Dired only knows about files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 changed by itself, not by other parts of Emacs or programs outside
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 All the usual Emacs cursor motion commands are available in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 buffers. Some special purpose commands are also provided. The keys
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 @kbd{C-n} and @kbd{C-p} are redefined so that they try to position the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 cursor at the beginning of the filename on the line, rather than at the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 beginning of the line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 For extra convenience, @key{SPC} and @kbd{n} in Dired are equivalent to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 @kbd{C-n}. @kbd{p} is equivalent to @kbd{C-p}. Moving by lines is also
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 done so often in Dired that it deserves to be easy to type. @key{DEL}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 (move up and unflag) is often useful simply for moving up.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 @node Listing Files in Dired, Marking Files in Dired, Editing in Dired, Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 @section Listing Files in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 @cindex Headerline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 @cindex Non-file line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 @cindex File line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 Initially the Dired buffer shows the directory you selected. The first
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 line shows the full directory name. It is an example of a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 @dfn{headerline} of a directory. Note that it is terminated by a colon
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 (@samp{:}) that is not part of the directory name. The second line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 usually displays the total size of all files in the directory or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 the wildcard used. Both are examples of @dfn{non-file lines}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 Applying a command to a non-file line signals an error. The other lines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 of the directory, called the @dfn{file lines}, show information about
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 each file such as permission bits, size and date of last modification,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 and the name of the file.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 For example, the listing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 /home/sk/lib/emacs/lisp:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 total 4973
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 -rw-r--r-- 1 sk users 231608 Feb 6 16:58 ChangeLog
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 drwxr-sr-x 2 sk users 2048 Feb 6 11:07 RCS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 -r--r--r-- 1 sk users 141389 Feb 6 10:45 dired.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 -r--r--r-- 1 sk users 113033 Feb 5 16:21 dired.texi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 @dots{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 /home/sk/lib/emacs/lisp/RCS:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 total 4798
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 -r--r--r-- 1 sk users 231748 Feb 6 16:59 dired.texi,v
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 -r--r--r-- 1 sk users 763898 Feb 6 10:45 dired.el,v
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 @dots{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 has a headerline for the @file{lisp} directory, a total line saying
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 there are 4973 K in all the files of that directory (your @samp{ls}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 program may use units of blocks instead), and several file lines. After
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 that, a headerline for the @file{RCS} subdirectory with its total line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 and its files follows.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 Here is an example of a wildcard listing:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 /home/sk/lib/emacs/lisp:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 wildcard dired*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 -rw-r--r-- 1 sk users 113036 Feb 6 16:59 dired.texi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 -r--r--r-- 1 sk users 81267 Feb 6 16:29 dired.elc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 -r--r--r-- 1 sk users 38436 Feb 6 16:28 dired-x.elc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 -r--r--r-- 1 sk users 60258 Feb 6 16:27 dired-x.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 -r--r--r-- 1 sk users 141389 Feb 6 10:45 dired.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 @dots{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 Since @samp{ls} does not provide a total count when called with a wildcard
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 argument, the second line now gives instead the wildcard used, here
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 @samp{dired*}. If there would have been a directory matching the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 wildcard, e.g. a @samp{dired/} subdirectory, its file line would be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 shown, but it would not have been expanded automatically.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 Filenames may have embedded and trailing (but not leading) spaces.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 Leading spaces are not recognized because different @samp{ls} programs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 differ in the amount of whitespace the insert before the filename.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 Filenames may @emph{not} contain newlines or @samp{^M}'s. You can get
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 away with @samp{^M}'s in filenames if you do
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 (setq selective-display nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 in the Dired buffer (inside @code{dired-mode-hook}, @xref{Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 Hooks}.). But this also disables the @kbd{=} and @kbd{$} hiding
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 commands, @xref{Hiding Directories in Dired}.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 Other unprintable characters than @samp{^M} or newline (@samp{^J}) in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 filenames are no problem for Dired. But your @samp{ls} program may not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 output them correctly (e.g., replacing all unprintable characters with a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 question mark @samp{?}). Dired can do nothing if @samp{ls} suppresses
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 information about the filenames. But some (System V derived) @samp{ls}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 programs have a @samp{-b} switch to quote control characters, e.g.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 @samp{\n} for a newline character, or @samp{\007} for a ASCII bell
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 character (@kbd{C-g}), so you might want to add @samp{b} to your
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 switches (see below). Dired translates the quoted control character
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 escapes when a @samp{-b} switch was used. The @samp{-b} switch is the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 recommended method to cope with funny filenames containing newlines or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 leading spaces. But check if your @samp{ls} understands @samp{-b} and really
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 quotes newlines and spaces. Dired is known to work with GNU @samp{ls
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 -b}, but other @samp{ls -b} don't quote spaces, so leading spaces still
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 don't work with these @samp{ls} programs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 @refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 The appearance of the listing is determined by the listing switches
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 used, for example whether you display or suppress @samp{.} files with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 the @samp{-a} and @samp{-A} switches, use the @samp{-F} switch to tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 filenames etc. It may additionally be restricted to certain files if you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 used wildcards to display only those files matching a shell file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 wildcard.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 @cindex Dired listing switches
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 Dired has commands that change the listing switches for this buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 They are mainly used to set the sort mode, but can also be used to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 change other formatting options. The buffer is automatically refreshed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 after the switches are changed to let the new format take effect.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 The default value for the switches comes from the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 @code{dired-listing-switches}; a prefix argument to @code{dired} can be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 use to determine the switches used for a specific buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 @xref{Entering Dired}. Each Dired buffer has its own value for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 switches, stored in the variable @code{dired-actual-switches}.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 @vindex dired-actual-switches
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 @vindex dired-sort-by-name-regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 @vindex dired-sort-by-date-regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 The Dired modeline displays @samp{by name} or @samp{by date} to indicate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 the sort mode. It uses the regexps in the variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 @code{dired-sort-by-date-regexp} and @code{dired-sort-by-name-regexp} to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 decide what should be displayed. If neither of the regexps matches, the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 listing switches are displayed literally. You can use this to always
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 display the literal switches instead of @samp{by name} or @samp{by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 date}: set them to a regexp that never matches any listing switches, for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 example @samp{^$}.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 @vindex dired-ls-sorting-switches
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 Most @samp{ls} programs can only sort by name (without @samp{-t}) or by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 date (with @samp{-t}), nothing else. GNU @samp{ls} additionally sorts
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 on size with @samp{-S}, on extension with @samp{-X}, and unsorted (in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 directory order) with @samp{-U}. So anything that does not contain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 these is sort "by name". However, this is configurable in the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 @code{dired-ls-sorting-switches}, which defaults to @code{"SXU"}. It
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 contains a string of @samp{ls} switches (single letters) except @samp{t} that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 influence sorting. It is consulted at load time, so if you redefine it,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 you must do it before Dired is loaded.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 @item s
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 @kindex s
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 @findex dired-sort-toggle-or-edit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 (@code{dired-sort-toggle-or-edit}) Toggle between sort by name/date and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 refresh the dired buffer. With a prefix argument you can edit the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 current listing switches instead.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 @cindex Refreshing a Dired listing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 After some time the listing may become out of date because of actions by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 other programs than Dired. You can refresh the complete Dired buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 from disk or only refresh the lines of certain files or a single file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 @item l
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 @kindex l
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 @findex dired-do-redisplay
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 (@code{dired-do-redisplay}) Redisplay all marked (or, with a prefix
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 argument, the next @var{N}) files. As always, if no files are marked,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 the current file is used.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 If on a headerline, redisplay that subdirectory. In that case,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 a prefix arg lets you edit the @samp{ls} switches used for the new listing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 @kindex g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 @findex revert-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 @item g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 (@code{revert-buffer}) The @kbd{g} command in Dired ultimately runs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 @code{dired-revert} to reinitialize the buffer from the actual disk
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 directory (or directories). All marks and flags in the Dired buffer are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 restored, except of course for files that have vanished. Hidden
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 subdirectories are hidden again. @xref{Hiding Directories in Dired}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 @refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 @item k
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 @kindex k
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 @findex dired-kill-line-or-subdir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 (@code{dired-kill-line-or-subdir}) Kill this line (but not this file).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 Optional prefix argument is a repeat factor.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 If file is displayed as expanded subdirectory, kill that as well.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 If on a subdirectory line, kill that subdirectory. Reinsert it with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 @kbd{i} (@code{dired-maybe-insert-subdir}), @xref{Subdirectories in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 Dired}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 Killing a file line means that the line is removed from the Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 buffer. The file is not touched, and the line will reappear when the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 buffer is refreshed (using @kbd{g}, @code{revert-buffer}). A killed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 subdirectory will not reappear after reverting the buffer, since @kbd{g}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 only list those subdirectories that were listed before.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 @item M-k
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 @kindex M-k
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 @findex dired-do-kill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 (@code{dired-do-kill}) Kill all marked lines (not files). With a prefix
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 argument, kill all lines not marked or flagged.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 (For file marking, @xref{Marking Files in Dired}.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 @item C-x u
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 @kindex C-x u
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 @item C-_
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 @kindex C-_
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 @findex dired-undo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 (@code{dired-undo}) Undo in a Dired buffer. This doesn't recover lost
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 files, it is just normal undo with a temporarily writable buffer. You
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 can use it to recover marks, killed lines or subdirs. In the latter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 case, you have to do @kbd{M-x dired-build-subdir-alist} to parse the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 buffer again for the new subdirectory list.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 @node Marking Files in Dired, Mark-using Commands, Listing Files in Dired, Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 @section Marking Files in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 This section describes commands to mark and unmark single files, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 commands to mark several files at once if they match certain criteria.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 There also is a command to move to the next marked file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 As always, hidden subdirs are not affected. @xref{Hiding Directories in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 Dired}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 @item m
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 @kindex m
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 @findex dired-mark-subdir-or-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 (@code{dired-mark-subdir-or-file}) If on a file line, mark the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 file. A numeric argument tells how many next or previous files to mark.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 If on a subdirectory header line, mark all its files except `.' and `..'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 @item u
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 @kindex u
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 @findex dired-unmark-subdir-or-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 (@code{dired-unmark-subdir-or-file}) Like @kbd{m}, only unmarking
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 instead of marking.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 @item DEL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 @kindex DEL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 @findex dired-backup-unflag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 (@code{dired-backup-unflag}) Move up lines and remove flags there.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 Optional prefix argument says how many lines to unflag; default is one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568 @item M-DEL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 @kindex M-DEL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 @findex dired-unflag-all-files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 (@code{dired-unflag-all-files}) Remove a specific or all flags from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 every file. With an argument, queries for each marked file. Type your
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 help character, usually
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574 @kbd{C-h}, at that time for help.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 @item *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 @kindex *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 @findex dired-mark-executables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 (@code{dired-mark-executables}) Mark all executable files. With prefix
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 argument, unflag all those files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 @item @@
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 @kindex @@
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 @findex dired-mark-symlinks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 (@code{dired-mark-symlinks}) Mark all symbolic links. With prefix
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 argument, unflag all those files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 @item /
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 @kindex /
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 @findex dired-mark-directories
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 (@code{dired-mark-directories}) Mark all directory files except `.' and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 `..'. With prefix argument, unflag all those files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 @item %m
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595 @kindex %m
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 @findex dired-mark-files-regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 (@code{dired-mark-files-regexp}) Mark all files matching @var{regexp}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 for use in later commands. A prefix argument means to unmark them
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 instead. @file{.} and @file{..} are never marked.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 The match is against the non-directory part of the filename. Use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 @samp{^} and @samp{$} to anchor matches. Exclude subdirs by hiding
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 them.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 This is an Emacs regexp, not a shell wildcard. E.g., use @samp{\.o$}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606 for object files - just @samp{.o} will mark more than you might think.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 By default, the match is case sensitive (just like filenames), since
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 @code{case-fold-search} is set to @code{nil} in Dired buffers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610 @item M-@}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611 @kindex M-@}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612 @findex dired-next-marked-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 (@code{dired-next-marked-file}) Move to the next marked file, wrapping
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614 around the end of the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 @item M-@{
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617 @kindex M-@{
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 @findex dired-prev-marked-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619 (@code{dired-prev-marked-file}) Move to the previous marked file,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 wrapping around the beginning of the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624 @node Mark-using Commands, Commands That Do Not Use Marks, Marking Files in Dired, Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625 @section Mark-using Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627 @cindex Mark-using commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628 Most Dired commands operate on the ``marked'' files and default to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629 current file. They are the ``mark-using'' commands. Deleting is the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 only mark-using command that does not default to the current file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632 @cindex Numeric argument to Dired's mark-using commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633 @cindex Prefix argument to Dired's mark-using commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634 @cindex Repeat count for Dired's mark-using commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635 @cindex Mark-using commands, use of prefix argument as repeat count
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636 Mark-using Dired commands treat a numeric argument as a repeat count,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
637 meaning to act on the files of the next few lines instead of on the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638 marked files. That is, when you give a prefix argument the marks are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639 not consulted at all. A negative argument means to operate on the files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640 of the preceding lines. Either set of files is called @dfn{marked
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
641 files} below, whether they really come from marks or from a prefix
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642 argument. The prompt of a mark-using command always makes clear which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643 set of files is operated upon: it mentions either the marker character
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644 @samp{*} or the @samp{next @var{N}} files, where a negative @var{N}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645 really means the previous @var{-N} files.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647 @cindex Prefix argument via digit keys
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648 Thus you can use a prefix argument of @code{1} to apply a command to just the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649 current file, e.g, if you don't want to disturb the other files you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650 marked. As digits are prefix arguments in Dired, simply type @kbd{1}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
651 followed by the command.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
652
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
653 Many mark-using commands treat a prefix of @var{N=0} specially, since it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
654 would otherwise be a no-op.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
655
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
656 @cindex Why something went wrong in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657 @cindex Error logging in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658 @kindex W
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659 All mark-using commands display a list of files for which they failed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660 Type @kbd{W} to see why a (mark-using or other) command failed. Error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 messages from shell commands (@samp{stderr}) cannot be redirected
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662 separately and goes together with the usual output (@samp{stdout}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665 * Copy and Move Into a Directory::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666 * Renaming and More With Regexps::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667 * Other File Creating Commands::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668 * Deleting Files With Dired::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669 * Dired Shell Commands::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
670 * Compressing and Uncompressing::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
671 * Changing File Attributes::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
672 * Loading and Byte-compiling Emacs Lisp Files::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
673 * Printing the Marked Files::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
674 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
675
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676 @node Copy and Move Into a Directory, Renaming and More With Regexps, Mark-using Commands, Mark-using Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677 @subsection Copy, Move etc. Into a Directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
678
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679 @cindex Target commands in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680 @cindex Dired target commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
682 This section explains commands that create a new file for each marked
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
683 file, for example by copying (@kbd{c}) or moving (@kbd{r}) files. They
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
684 prompt in the minibuffer for a @var{target} argument, usually the target
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
685 directory in which the new files are created. But if there is but one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
686 marked file, the target may also be a plain file. (Otherwise you could
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687 not simply rename or copy a single file within the same directory.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
688 Even with one marked file the target may still be an (existing)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
689 directory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
690
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
691 @cindex Target default in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
692 @cindex Default target in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
693 @vindex dired-dwim-target
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
694 The target prompt displays a @dfn{default target} that will be used if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
695 you just type @kbd{RET}. Normally the default target is the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696 Dired directory, so if you want to copy into some specific subdirectory,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
697 move point into that subdirectory before typing @kbd{c}. But if there
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
698 is a Dired buffer in the next window, and @code{dired-dwim-target} is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
699 true, its current Dired directory is used. This makes it easy to copy
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
700 from one Dired buffer into another if both are displayed. On the other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
701 hand you have to use @kbd{C-x 1} to make other Dired buffers vanish if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
702 you do not want to have them as default targets. To make Dired never
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
703 look at the next window, set the variable @code{dired-dwim-target} to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
704 nil (@samp{dwim} means Do What I Mean). @xref{Dired User Options}, on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705 how to set cutomization variables.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
706
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707 @cindex Overwriting of files in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
708 As a general rule, Dired will not let you remove or overwrite a file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
709 without explicit confirmation. Dired asks you for each existing target
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
710 file whether or not to overwrite just this file (answer @kbd{y} or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
711 @kbd{n}) or all remaining files (answer @kbd{!}). You can also type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712 your help character, usually @kbd{C-h}, at that time for help.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
713
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715 @findex dired-do-copy
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716 @kindex c
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717 @vindex dired-copy-preserve-time
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718 @item c
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
719 (@code{dired-do-copy}) Copy the marked (or next @var{N}) files into a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
720 directory, or copy a single file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
721
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
722 Thus, a zero prefix argument (@var{N-0}) copies nothing. But it toggles
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
723 the variable @code{dired-copy-preserve-time}.@*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
724 @xref{Dired User Options}, on how to set customization variables.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
725
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726 @findex dired-do-move
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727 @kindex r
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
728 @item r
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
729 (@code{dired-do-move}) Move the marked files into a directory. If
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
730 there is just one marked file, rename that file. As the marked files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
731 default to the current file, this can also be used to simply rename the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
732 current file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
733
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
734 Dired silently changes the visited file name of buffers associated with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
735 moved files so that they refer to the new location of the file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
736
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
737 When a directory is renamed, its headerlines in Dired buffers are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
738 updated, and any buffers visiting affected files have their visited file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
739 name changed to refer to the new location. Their buffer name is changed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
740 if no buffer with such a name already exists. Affected files are all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
741 those which contain the directory somewhere in their absolute path name.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
742
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
743 A zero prefix arguments does not move any files, but toggles the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
744 variable @code{dired-dwim-target}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
745
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
746 @findex dired-do-hardlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
747 @kindex H
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
748 @item H
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
749 (@code{dired-do-hardlink}) Make hard links from the target directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
750 to each marked file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
751 @findex dired-do-symlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
752 @kindex Y
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
753 @item Y
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
754 (@code{dired-do-symlink}) Make symbolic links from the target
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
755 directory to each marked file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
756 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
758 @vindex dired-keep-marker-copy
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
759 @vindex dired-keep-marker-hardlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
760 @vindex dired-keep-marker-symlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
761 Linking is very similar to copying in that new files are created while
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
762 the old files stay. If you want each newly copied or linked file to be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
763 marked with the same marker that its original has, set the variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
764 @code{dired-keep-marker-copy}, @code{dired-keep-marker-hardlink} or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
765 @code{dired-keep-marker-symlink} to @code{t}. Set them to @code{nil} to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
766 not give these newly created files marks. The default is to mark them
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
767 with @samp{C}, @samp{H} and @samp{Y}, respectively.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
768
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
769 @vindex dired-keep-marker-move
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
770 Moving differs from copying and linking in that the old file is removed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
771 as part of the creation of the new file. Thus it makes sense to set the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
772 variable @code{dired-keep-marker-move} to @code{t} (the default) so that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
773 moved files ``take their markers with them''.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
774
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
775 @node Renaming and More With Regexps, Other File Creating Commands, Copy and Move Into a Directory, Mark-using Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
776 @subsection Renaming (and More) With Regexps
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
777
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
778 @cindex Regexp commands in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
779 @cindex Dired regexp commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
780 A second class of Commands uses regular expressions to construct a new
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
781 filename from each marked file. @xref{Regexps,Syntax of Regular
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
782 Expressions,Regular Expressions,emacs,The GNU Emacs Manual}. The commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
783 to make new names by regexp conversion are the same as those to make
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
784 them in another directory, except that they share a prefix char, @kbd{%}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
785
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
786 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
787
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
788 @item %r
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
789 @kindex %r
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
790 @findex dired-rename-regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
791 (@code{dired-rename-regexp}) Rename files with regexps
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
792
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
793 @item %c
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
794 @kindex %c
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
795 @findex dired-do-copy-regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
796 (@code{dired-do-copy-regexp})
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
797 Copy files with regexps.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
798
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
799 @item %H
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
800 @kindex %H
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
801 @findex dired-do-hardlink-regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
802 (@code{dired-do-hardlink-regexp})
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
803 Make hard links with regexps.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
804
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
805 @item %Y
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
806 @kindex %Y
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
807 @findex dired-do-symlink-regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
808 (@code{dired-do-symlink-regexp})
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
809 Make symbolic links with regexps.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
810
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
811 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
812
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
813 These commands prompt in the minibuffer for a @var{regexp} and a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
814 @var{newname}. For each marked file matching @var{regexp}, a new
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
815 filename is constructed from @var{newname}. The match can be anywhere
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
816 in the file name, it need not span the whole filename. Use @samp{^} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
817 @samp{$} to anchor matches that should span the whole filename. Only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
818 the first match in the filename is replaced with @var{newtext}. (It
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
819 would be easy to change this to replace all matches, but probably harder
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
820 to use.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
821
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
822 @samp{\&} in @var{newname} stands for the entire text being replaced.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
823 @samp{\@var{d}} in @var{newname}, where @var{d} is a digit, stands for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
824 whatever matched the @var{d}'th parenthesized grouping in @var{regexp}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
825 As each match is found, the user must type a character saying whether or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
826 not to apply the command to just this file (@kbd{y} or @kbd{n}) or to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
827 all remaining files(@kbd{!}). For help type your help character,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
828 usually @kbd{C-h}, at that time.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
829
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
830 For example, if you want to rename all @file{.lsp} files to @file{.el}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
831 files, type first @kbd{%m} with @samp{\.lsp$} as regexp to mark all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
832 @file{.lsp} files. Then type @kbd{%r} with @samp{\.lsp$} and @samp{.el}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
833 as @var{regexp} and @var{newtext} arguments. Dired will prompt you for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
834 each file to be renamed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
835
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
836 Or to append @file{.old} to all marked files, use @kbd{%r} @samp{$}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
837 @kbd{RET} @samp{.old} @kbd{RET}, replacing the empty string at the end
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
838 of each file name with @samp{.old}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
839
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
840 You can use the regexp @samp{\(.+\)\.\(.+\)$} to make the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
841 basename as @samp{\1} and the extension as @samp{\2} available in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
842 @var{newtext}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
843
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
844 With a zero prefix arg, renaming by regexp affects the complete
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
845 pathname. Usually only the non-directory part of file names is used and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
846 changed, and renaming only takes place within the current directory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
847 The zero prefix argument can be used to change the directory part as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
848 well.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
849
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
850 Often you will want to apply the command to all files matching the same
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
851 @var{regexp} that you use in the command. Simply use the @kbd{%m}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
852 command with @var{regexp} as argument, which will then also be the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
853 default for the next regexp using command.@refill For example, to remove
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
854 a @file{V17I12-} prefix from several filenames, use @kbd{%m}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
855 @samp{^V17I12-} @kbd{RET} @kbd{%r} @kbd{RET} @kbd{RET}, in effect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
856 replacing the prefix with the empy string.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
857
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
858 @node Other File Creating Commands, Deleting Files With Dired, Renaming and More With Regexps, Mark-using Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
859 @subsection Other File Creating Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
860
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
861 @cindex Case-changing Dired commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
862 @cindex Dired case-changing commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
863 Commands to change the case of file names:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
864
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
865 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
866 @findex dired-upcase
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
867 @kindex %u
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
868 @item %u
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
869 (@code{dired-upcase}) Rename each marked file to upper case.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
870 @findex dired-downcase
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
871 @kindex %l
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
872 @item %l
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
873 (@code{dired-downcase}) Rename each marked file to lower case.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
874 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
875
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
876 @node Deleting Files With Dired, Dired Shell Commands, Other File Creating Commands, Mark-using Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
877 @subsection Deleting Files With Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
878
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
879 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
880 Deleting is a special mark-using command. It uses a special marker,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
881 @samp{D}, and does not default to the current file if no files are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
882 marked to prevent accidental deletions.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
883
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
884 @xref{Dired Customization}, variable @code{dired-del-marker} to make
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
885 deleting behave exactly like any mark-using command.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
886
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
887 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
888
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
889 @findex dired-flag-file-deleted
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
890 @kindex d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
891 @item d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
892 (@code{dired-flag-file-deleted}) Flag this file for deletion. If on a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
893 subdirectory headerline, mark all its files except @file{.} and @file{..}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
894
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
895 @findex dired-unmark-subdir-or-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
896 @kindex u
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
897 @item u
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
898 (@code{dired-unmark-subdir-or-file}) Remove deletion-flag on this line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
899
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
900 @findex dired-backup-unflag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
901 @kindex @key{DEL}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
902 @item @key{DEL}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
903 (@code{dired-backup-unflag}) Remove deletion-flag on previous line,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
904 moving point to that line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
905
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
906 @findex dired-flag-regexp-files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
907 @kindex %d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
908 @item %d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
909 (@code{dired-flag-regexp-files}) Flag all files containing the specified
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
910 @var{regexp} for deletion.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
911
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
912 The match is against the non-directory part of the filename. Use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
913 @samp{^} and @samp{$} to anchor matches. Exclude subdirs by hiding
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
914 them.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
915
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
916 The special directories @file{.} and @file{..} are never flagged.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
917
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
918 @findex dired-do-deletions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
919 @kindex x
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
920 @item x
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
921 (@code{dired-do-deletions}) Delete the files that are flagged for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
922 deletion (with @samp{D}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
923
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
924 @findex dired-do-delete
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
925 @kindex X
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
926 @item X
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
927 (@code{dired-do-delete}) Delete the @samp{*}-marked (as opposed to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
928 @samp{D}-flagged) files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
929
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
930 @findex dired-flag-auto-save-files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
931 @kindex #
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
932 @item #
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
933 (@code{dired-flag-auto-save-files}) Flag all auto-save files (files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
934 whose names start and end with @samp{#}) for deletion (@pxref{Auto
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
935 Save,Auto-Saving: Protection Against Disasters,Auto Save,emacs,The GNU Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
936 Manual}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
937
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
938 @findex dired-flag-backup-files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
939 @kindex ~
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
940 @item ~
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
941 (@code{dired-flag-backup-files}) Flag all backup files (files whose
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
942 names end with @samp{~}) for deletion (@pxref{Backup,Backup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
943 Files,Backup,emacs,The GNU Emacs Manual}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
944
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
945 @findex dired-clean-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
946 @kindex .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
947 @item .@: @r{(Period)}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
948 (@code{dired-clean-directory}) Flag excess numeric backup files for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
949 deletion. The oldest and newest few backup files of any one file are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
950 exempt; the middle ones are flagged.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
951 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
952
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
953 You can flag a file for deletion by moving to the line describing the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
954 file and typing @kbd{d} or @kbd{C-d}. The deletion flag is visible as a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
955 @samp{D} at the beginning of the line. Point is moved to the beginning
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
956 of the next line, so that repeated @kbd{d} commands flag successive
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
957 files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
958
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
959 The files are flagged for deletion rather than deleted immediately to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
960 avoid the danger of deleting a file accidentally. Until you direct
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
961 Dired to delete the flagged files, you can remove deletion flags using
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
962 the commands @kbd{u} and @key{DEL}. @kbd{u} works just like @kbd{d},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
963 but removes flags rather than making flags. @key{DEL} moves upward,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
964 removing flags; it is like @kbd{u} with numeric argument automatically
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
965 negated.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
966
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
967 To delete the flagged files, type @kbd{x}. This command first displays
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
968 a list of all the file names flagged for deletion, and requests
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
969 confirmation with @kbd{yes}. Once you confirm, all the flagged files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
970 are deleted, and their lines are deleted from the text of the Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
971 buffer. The shortened Dired buffer remains selected. If you answer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
972 @kbd{no} or quit with @kbd{C-g}, you return immediately to Dired, with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
973 the deletion flags still present and no files actually deleted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
974
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
975 Deletions proceed from the end of the buffer, so if subdirs are in a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
976 natural order in the buffer, it usually works to flag @samp{dir1},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
977 @samp{dir1/dir2} and @samp{dir1/dir2/*} (by typing @kbd{d} on the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
978 directory headerlines) and delete everything, including @samp{dir1/dir2}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
979 and @samp{dir1}. Using shell commands (e.g. @samp{rm -rf}) to remove
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
980 complete directories may be quicker than having Dired remove each file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
981 separately. (@xref{Dired Shell Commands}.) However, like all actions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
982 external to Dired, this does not update the display.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
983 @c and does not offer to kill buffers of deleted files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
984
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
985 The @kbd{#}, @kbd{~} and @kbd{.} commands flag many files for deletion,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
986 based on their names. These commands are useful precisely because they
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
987 do not actually delete any files; you can remove the deletion flags from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
988 any flagged files that you really wish to keep.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
989
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
990 @kbd{#} flags for deletion all files that appear to have been made by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
991 auto-saving (that is, files whose names begin and end with @samp{#}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
992 @kbd{~} flags for deletion all files that appear to have been made as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
993 backups for files that were edited (that is, files whose names end with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
994 @samp{~}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
995
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
996 @vindex dired-kept-versions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
997 @kbd{.} (Period) flags just some of the backup files for deletion: only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
998 numeric backups that are not among the oldest few nor the newest few
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
999 backups of any one file. Normally @code{dired-kept-versions} (not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1000 @code{kept-new-versions}; that applies only when saving) specifies the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1001 number of newest versions of each file to keep, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1002 @code{kept-old-versions} specifies the number of oldest versions to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1003 keep. Period with a positive numeric argument, as in @kbd{C-u 3 .},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1004 specifies the number of newest versions to keep, overriding
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1005 @code{dired-kept-versions}. A negative numeric argument overrides
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1006 @code{kept-old-versions}, using minus the value of the argument to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1007 specify the number of oldest versions of each file to keep.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1008
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1009 @node Dired Shell Commands, Compressing and Uncompressing, Deleting Files With Dired, Mark-using Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1010 @subsection Shell Commands on Marked files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1011
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1012 @cindex Shell commands (in Dired)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1013 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1014 You can run arbitrary shell commands on the marked files. If there is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1015 output, it goes to a separate buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1016
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1017 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1018
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1019 @findex dired-do-shell-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1020 @kindex !
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1021 @item !
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1022 (@code{dired-do-shell-command}) Run a shell command on the marked
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1023 files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1024
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1025 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1026
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1027 A command string is prompted for in the minibuffer. The list of marked
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1028 files is appended to the command string unless asterisks @samp{*}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1029 indicate the place(s) where the list should go. Thus,@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1030
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1031 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1032 command -flags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1033 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1034
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1035 is equivalent to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1036
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1037 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1038 command -flags *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1039 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1040
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1041 The filenames are inserted in the order they appear in the buffer. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1042 file listed topmost in the buffer will be the leftmost in the list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1043
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1044 Currently, there is no way to insert a real @samp{*} into the command.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1045
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1046 As with all mark-using commands, if no files are marked or a specific
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1047 numeric prefix arg is given, the current or the next @var{N} files are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1048 used. The prompt mentions the file(s) or the marker, as appropriate.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1049
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1050 However, for shell commands, a zero argument is special. It means to run
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1051 command on each marked file separately:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1052
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1053 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1054 cmd * |foo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1055 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1056
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1057 results in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1058
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1059 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1060 cmd F1 |foo; @dots{}; cmd F@var{n} |foo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1061 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1062
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1063 Usually
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1064
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1065 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1066 cmd F1 @dots{} F@var{n} |foo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1067 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1068
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1069 would be executed.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1070
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1071 No automatic redisplay is attempted because Dired cannot know what files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1072 should be redisplayed for a general shell command. For example, a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1073 @samp{tar cvf} will not change the marked files at all, but rather
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1074 create a new file, while a @samp{ci -u -m'@dots{}' *} will probably change
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1075 the permission bits of all marked files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1076
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1077 Type @kbd{l} to redisplay just the marked files, or @kbd{l} on a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1078 directory headerline to redisplay just that directory, or @kbd{g} to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1079 redisplay all directories.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1080
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1081 The shell command has the top level directory as working directory, so
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1082 output files usually are created there instead of in a subdirectory,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1083 which may sometimes be surprising if all files come from the same
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1084 subdirectory. Just remember that an Emacs buffer can have but one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1085 working directory, and this is the top level directory in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1086 buffers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1087
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1088 Examples for shell commands:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1089
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1090 @itemize @bullet
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1091
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1092 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1093 Type @kbd{!} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1094
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1095 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1096 tar cvf foo.tar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1097 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1098
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1099 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1100 to tar all marked files into a @file{foo.tar} file. Dired does not know
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1101 that a new file has been created and you have to type @kbd{g} to refresh
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1102 the listing. If you have several subdirectories in your Dired buffer,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1103 the names given to @samp{tar} will be relative to the top level
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1104 directory, and the output file @file{foo.tar} will also be created
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1105 there.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1106
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1107 You can use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1108
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1109 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1110 tar cvf - * | compress -c > foo.tar.Z
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1111 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1112
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1113 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1114 as an alternative to immediately compress the tar file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1115
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1116 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1117 Type @kbd{0 !} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1118
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1119 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1120 uudecode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1121 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1122
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1123 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1124 to uudecode each of the marked files. Note the use of the zero prefix
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1125 argument to apply the shell command to each file separately (uudecode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1126 doesn't accept a list of input files). Type @kbd{g} afterwards to see
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1127 the created files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1128
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1129 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1130 Type @kbd{0 !} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1131
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1132 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1133 uuencode * * >*.uu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1134 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1135
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1136 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1137 to uuencode each of the marked files, writing into a corresponding
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1138 @file{.uu} file. Note the use of the zero prefix argument to apply the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1139 shell command to each file separately. Type @kbd{g} afterwards to see
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1140 the created @file{.uu} files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1141
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1142 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1143 Type @kbd{1 !} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1144
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1145 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1146 mail joe@@somewhere <*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1147 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1148
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1149 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1150 to mail the current file (note the prefix argument @samp{1}) to user
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1151 @samp{joe@@somewhere}.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1152
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1153 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1154 @cindex running the current file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1155 @cindex executing the current file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1156 @cindex current file, how to run it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1157 Here is a Dired shell command to execute the current file, assuming no
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1158 other files are marked (else just give the prefix @kbd{1} to @kbd{!}):
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1159 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1160 ./*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1161 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1162 which will be expanded to @samp{./@var{cmd}}, thus @var{cmd} will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1163 executed.. (Just @samp{./} would be expanded to @samp{./ @var{cmd}},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1164 with an intervening @kbd{SPC}.) This will work even if you don't have
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1165 @file{.} in your @code{$PATH}. If @file{.} is in your path (not a good
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1166 idea, as you will find out if you dired a directory containing a file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1167 named @file{ls}), a single @kbd{SPC} as command would also work.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1168
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1169 @c <<NEED MORE AND BETTER EXAMPLES HERE>>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1170 @end itemize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1171
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1172 @node Compressing and Uncompressing, Changing File Attributes, Dired Shell Commands, Mark-using Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1173 @subsection Compressing and Uncompressing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1174
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1175 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1176 You can compress or uncompress the marked files. Dired refuses to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1177 compress files ending in @file{.Z} (which are already compressed) or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1178 symbolic links (the link would be overwritten by a plain, compressed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1179 file) and to uncompress files not ending in @file{.Z}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1180
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1181 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1182
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1183 @findex dired-do-compress
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1184 @kindex C
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1185 @item C
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1186 (@code{dired-do-compress}) Compress the marked files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1187
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1188 @findex dired-do-uncompress
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1189 @kindex U
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1190 @item U
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1191 (@code{dired-do-uncompress}) Uncompress the marked files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1192 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1193
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1194 @node Changing File Attributes, Loading and Byte-compiling Emacs Lisp Files, Compressing and Uncompressing, Mark-using Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1195 @subsection Changing File Attributes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1196
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1197 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1198 You can change the file attributes (mode, group, owner) of marked files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1199
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1200 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1201
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1202 @findex dired-do-chmod
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1203 @kindex M
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1204 @item M
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1205 (@code{dired-do-chmod}) Change the mode (also called ``permission
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1206 bits'') of the marked files. This calls the @samp{chmod} program, thus
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1207 symbolic modes like @samp{g+w} are allowed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1208
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1209 Multiple switches like @samp{-fR g+w} are not understood, though. Use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1210 @kbd{!} (@code{dired-do-shell-command}) for that.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1211
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1212 @findex dired-do-chgrp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1213 @kindex G
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1214 @item G
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1215 (@code{dired-do-chgrp}) Change the group of the marked files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1216
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1217 @vindex dired-chown-program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1218 @findex dired-do-chown
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1219 @kindex O
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1220 @item O
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1221 (@code{dired-do-chown}) Change the owner of the marked files. This
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1222 usually works for the superuser only. It uses the program in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1223 variable @code{dired-chown-program} to do the change.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1224 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1225
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1226 @node Loading and Byte-compiling Emacs Lisp Files, Printing the Marked Files, Changing File Attributes, Mark-using Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1227 @subsection Loading and Byte-compiling Emacs Lisp Files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1228
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1229 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1230 You can load and byte-compile GNU Emacs Lisp files. Errors are caught and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1231 reported after all files have been processed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1232
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1233 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1234
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1235 @findex dired-do-load
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1236 @kindex L
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1237 @item L
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1238 (@code{dired-do-load}) Load the marked elisp files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1239
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1240 @findex dired-do-byte-compile
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1241 @kindex B
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1242 @item B
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1243 (@code{dired-do-byte-compile}) Byte compile the marked elisp files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1244 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1245
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1246 @node Printing the Marked Files, , Loading and Byte-compiling Emacs Lisp Files, Mark-using Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1247 @subsection Printing the Marked Files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1248
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1249 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1250 @findex dired-do-print
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1251 @kindex P
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1252 @vindex lpr-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1253 @vindex lpr-switches
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1254 @item P
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1255 (@code{dired-do-print}) Print the marked (or next @var{N}) files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1256 Uses the shell command coming from variables @code{lpr-command} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1257 @code{lpr-switches} as default.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1258
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1259 Since internally this is just a special case of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1260 @code{dired-do-shell-command}, you can use @samp{*} and pipes like for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1261 shell command, e.g.,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1262 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1263 (setq lpr-command: "lwf")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1264 (setq lpr-switches: '("-l -m * | lpr -Palw"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1265 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1266 to print with the shell command @samp{lwf -l -m * | lpr -Palw}, where
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1267 @samp{*} will be substituted by the marked files. The @code{lpr-buffer}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1268 and @code{lpr-region} don't know about @samp{*} or @samp{|}, though, only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1269 Dired does.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1270 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1271
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1272 @node Commands That Do Not Use Marks, Subdirectories in Dired, Mark-using Commands, Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1273 @section Commands That Do Not Use Marks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1274
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1275 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1276 These are commands that visit files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1277 @xref{Visiting,Visiting Files,Visiting,emacs,The GNU Emacs Manual}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1278
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1279 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1280
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1281 @findex dired-advertised-find-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1282 @kindex f
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1283 @item f
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1284 (@code{dired-advertised-find-file}) Visits the file described on the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1285 current line. It is just like typing @kbd{C-x C-f} and supplying that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1286 file name. If the file on this line is a subdirectory, @kbd{f} actually
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1287 causes Dired to be invoked on that subdirectory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1288
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1289 @findex dired-find-file-other-window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1290 @kindex o
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1291 @item o
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1292 (@code{dired-find-file-other-window}) Like @kbd{f}, but uses another
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1293 window to display the file's buffer. The Dired buffer remains visible
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1294 in the first window. This is like using @kbd{C-x 4 C-f} to visit the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1295 file. @xref{Windows,Multiple Windows,Windows,emacs,The GNU Emacs Manual}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1296
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1297 @findex dired-view-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1298 @kindex v
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1299 @item v
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1300 (@code{dired-view-file}) Views the file described on this line using
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1301 @kbd{M-x view-file}. Viewing a file is like visiting it, but is slanted
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1302 toward moving around in the file conveniently and does not allow
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1303 changing the file. @xref{Misc File Ops,View File,Miscellaneous File
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1304 Operations,emacs,The GNU Emacs Manual}. @refill Viewing a file that is a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1305 directory goes to its headerline if it is in this buffer. Otherwise, it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1306 is displayed in another buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1307
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1308 @c Forgot that this only works for my version of C-x C-r...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1309 @c
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1310 @c You might think that a @code{dired-view-file-other-window} command is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1311 @c missing, but it is easy to use @kbd{o} followed by @kbd{C-x C-r}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1312 @c @kbd{RET}, which will first visit the file in the other window, then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1313 @c @samp{find-file-read-only} it (@kbd{RET} defaulting to the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1314 @c buffer's file).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1315
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1316 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1317
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1318 @cindex Diffing files in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1319 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1320 Commands to diff a file:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1321
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1322 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1323
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1324 @findex dired-diff
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1325 @kindex D
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1326 @item D
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1327 (@code{dired-diff}) Compare file at point with another file (default:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1328 file at mark), by running the system command @samp{diff}. The other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1329 file is the first file given to @samp{diff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1330
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1331 @findex dired-backup-diff
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1332 @kindex M-~
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1333 @item M-~
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1334 (@code{dired-backup-diff}) Diff this file with its backup file. Uses
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1335 the latest backup, if there are several numerical backups. If this file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1336 is a backup, diff it with its original. The backup file is the first
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1337 file given to @samp{diff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1338 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1339
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1340 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1341 Other commands:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1342
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1343 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1344 @findex dired-create-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1345 @kindex +
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1346 @cindex Creating a directory in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1347 @cindex Directory, how to create one in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1348 @item +
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1349 (@code{dired-create-directory}) Create a directory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1350 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1351
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1352 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1353 @findex dired-why
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1354 @kindex W
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1355 @cindex Why something went wrong in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1356 @cindex Error logging in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1357 @item W
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1358 (@code{dired-why}) Pop up a buffer with error log output from Dired.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1359 All mark-using commands log errors there. (Standard error from shell
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1360 commands cannot be logged separately, it goes into the usual shell
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1361 command output buffer.) A group of errors from a single command ends
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1362 with a formfeed, so that you can use @kbd{C-x [} (@code{backward-page})
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1363 to find the beginning of new error logs that are reported by a command.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1364
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1365 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1366
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1367 @node Subdirectories in Dired, Hiding Directories in Dired, Commands That Do Not Use Marks, Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1368 @section Subdirectories in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1369
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1370 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1371 Thise section explains how to @dfn{insert} (or @dfn{expand})
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1372 subdirectories in the same Dired buffer and move around in them.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1373 @cindex Inserting subdirectories in same Dired buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1374 @cindex Expanding subdirectories in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1375
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1376 You can display subdirectories in your Dired buffer by using @samp{-R}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1377 in your Dired listing switches. But you do not usually want to have a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1378 complete recursive listing in all your Dired buffers. So there is a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1379 command to insert a single directory:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1380
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1381 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1382
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1383 @findex dired-maybe-insert-subdir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1384 @kindex i
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1385 @item i
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1386 @cindex Inserted subdirectory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1387 @cindex Expanded subdirectory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1388 @cindex In-situ subdirectory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1389 @cindex Headerline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1390 (@code{dired-maybe-insert-subdir}) Insert this subdirectory into the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1391 same Dired buffer. If it is already present, just move to it (type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1392 @kbd{l}, @code{dired-do-redisplay} to refresh it). Else inserts it as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1393 @samp{ls -lR} would have done. With a prefix arg, you may edit the ls
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1394 switches used for this listing. You can add @samp{R} to the switches to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1395 expand the whole tree starting at this subdirectory. This function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1396 takes some pains to conform to @samp{ls -lR} output. For example, it adds the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1397 headerline for the inserted subdirectory.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1398
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1399 The mark is dropped before moving, so @kbd{C-x C-x} takes you back to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1400 the old position in the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1401
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1402 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1403
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1404 Dired changes the buffer-local value of the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1405 @code{page-delimiter} to @code{"\n\n"}, so that subdirectories become
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1406 pages. Thus, the page moving commands @kbd{C-x [} and @kbd{C-x ]}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1407 (@code{backward-page} and @code{forward-page}) can be used to move to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1408 the beginning (i.e., the headerlines) of subdirectories.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1409
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1410 In addition, the following commands move around directory-wise, usually
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1411 putting you on a file line instead of on a headerline. For a mnemonic,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1412 note that they all look like rotated versions of each other, and that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1413 they move in the direction they point to.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1414
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1415 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1416
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1417 @findex dired-prev-dirline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1418 @kindex <
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1419 @item <
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1420 (@code{dired-prev-dirline}) Goto previous directory file line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1421
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1422 @findex dired-next-dirline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1423 @kindex >
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1424 @item >
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1425 (@code{dired-next-dirline}) Goto next directory file line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1426
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1427 @findex dired-up-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1428 @kindex ^
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1429 @item ^
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1430 (@code{dired-up-directory}) Dired parent directory. Tries first to find
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1431 its file line, then its header line in this buffer, then its Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1432 buffer, finally creating a new Dired buffer if necessary.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1433
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1434 @findex dired-view-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1435 @kindex v
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1436 @item v
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1437 (@code{dired-view-file}) When the current file is not a directory, view
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1438 it. When file is a directory, tries to go to its subdirectory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1439
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1440 @comment actually, it is not always inverse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1441 This command is inverse to the @kbd{^} command and it is very convenient
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1442 to use these two commands together.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1443
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1444 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1445
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1446 The following commands move up and down in the directory tree:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1447
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1448 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1449
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1450 @findex dired-tree-up
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1451 @kindex M-C-u
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1452 @item M-C-u
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1453 (@code{dired-tree-up}) Go up to the parent directory's headerline.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1454
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1455 @findex dired-tree-down
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1456 @kindex M-C-d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1457 @item M-C-d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1458 (@code{dired-tree-down}) Go down in the tree, to the first
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1459 subdirectory's headerline.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1460
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1461 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1462
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1463 The following commands move forwards and backwards to subdirectory headerlines:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1464
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1465 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1466
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1467 @findex dired-next-subdir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1468 @kindex M-C-n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1469 @item M-C-n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1470 (@code{dired-next-subdir}) Go to next subdirectory headerline,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1471 regardless of level.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1472
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1473 @findex dired-prev-subdir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1474 @kindex M-C-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1475 @item M-C-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1476 (@code{dired-prev-subdir}) Go to previous subdirectory headerline,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1477 regardless of level.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1478
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1479 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1480
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1481 @node Hiding Directories in Dired, Acknowledgement, Subdirectories in Dired, Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1482 @section Hiding Directories in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1483
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1484 @cindex Hiding in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1485 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1486 @dfn{Hiding} a subdirectory means to make it invisible, except for its
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1487 headerline. Files inside a hidden subdirectory are never considered by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1488 Dired. For example, mark-using commands will not ``see'' files in a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1489 hidden directory. Thus you can use hiding to temporarily exclude
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1490 subdirectories from operations without having to remove the markers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1491
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1492 The hiding commands toggle, that is they unhide what was hidden and vice
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1493 versa.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1494
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1495 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1496
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1497 @findex dired-hide-subdir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1498 @kindex $
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1499 @item $
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1500 (@code{dired-hide-subdir}) Hide or unhide the current subdirectory and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1501 move to next directory. Optional prefix argument is a repeat factor.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1502
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1503 @findex dired-hide-all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1504 @kindex =
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1505 @item =
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1506 (@code{dired-hide-all}) Hide all subdirectories, leaving only their
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1507 header lines. If there is already something hidden, make everything
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1508 visible again. Use this command to get an overview in very deep
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1509 directory trees or to move quickly to subdirs far away.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1510 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1511
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1512 @node Acknowledgement, Dired Customization, Hiding Directories in Dired, Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1513 @section Acknowledgement
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1514
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1515 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1516 I would like to thank
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1517
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1518 @itemize @bullet
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1519 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1520 Richard Stallman for providing a pre-release version of @file{dired.el}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1521 from Emacs 19, critical comments and many helpful suggestions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1522 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1523 Andy Norman for the collaboration that made Tree Dired and ange-ftp such
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1524 a successful combination
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1525 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1526 Jamie Zawinski for insisting on and writing nested Dired format, and for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1527 lots of other things
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1528 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1529 Michael Ernst for the ``omitting'' code and helpful discussion about
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1530 Dired design
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1531 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1532 Hans Chalupsky for providing FTP service and writing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1533 @file{dired-trns.el}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1534 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1535 Roland McGrath for @file{find-dired.el} and bug fixes for the diffing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1536 commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1537 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1538 Kevin Gallagher for sending me existing VMS Dired fixes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1539 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1540 Hal R. Brand for VMS support and porting his old dired fixes to Tree
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1541 Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1542 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1543 Hugh Secker-Walker for writing @file{dired-cd.el}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1544 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1545 Tom Wurgler for ideas such as the @dfn{dired-jump-back} command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1546 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1547 Cengiz Alaettinoglu, who found more bugs in Tree Dired than anybody else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1548 (except me)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1549 @end itemize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1550 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1551 and all other beta testers and people who reported bugs or just said
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1552 ``thanks''.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1553
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1554 @node Dired Customization, , Acknowledgement, Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1555 @section Dired Customization
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1556
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1557 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1558 You can customize Dired by setting some variables in your @file{~/.emacs}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1559 file. Other variables are intended to be configured when Dired is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1560 installed. Finally, there are so-called `hook' variables.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1561
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1562 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1563 * Dired User Options::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1564 * Dired Configuration::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1565 * Dired Hooks::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1566 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1567
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1568 @node Dired User Options, Dired Configuration, Dired Customization, Dired Customization
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1569 @subsection Customization of Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1570
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1571 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1572 The following variables are for personal customization in your
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1573 @file{~/.emacs} file. For example, include a line similar to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1574 following
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1575
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1576 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1577 (setq dired-listing-switches "-Alt") ; sort on time, ignore . and ..
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1578 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1579
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1580 to set your favorite Dired listing switches.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1581
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1582 @c Should actually use @defopt here, but this is in Texinfo2 only.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1583
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1584 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1585
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1586 @vindex dired-listing-switches
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1587 @item dired-listing-switches
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1588
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1589 Default: @code{"-al"}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1590
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1591 Switches passed to @samp{ls} for Dired. @i{Must} contain the @samp{l} option.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1592
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1593 @vindex dired-trivial-filenames
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1594 @item dired-trivial-filenames
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1595
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1596 Default: @code{"^\\.\\.?$\\|^#"}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1597
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1598 Regexp of files to skip when moving point to the first file of a new
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1599 directory listing. Nil means move to the subdirectory line, t means move to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1600 first file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1601
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1602 @vindex dired-marker-char
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1603 @item dired-marker-char
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1604
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1605 Default: @code{?*} (@samp{?*} is the Lisp notation for the character
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1606 @samp{*}.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1607
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1608 In Dired, character used to mark files for later commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1609
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1610 This is a variable so that one can write things like
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1611
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1612 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1613 (let ((dired-marker-char ?X))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1614 ;; great code using X markers ...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1615 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1616 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1617
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1618 @vindex dired-del-marker
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1619 @item dired-del-marker
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1620
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1621 Default: @code{?D}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1622
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1623 Character used to flag files for deletion.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1624
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1625 Usually, marking for commands and flagging for deletion are separate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1626 features. (Internally they use the same marking mechanism.) You type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1627 @kbd{d} to flag with @samp{D} and @kbd{x} to delete the @samp{D}-flagged
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1628 files.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1629
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1630 This explains how to make deletion behave just like a special case of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1631 the general file marking feature, so that you type @kbd{m} to mark with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1632 @samp{*} (as usual) and @kbd{d} to delete the @samp{*} (or next @var{N})
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1633 files: In your @file{~/.emacs}, include
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1634
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1635 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1636 (setq dired-del-marker dired-marker-char) ; use * also for deletions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1637 (setq dired-load-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1638 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1639 (lambda ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1640 ;; other customizations here
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1641 ;; let "d" do the actual deletion:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1642 (define-key dired-mode-map "d" 'dired-do-delete))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1643 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1644
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1645 If you do not like that @kbd{d} defaults to the current file if there
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1646 are no marks, replace the @code{define-key} statement in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1647 @code{dired-load-hook} above with this one:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1648
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1649 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1650 (define-key dired-mode-map "d" 'dired-do-deletions)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1651 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1652
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1653 @vindex dired-shrink-to-fit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1654 @item dired-shrink-to-fit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1655
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1656 Default: @code{(if (fboundp 'baud-rate) (> (baud-rate) search-slow-speed) t)}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1657
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1658 Whether Dired shrinks the display buffer to fit the marked files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1659
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1660 @vindex dired-no-confirm
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1661 @item dired-no-confirm
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1662
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1663 Default: @code{nil}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1664
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1665 If non-nil, list of commands Dired should not confirm. Confirmation for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1666 commands that require an argument to be entered (like the shell command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1667 for @kbd{!}) means a list of marked files is displayed in a pop-up
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1668 buffer. Confirmation for commands that do not require an argument (like
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1669 compressing with @kbd{C}) means you have to confirm by typing @kbd{y} or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1670 @kbd{SPC}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1671
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1672 Except @code{nil}, it can be a sublist of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1673
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1674 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1675 '(byte-compile chgrp chmod chown compress copy delete hardlink load
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1676 move print shell symlink uncompress)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1677 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1678
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1679 to suppress confirmation for just those commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1680
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1681 @c @vindex dired-deletion-confirmer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1682 @c But you can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1683 @c set the variable @code{dired-deletion-confirmer} to another function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1684 @c than @code{yes-or-no-p}, its default value. Using @code{y-or-no-p} will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1685 @c confirm with only a single key stroke, @key{y} or @key{n}, and using
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1686 @c @code{identity} will effectively switch off confirmation.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1687
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1688 @vindex dired-keep-marker-move
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1689 @item dired-keep-marker-move
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1690
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1691 Default: @code{t}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1692
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1693 If nil, moved files are not marked.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1694
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1695 If t, moved marked files are marked with the same marker they had before
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1696 (maybe none if you used the prefix argument to specify the next @var{N}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1697 files).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1698
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1699 If a character, moved files (marked or not) are marked with that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1700 character.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1701
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1702 This also applies to the following, similar variables for copied, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1703 hard or symbolically linked files:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1704
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1705 @vindex dired-keep-marker-copy
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1706 @item dired-keep-marker-copy
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1707
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1708 Default: @code{?C}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1709
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1710 @vindex dired-keep-marker-hardlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1711 @item dired-keep-marker-hardlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1712
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1713 Default: @code{?H}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1714
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1715 @vindex dired-keep-marker-symlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1716 @item dired-keep-marker-symlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1717
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1718 Default: @code{?Y}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1719
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1720 @vindex dired-dwim-target
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1721 @item dired-dwim-target
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1722
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1723 Default: @code{nil}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1724
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1725 If non-nil, Dired tries to guess a default target directory: If there is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1726 a Dired buffer displayed in the next window, use its current subdirectory,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1727 instead of the current subdirectory of this Dired buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1728
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1729 The target is used in the prompt for file copy, move etc.,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1730 @xref{Copy and Move Into a Directory}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1731
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1732 @item dired-copy-preserve-time
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1733 @vindex dired-copy-preserve-time
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1734
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1735 Default: @code{nil}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1736
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1737 If non-nil, Dired preserves the last-modified time in a file copy.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1738 (This works on only some systems.) Use @kbd{c} (@code{dired-do-copy})
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1739 with a zero prefix argument to toggle its value. The prompt of copy
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1740 commands will display @samp{Copy [-p]} instead of just @samp{Copy} if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1741 preservation of file times is turned on.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1742
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1743 @item dired-backup-if-overwrite
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1744 @vindex dired-backup-if-overwrite
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1745
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1746 Default: @code{nil}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1747
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1748 Non-nil if Dired should ask about making backups before overwriting files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1749 Special value @code{'always} suppresses confirmation.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1750
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1751 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1752
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1753 @node Dired Configuration, Dired Hooks, Dired User Options, Dired Customization
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1754 @subsection Dired Configuration
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1755
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1756 The following variables should have already been installed correctly by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1757 your system manager. If not, you can still set them in your
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1758 @file{~/.emacs} file.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1759
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1760 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1761
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1762 @vindex dired-chown-program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1763 @item dired-chown-program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1764 Pathname of chown command, default @code{"chown"} (or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1765 @code{"/etc/chown"} on System V derived systems.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1766
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1767 @vindex dired-ls-program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1768 @item dired-ls-program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1769 Absolute or relative name of the @samp{ls} program used by Dired,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1770 default @code{"ls"}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1771
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1772 @vindex dired-ls-F-marks-symlinks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1773 @item dired-ls-F-marks-symlinks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1774 Set this to @code{t} if dired-ls-program with @samp{-lF} marks the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1775 symbolic link itself with a trailing @samp{@@} (usually the case under
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1776 Ultrix).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1777
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1778 Example: If
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1779
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1780 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1781 ln -s foo bar; ls -F bar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1782 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1783
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1784 gives
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1785
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1786 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1787 bar -> foo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1788 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1789
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1790 set it to @code{nil}, if it gives
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1791
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1792 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1793 bar@@ -> foo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1794 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1795
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1796 set it to @code{t}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1797
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1798 Dired checks if there is really a @@ appended. Thus, if you have a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1799 marking @samp{ls} program on one host and a non-marking one on another
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1800 host, and do not care about symbolic links which really end in a @@, you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1801 can always set this variable to @code{t}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1802
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1803 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1804
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1805
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1806 @node Dired Hooks, , Dired Configuration, Dired Customization
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1807 @subsection Dired Hooks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1808
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1809 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1810 Hook variables can contain functions that are run at certain times in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1811 Dired.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1812
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1813 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1814
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1815 @vindex dired-load-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1816 @item dired-load-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1817
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1818 Run after loading Dired. You can customize key bindings or load
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1819 extensions with this. For example:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1820
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1821 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1822 (setq dired-load-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1823 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1824 (lambda ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1825 ;; Load extras:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1826 (load "dired-x")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1827 ;; How to define your own key bindings:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1828 (define-key dired-mode-map " " 'scroll-up)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1829 (define-key dired-mode-map "b" 'scroll-down))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1830 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1831
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1832 @vindex dired-mode-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1833 @item dired-mode-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1834
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1835 Run at the very end of @code{dired-mode}, after most buffer local
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1836 variables have been initialized (e.g., @code{default-directory} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1837 @code{dired-directory}), but before the directory listing has been read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1838 in.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1839
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1840 Do buffer local things here, for example:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1841
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1842 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1843 (setq dired-mode-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1844 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1845 (lambda ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1846 (dired-extra-startup) ;; dired-extra support
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1847 ;; How to set (local) variables in each new Dired buffer:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1848 (setq case-fold-search t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1849 (setq truncate-lines t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1850 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1851
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1852 Since the listing has not yet been inserted you could still change
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1853 @code{dired-actual-switches}. For example, if you use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1854 @file{ange-ftp.el}, you might want to replace the @samp{-A} with the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1855 @samp{-a} switch, depending on whether @code{default-directory}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1856 corresponds to a System V hosts that does not understand all BSD
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1857 @samp{ls} switches. The @code{dired.README} file gives an example. If
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1858 you set @code{dired-actual-switches} remember that you may also have to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1859 set @code{dired-sort-mode} to the appropriate string so that the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1860 modeline looks right.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1861
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1862 Do not set @code{dired-mode-hook} inside your @code{dired-load-hook},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1863 simply set it somewhere in your @file{~/.emacs} (before Dired is loaded,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1864 if you explicitly load Dired). This is so that extensions packages
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1865 loaded via the load hook can add things to the @code{dired-mode-hook} at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1866 the front or at the end, as they see fit.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1867
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1868 In case you set @code{truncate-lines} to @code{t} as in the above
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1869 example, here is a function to toggle the value of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1870 @code{truncate-lines}, in Dired and other buffers:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1871 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1872 (defun set-truncate-lines ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1873 "Toggle value of truncate-lines and refresh window display."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1874 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1875 (setq truncate-lines (not truncate-lines))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1876 ;; now refresh window display (an idiom from simple.el):
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1877 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1878 (set-window-start (selected-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1879 (window-start (selected-window)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1880 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1881 You could bind it to @kbd{C-x 4 $}:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1882 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1883 (define-key ctl-x-4-map "$" 'set-truncate-lines)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1884 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1885 It is sometimes useful to toggle @code{truncate-lines} in Dired buffers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1886 to make long filenames completely visible and get the listing properly
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1887 aligned again.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1888
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1889 @vindex dired-before-readin-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1890 @item dired-before-readin-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1891 This hook is run before a dired buffer is newly read in (created or reverted).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1892
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1893 @vindex dired-after-readin-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1894 @item dired-after-readin-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1895
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1896 After each listing of a file or directory, this hook is run with the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1897 buffer narrowed to the listing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1898
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1899 The @code{dired-subdir-alist} has already been updated so that the usual
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1900 Dired functions like @code{dired-get-filename} work. It is possible to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1901 modify the buffer with this hook. The package @file{dired-x.el} does
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1902 this to implement omitting certain uninteresting files from a Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1903 buffer. Under X11, highlighting of certain files is also possible (see
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1904 package @file{dired-x11.el}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1905
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1906 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1907
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1908 @node Tree Dired Extra, Dired Internals, Dired, Top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1909 @chapter Tree Dired Extra features
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1910
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1911 Numerous ``extra'' features are available, such as omitting certain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1912 files from listings, minibuffer history, RCS related commands, and more.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1913
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1914 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1915 * Tree Dired Extra Features::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1916 * Dired Minibuffer History::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1917 * Inserting All Marked Subdirectories::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1918 * Dynamic Dired Markers::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1919 * Omitting Files in Dired::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1920 * Advanced Dired Mark Commands::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1921 * Virtual Dired::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1922 * Multiple Dired Directories::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1923 * Dired Local Variables::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1924 * Making Relative Symbolic Links in Dired::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1925 * Letting Dired Guess What Shell Command to Apply::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1926 * dired-trns.el:: Filename Transformers for Dired Shell Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1927 * dired-cd.el:: Changing the Working Directory for Dired Shell Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1928 * dired-nstd.el:: Nested Dired format
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1929 * find-dired.el:: Feeding Find Output to Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1930 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1931
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1932 @node Tree Dired Extra Features, Dired Minibuffer History, Tree Dired Extra, Tree Dired Extra
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1933 @section Tree Dired Extra Features
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1934
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1935 The rest of this manual describes the extra features provided by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1936 file @file{dired-x.el} and some other files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1937
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1938 To take advantage of these features, you must load the file and set some
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1939 variables and hooks. See the accompanying @file{dired-x.README}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1940 file for details and a template of code to insert in your @file{.emacs}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1941
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1942 Miscellanous features not fitting anywhere else:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1943
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1944 Variables:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1945
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1946 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1947
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1948 @item dired-find-subdir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1949 @vindex dired-find-subdir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1950 Default: @code{nil}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1951
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1952 If non-nil, Dired does not make a new buffer for a directory if it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1953 can be found (perhaps as subdirectory) in some existing Dired buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1954
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1955 If there are several Dired buffers for a directory, the most recently
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1956 used is chosen.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1957
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1958 Dired avoids switching to the current buffer, so that if you have a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1959 normal and a wildcard buffer for the same directory, @kbd{C-x d RET}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1960 will toggle between those two.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1961
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1962 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1963
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1964 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1965
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1966 @findex dired-goto-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1967 @kindex M-g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1968 @item M-g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1969 (@code{dired-goto-file}) Goto file line of a file (or directory).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1970
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1971 @findex dired-goto-subdir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1972 @kindex M-G
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1973 @item M-G
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1974 (@code{dired-goto-subdir}) Goto headerline of an inserted directory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1975 This commands reads its argument with completion over the names of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1976 inserted subdirectories.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1977 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1978
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1979 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1980
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1981 @findex dired-do-background-shell-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1982 @kindex &
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1983 @cindex Input to Dired shell commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1984 @cindex Interactive Dired shell commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1985 @cindex Background Dired shell commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1986 @item &
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1987 (@code{dired-do-background-shell-command}) Run a shell command on the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1988 marked files, in the background. This requires @file{background.el}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1989 from Olin Shiver's comint package to work. Note that you can type input
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1990 to the command in its buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1991
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1992 @item w
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1993 @kindex w
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1994 @findex dired-copy-filename-as-kill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1995 (@code{dired-copy-filename-as-kill}) The @kbd{w} command puts the names
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1996 of the marked (or next @var{N}) files into the kill ring, as if you had
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1997 killed them with @kbd{C-w}. With a zero prefix argument @var{N}=0, use the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1998 complete pathname of each file. With a raw (just @kbd{C-u}) prefix argument,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1999 use the relative pathname of each marked file. As a special case, if no
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2000 prefix argument is given and point is on a directory headerline, it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2001 gives you the name of that directory, without looking for marked files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2002
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2003 @vindex dired-marked-files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2004 The list of names is also stored onto the variable @code{dired-marked-files}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2005 for use, e.g., in an @kbd{ESC ESC} (@code{eval-expression}) command.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2006
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2007 As this command also displays what was pushed onto the kill ring you can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2008 use it to display the list of currently marked files in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2009 echo area (unless you happen to be on a subdirectory headerline).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2010
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2011 You can then feed the file name to other Emacs commands with @kbd{C-y}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2012 For example, say you want to rename a long filename to a slightly
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2013 different name. First type @kbd{w} to push the old name onto the kill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2014 ring. Then type @kbd{r} to rename it and use @kbd{C-y} inside @kbd{r}'s
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2015 minibuffer prompt to insert the old name at a convenient place.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2016
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2017 @item T
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2018 @kindex T
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2019 @findex dired-do-toggle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2020 (@code{dired-do-toggle}) Toggle marks. That is, currently marked
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2021 files become unmarked and vice versa. Files marked with other flags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2022 (such as `D') are not affected. The special directories `.' and `..'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2023 are never toggled.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2024
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2025 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2026
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2027 @node Dired Minibuffer History, Inserting All Marked Subdirectories, Tree Dired Extra Features, Tree Dired Extra
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2028 @section Minibuffer History for Dired Shell Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2029
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2030 @cindex History of Minibuffer input
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2031 @cindex Minibuffer History
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2032 @cindex Gmhist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2033 @kindex !
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2034 @kindex &
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2035 @kindex M-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2036 @kindex M-n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2037 If @file{dired-x.el} determines at load-time that the Gmhist package is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2038 available, the Dired shell commands @kbd{!} and @kbd{&} maintain a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2039 history of commands. Use @kbd{M-p} and @kbd{M-n} to scroll through them
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2040 while you are prompted in the minibuffer for a shell command.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2041 @xref{Gmhist Keys in the Minibuffer,Gmhist Keys in the Minibuffer,Gmhist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2042 Keys in the Minibuffer,gmhist,The Gmhist Manual}, for more info.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2043
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2044 Gmhist also handles defaults:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2045
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2046 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2047
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2048 @vindex dired-dangerous-shell-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2049 @item dired-dangerous-shell-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2050 Default: @code{"rm"}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2051
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2052 Regexp for dangerous shell commands that should never be the default.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2053 It is deliberately chosen to match @samp{rm} anywhere in the command,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2054 e.g. in @samp{rmdir}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2055 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2056
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2057 @node Inserting All Marked Subdirectories, Dynamic Dired Markers, Dired Minibuffer History, Tree Dired Extra
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2058 @section Insert all marked subdirectories
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2059
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2060 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2061
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2062 @kindex I
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2063 @findex dired-do-insert-subdir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2064 @item I
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2065 (@code{dired-do-insert-subdir}) Insert all marked subdirectories that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2066 are not already inserted. Non-directories are silently ignored.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2067
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2068 Thus type @kbd{/I} to insert one more level of subdirectories. You can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2069 repeat this until no new directories are inserted to fully expand the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2070 directory tree in this buffer. As a faster alternative, use the prefix
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2071 argument for @kbd{C-x d} (@code{dired}) to add @samp{R} to the switches.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2072
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2073 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2074
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2075 @node Dynamic Dired Markers, Omitting Files in Dired, Inserting All Marked Subdirectories, Tree Dired Extra
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2076 @section Dynamic Marker Characters
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2077
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2078 @cindex Dynamic marker characters
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2079 @cindex Marker characters in Dired, changing them
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2080 @cindex Changing marker character in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2081 @cindex Stack of marker characters in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2082 You can change the marker character from its usual value @code{*} to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2083 something else. Use this to mark a different set of files while keeping
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2084 the information on the already marked files. You can nest several
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2085 marker characters. The current stack of marker characters is displayed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2086 in the Dired mode line, and all prompts of mark-using commands mention
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2087 to which marker they apply.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2088
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2089 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2090
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2091 @item (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2092 @kindex (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2093 @findex dired-set-marker-char
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2094 (@code{dired-set-marker-char}) Set the marker character to something
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2095 else. Use @kbd{)} to restore the previous value.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2096
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2097 @item )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2098 @kindex )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2099 @findex dired-restore-marker-char
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2100 (@code{dired-restore-marker-char}) Restore the marker character to its
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2101 previous value. Uses @code{dired-default-marker} if the marker stack is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2102 empty.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2103 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2104
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2105 @kindex A
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2106 @kindex Z
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2107 @kindex m
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2108 @kindex (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2109 Instead of using @kbd{m} inside a @kbd{(}@dots{}@kbd{)}, you can mark
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2110 files ``in passing'' with, say @samp{Z} without changing the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2111 current marker character. You will probably later use @kbd{(} to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2112 temporarily make @samp{Z} to the marker and do something on the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2113 @samp{Z}-files, and then return using @code{)}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2114
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2115 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2116
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2117 @item dired-mark-keys
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2118 Default: @code{'("Z")}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2119
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2120 List of keys (strings) that insert themselves as file markers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2121
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2122 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2123
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2124
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2125 @node Omitting Files in Dired, Advanced Dired Mark Commands, Dynamic Dired Markers, Tree Dired Extra
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2126 @section Omitting Files in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2127
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2128 @cindex Omitting Files in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2129 @dfn{Omitting} a file means removing it from the directory listing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2130 Omitting is useful for keeping Dired buffers free of uninteresting files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2131 (for instance, auto-save, auxiliary, backup, and revision control files)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2132 so that the user can concentrate on the interesting files. Like hidden
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2133 files, omitted files are never seen by Dired.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2134 @xref{Dired Hiding,Hiding in Dired,Hiding in Dired,dired,Tree Dired Manual}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2135 Omitting differs from hiding in several respects:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2136
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2137 @itemize @bullet
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2138
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2139 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2140 Omitting works on individual files, not on directories; an entire
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2141 directory cannot be omitted (though each of its files could be).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2142
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2143 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2144 Omitting is wholesale; if omitting is turned on for a dired buffer, then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2145 all ``uninteresting'' files listed in that buffer are omitted. The user
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2146 does not omit (or unomit) files one at a time.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2147
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2148 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2149 Omitting can be automatic; uninteresting file lines in the buffer can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2150 be removed before the user ever sees them.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2151
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2152 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2153 Marked files are never omitted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2154 @end itemize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2155
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2156 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2157
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2158 @item M-o
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2159 @kindex M-o
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2160 @findex dired-omit-toggle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2161 (@code{dired-omit-toggle})
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2162 Toggle between displaying and omitting ``uninteresting'' files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2163 With a prefix argument, don't toggle and just mark the files, but don't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2164 actually omit them.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2165 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2166
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2167 In order to make omitting work, you must have @code{dired-omit-expunge}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2168 on your @code{dired-after-readin-hook}, and you must call
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2169 @code{dired-omit-startup} (or @code{dired-extra-startup}, which calls
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2170 @code{dired-omit-startup}) in your @code{dired-mode-hook}. Simply
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2171 loading @file{dired-x.el} inside @code{dired-load-hook} takes care of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2172 all this.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2173
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2174 The following variables can be used to customize omitting.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2175
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2176 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2177
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2178 @vindex dired-omit-files-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2179 @item dired-omit-files-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2180
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2181 Default: @code{nil}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2182
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2183 @cindex How to make omitting the default in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2184 If non-nil, ``uninteresting'' files are not listed. Uninteresting files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2185 are those whose filenames match regexp @code{dired-omit-files}, plus those
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2186 ending with extensions in @code{dired-omit-extensions}. @kbd{M-o}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2187 (@code{dired-omit-toggle}) toggles its value, which is buffer-local. Do
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2188
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2189 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2190 (setq dired-omit-files-p t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2191 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2192
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2193 inside your @code{dired-mode-hook} to have omitting initially turned on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2194 in every Dired buffer. Since @file{dired-x.el} prepends the form
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2195 @samp{(dired-extra-startup)} to what you put yourself in your
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2196 @code{dired-mode-hook}, the @code{setq} will take place after
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2197 @code{dired-omit-files-p} has already been made local to the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2198 Dired buffer, so modelines of non-dired buffers are not affected. For
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2199 this to work you shouldn't set @code{dired-mode-hook} inside
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2200 @code{dired-load-hook}, but directly in your @file{~/.emacs} (before
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2201 Dired is loaded, if you explicitly load Dired).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2202
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2203 You can then use @kbd{M-o} to unomit in that buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2204
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2205 @vindex dired-omit-files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2206 @item dired-omit-files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2207
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2208 Default: @code{"^#\\|\\.$"}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2209
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2210 Filenames matching this buffer-local regexp will not be displayed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2211 This only has effect when @code{dired-omit-files-p} is t.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2212
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2213 The default value omits the special directories @file{.} and @file{..}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2214 and autosave files (plus other files ending in ``.'').
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2215
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2216 @vindex dired-omit-extensions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2217 @item dired-omit-extensions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2218
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2219 Default: The elements of @code{completion-ignored-extensions},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2220 @code{latex-unclean-extensions}, @code{bibtex-unclean-extensions} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2221 @code{texinfo-unclean-extensions}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2222
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2223 If non-nil, a list of extensions (strings) to omit from Dired listings.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2224 Its format is the same as that of @code{completion-ignored-extensions}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2225
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2226 @vindex dired-omit-localp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2227 @item dired-omit-localp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2228
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2229 Default: @code{'no-dir}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2230
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2231 The @var{localp} argument @code{dired-omit-expunge} passes to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2232 @code{dired-get-filename}. If it is @code{'no-dir}, omitting is much
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2233 faster, but you can only match against the non-directory part of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2234 filename. Set it to @code{nil} if you need to match the whole pathname
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2235 or @code{t} to match the pathname relative to the buffer's top-level
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2236 directory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2237
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2238 @item dired-omit-marker-char
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2239 @vindex dired-omit-marker-char
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2240
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2241 Default: @kbd{C-o}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2242
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2243 Temporary marker used by Dired to implement omitting.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2244 Should never be used as marker by the user or other packages.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2245 @cindex Omitting additional files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2246 There is one exception to this rule: by doing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2247 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2248 (setq dired-mark-keys "\C-o")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2249 ;; i.e., the value of dired-omit-marker-char
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2250 ;; (which is not defined yet)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2251 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2252 anywhere in your @file{~/.emacs}, you will bind the @kbd{C-o} key to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2253 insert a @key{C-o} marker, thus causing these files to be omitted in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2254 addition to the usually omitted files. Unfortunately the files you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2255 omitted manually this way will show up again after reverting the buffer,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2256 unlike the others.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2257
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2258 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2259
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2260 @cindex RCS files, how to omit them in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2261 @cindex Omitting RCS files in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2262 To avoid seeing RCS files and the RCS directory, do
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2263 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2264 (setq dired-omit-files "\\.$\\|#\\|^RCS$\\|,v$")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2265 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2266 This assumes @code{dired-omit-localp} has its default value of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2267 @code{'no-dir} to make the @code{^}-anchored matches work. As a slower
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2268 alternative, with @code{dired-omit-localp} set to @code{nil}, you can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2269 use @code{/} instead of @code{^} in the regexp.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2270
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2271 @cindex Tib files, how to omit them in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2272 @cindex Omitting tib files in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2273 If you use tib, the bibliography program for use with @TeX{} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2274 La@TeX{}, you might want to omit the @file{INDEX} and the @file{-t.tex}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2275 files:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2276 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2277 (setq dired-omit-files "\\.$\\|#\\|^INDEX$\\|-t\\.tex$")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2278 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2279
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2280 @node Advanced Dired Mark Commands, Virtual Dired, Omitting Files in Dired, Tree Dired Extra
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2281 @section Advanced Mark Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2282
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2283 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2284
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2285 @item M-(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2286 @kindex M-(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2287 @findex dired-mark-sexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2288 @cindex Lisp expression, marking files with in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2289 @cindex Mark file by lisp expression
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2290 (@code{dired-mark-sexp}) Mark files for which @var{predicate} returns non-nil.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2291 With a prefix argument, unflag those files instead.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2292
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2293 The @var{predicate} is a lisp expression that can refer to the following
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2294 symbols:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2295 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2296 @item inode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2297 [@i{integer}] the inode of the file (only for @samp{ls -i} output)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2298 @item s
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2299 [@i{integer}] the size of the file for @samp{ls -s} output (usually in blocks or,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2300 with @samp{-k}, in KBytes)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2301 @item mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2302 [@i{string}] file permission bits, e.g., @samp{"-rw-r--r--"}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2303 @item nlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2304 [@i{integer}] number of links to file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2305 @item uid
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2306 [@i{string}] owner
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2307 @item gid
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2308 [@i{string}] group (If the gid is not displayed by @samp{ls}, this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2309 will still be set (to the same as uid))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2310 @item size
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2311 [@i{integer}] file size in bytes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2312 @item time
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2313 [@i{string}] the time that @samp{ls} displays, e.g., @samp{"Feb 12 14:17"}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2314 @item name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2315 [@i{string}] the name of the file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2316 @item sym
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2317 [@i{string}] if file is a symbolic link, the linked-to name, else @samp{""}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2318 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2319
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2320 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2321 For example, use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2322 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2323 (equal 0 size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2324 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2325 to mark all zero length files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2326
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2327 To find out all not yet compiled Emacs lisp files in a directory, dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2328 all @file{.el} files in the lisp directory using the wildcard
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2329 @samp{*.el}. Then use @kbd{M-(} with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2330 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2331 (not (file-exists-p (concat name "c")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2332 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2333 to mark all @file{.el} files without a corresponding @file{.elc} file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2334
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2335 @item M-M
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2336 @kindex M-M
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2337 @cindex Marker character, how to replace it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2338 @cindex Replacing one marker character with another
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2339 (@code{dired-do-unmark}) Unmark marked files by replacing the marker
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2340 with another character. The new character defaults to a space,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2341 effectively unmarking them.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2342
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2343 @item ,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2344 @kindex ,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2345 @cindex RCS controlled files, how to mark them
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2346 @cindex Marking RCS controlled files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2347 (@code{dired-mark-rcs-files}) Mark all files that are under RCS control.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2348 With prefix argument, unflag all those files. Mentions RCS files for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2349 which a working file was not found in this buffer. Type @kbd{W}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2350 (@code{dired-why}) to see them again.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2351
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2352 @item C-m C-c
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2353 @kindex C-m C-c
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2354 @cindex Compilation files, how to mark them
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2355 @cindex Marking compilation files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2356 @cindex List of files, how to mark them
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2357 @cindex Marking a list of files from a buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2358 (@kbd{C-m C-c} is the suggested binding for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2359 @code{dired-mark-files-compilation-buffer}, it is not bound by default.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2360 Mark the files mentioned in the @samp{*compilation*} buffer. With an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2361 argument, you may specify the other buffer and your own regexp instead of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2362 @code{compilation-error-regexp}. Use @samp{^.+$} (the default with a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2363 prefix argument) to match complete lines. In conjunction with narrowing the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2364 other buffer you can mark an arbitrary list of files, one per line, with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2365 this command. If your regexp contains a subexpression, i.e.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2366 @samp{\(@var{...}\)}, that subexpression is taken for the file name,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2367 else the whole match is used. Thus you can easily strip pre- and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2368 suffixes from filenames by using @samp{@var{prefix}\(.+\)@var{postfix}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2369 as regexp.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2370
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2371 This is especially useful for a list of files obtained from @kbd{M-x
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2372 grep} or output from a similar shell command.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2373
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2374 @item C-m C-d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2375 @kindex C-m C-d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2376 @cindex Corresponding files, how to mark them
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2377 @cindex List of files, how to mark them
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2378 (@kbd{C-m C-d} is the suggested binding for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2379 @code{dired-mark-files-from-other-dired-buffer}, it is not bound by default.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2380 Mark those files in this Dired buffer that have the same name as the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2381 marked files in the Dired buffer in the other window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2382
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2383 In short, mark the corresponding files from the other Dired buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2384
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2385 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2386
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2387 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2388 @item F
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2389 @kindex F
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2390 @cindex Visiting several files at once
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2391 @cindex Simultaneous visiting of several files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2392 @findex dired-do-find-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2393 (@code{dired-do-find-file}) Visit all marked files at once, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2394 display them simultaneously. If you want to keep the dired buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2395 displayed, type @kbd{C-x 2} first. If you want just the marked files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2396 displayed and nothing else, type @kbd{C-x 1} first.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2397
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2398 The current window is split across all files. Remaining lines go to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2399 last window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2400
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2401 The number of files that can be displayed this way is restricted by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2402 height of the current window and the variable @code{window-min-height}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2403
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2404 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2405
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2406 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2407
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2408 @item dired-mark-extension
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2409 @findex dired-mark-extension
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2410 Mark all files with a certain extension for use in later commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2411 A @samp{.} is not automatically prepended to the string entered.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2412
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2413 When called from lisp, @var{extension} may also be a list of extensions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2414 and an optional argument @var{marker-char} specifies the marker used.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2415
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2416 @item dired-flag-extension
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2417 @findex dired-flag-extension
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2418 Flag all files with a certain extension for deletion.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2419 A @samp{.} is @emph{not} automatically prepended to the string entered.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2420
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2421 @item dired-clean-patch
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2422 @findex dired-clean-patch
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2423 Flag dispensable files created by the @samp{patch} program for deletion.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2424 See variable @code{patch-unclean-extensions}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2425
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2426 @item dired-clean-tex
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2427 @findex dired-clean-tex
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2428 Flag dispensable files created by @TeX{}, La@TeX{} and @samp{texinfo}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2429 for deletion. See variables @code{tex-unclean-extensions},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2430 @code{texinfo-unclean-extensions}, @code{latex-unclean-extensions} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2431 @code{bibtex-unclean-extensions}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2432
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2433 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2434
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2435 Variables used by the above cleanup commands (and in the default value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2436 for variable @code{dired-omit-extensions}):
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2437
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2438 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2439
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2440 @item patch-unclean-extensions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2441 @vindex patch-unclean-extensions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2442 Default: @code{'(".rej" ".orig")}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2443
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2444 List of extensions of dispensable files created by the @samp{patch} program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2445
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2446 @item tex-unclean-extensions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2447 @vindex tex-unclean-extensions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2448 Default: @code{'(".toc" ".log" ".aux")}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2449
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2450 List of extensions of dispensable files created by @TeX{}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2451
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2452 @item texinfo-unclean-extensions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2453 @vindex texinfo-unclean-extensions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2454 Default: @code{'(".cp" ".cps" ".fn" ".fns" ".ky" ".kys" ".pg" ".pgs"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2455 ".tp" ".tps" ".vr" ".vrs")}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2456
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2457 List of extensions of dispensable files created by texinfo.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2458
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2459 @item latex-unclean-extensions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2460 @vindex latex-unclean-extensions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2461 Default: @code{'(".idx" ".lof" ".lot" ".glo")}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2462
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2463 List of extensions of dispensable files created by LaTeX.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2464
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2465 @item bibtex-unclean-extensions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2466 @vindex bibtex-unclean-extensions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2467 Default: @code{'(".blg" ".bbl")}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2468
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2469 List of extensions of dispensable files created by BibTeX.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2470
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2471 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2472
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2473
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2474 @node Virtual Dired, Multiple Dired Directories, Advanced Dired Mark Commands, Tree Dired Extra
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2475 @section Virtual Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2476
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2477 @cindex Virtual Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2478 @cindex Perusing ls listings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2479 @cindex ls listings, how to peruse them in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2480 Using @dfn{Virtual Dired} means putting a buffer with Dired-like
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2481 contents in Dired mode. The files described by the buffer contents need
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2482 not actually exist. This is useful if you want to peruse an @samp{ls -lR}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2483 output file, for example one you got from an FTP server. You can use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2484 all motion commands usually available in Tree Dired. You can also use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2485 it to save a Dired buffer in a file and resume it in a later session.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2486
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2487 @findex dired-virtual
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2488 @kindex g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2489 @findex dired-virtual-revert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2490 Type @kbd{M-x dired-virtual} to put the current buffer into virtual
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2491 Dired mode. You will be prompted for the top level directory of this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2492 buffer, with a default value guessed from the buffer contents. To
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2493 convert the virtual to a real Dired buffer again, type @kbd{g} (which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2494 calls @code{dired-virtual-revert}) in the virtual Dired buffer and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2495 answer @samp{y}. You don't have to do this, though: you can relist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2496 single subdirectories using @kbd{l} (@code{dired-do-redisplay}) on the subdirectory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2497 headerline, leaving the buffer in virtual Dired mode all the time.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2498
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2499 @findex dired-virtual-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2500 @vindex auto-mode-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2501 The function @samp{dired-virtual-mode} is specially designed to turn on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2502 virtual Dired mode from the @code{auto-mode-alist}. To automatically
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2503 edit all @file{*.dired} files in virtual Dired mode, put this into your
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2504 @file{~/.emacs}:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2505
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2506 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2507 (setq auto-mode-alist (cons '("[^/]\\.dired$" . dired-virtual-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2508 auto-mode-alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2509 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2510
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2511 The regexp is a bit more complicated than usual to exclude ".dired"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2512 local variable files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2513
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2514 @node Multiple Dired Directories, Dired Local Variables, Virtual Dired, Tree Dired Extra
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2515 @section Multiple Dired Directories and Non-Dired Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2516
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2517 @cindex Multiple Dired directories
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2518 @cindex Working directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2519 An Emacs buffer can have but one working directory, stored in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2520 buffer-local variable @code{default-directory}. A Dired buffer may have
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2521 several subdirectories inserted, but still has but one working
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2522 directory: that of the top level Dired directory in that buffer. For
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2523 some commands it is appropriate that they use the current Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2524 directory instead of @code{default-directory}, e.g., @code{find-file} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2525 @code{compile}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2526
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2527 A general mechanism is provided for special handling of the working
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2528 directory in special major modes:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2529
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2530 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2531 @item default-directory-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2532 @vindex default-directory-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2533 Default: @code{((dired-mode . (dired-current-directory)))}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2534
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2535 Alist of major modes and their opinion on @code{default-directory}, as a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2536 lisp expression to evaluate. A resulting value of @code{nil} is ignored
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2537 in favor of @code{default-directory}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2538
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2539 @item default-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2540 @findex default-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2541 Function with usage like variable @code{default-directory}, but knows about the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2542 special cases in variable @code{default-directory-alist}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2543 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2544
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2545 The following dired-x commands take special care about the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2546 Dired directory:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2547
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2548 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2549
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2550 @item find-this-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2551 @findex find-this-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2552 @findex find-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2553 @kindex C-x C-f
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2554 Bind this to @kbd{C-x C-f} as a replacement for @code{find-file} that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2555 will prompt for the filename within the current Dired subdirectory, not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2556 the top level directory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2557
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2558 @item find-this-file-other-window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2559 @findex find-this-file-other-window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2560 @findex find-file-other-window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2561 @kindex C-x 4 C-f
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2562 Bind this to @kbd{C-x 4 C-f} as a replacement for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2563 @code{find-file-other-window}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2564
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2565 @item dired-smart-shell-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2566 @findex dired-smart-shell-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2567 @findex shell-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2568 @kindex M-!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2569 Like function @code{shell-command}, but in the current Tree Dired directory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2570 Bound to @kbd{M-!} in Dired buffers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2571
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2572 @item dired-smart-background-shell-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2573 @findex dired-smart-background-shell-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2574 @findex background
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2575 @kindex M-&
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2576 Like function @code{background}, but in the current Tree Dired directory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2577 Bound to @kbd{M-&} in Dired buffers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2578
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2579 @item dired-jump-back
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2580 @findex dired-jump-back
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2581 @kindex C-x j
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2582 (Suggested binding @kbd{C-x j}) Jump back to dired: If in a file, dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2583 the current directory and move to file's line. If in Dired already, pop
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2584 up a level and goto old directory's line. In case the proper Dired file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2585 line cannot be found, refresh the Dired buffer and try again.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2586
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2587 @item dired-jump-back-other-window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2588 @findex dired-jump-back-other-window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2589 @kindex C-x 4 j
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2590 (Suggested binding @kbd{C-x 4 j}) Like @code{dired-jump-back}, but to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2591 other window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2592
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2593 @item dired-vm
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2594 @kindex V
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2595 @findex dired-vm
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2596 @vindex vm-folder-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2597 (@kbd{V}) Run VM on this file (assumed to be a UNIX mail folder).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2598 Further `v' commands from within VM in that folder will default to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2599 folder's directory, not the usual @code{vm-folder-directory}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2600
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2601 @vindex dired-vm-read-only-folders
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2602 If you give this command a prefix argument, it will visit the folder
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2603 read-only. This only works in VM 5, not VM 4.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2604
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2605 If the variable @code{dired-vm-read-only-folders} is t, @code{dired-vm}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2606 will visit all folders read-only. If it is neither @code{nil} nor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2607 @code{t}, e.g., the symbol @code{'if-file-read-only}, only files not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2608 writable by you are visited read-only. This is the recommended value if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2609 you run VM 5.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2610
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2611 @item dired-rmail
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2612 @findex dired-rmail
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2613 Run Rmail on this file (assumed to be mail folder in Rmail/BABYL format).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2614
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2615 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2616
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2617 @c subsection Narrow and Widen in a Dired Buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2618
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2619 @node Dired Local Variables, Making Relative Symbolic Links in Dired, Multiple Dired Directories, Tree Dired Extra
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2620 @section Local Variables for Dired Directories
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2621
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2622 @cindex Local Variables for Dired Directories
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2623 @vindex dired-local-variables-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2624 When Dired visits a directory, it looks for a file whose name is the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2625 value of variable @code{dired-local-variables-file} (default:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2626 @file{.dired}). If such a file is found, Dired will temporarily insert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2627 it into the Dired buffer and run @code{hack-local-variables}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2628 @xref{File Variables,Local Variables in Files,Local Variables in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2629 Files,emacs,The GNU Emacs Manual}. You can set
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2630 @code{dired-local-variables-file} to @code{nil} to suppress this.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2631
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2632 For example, put
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2633
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2634 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2635 Local Variables:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2636 dired-actual-switches: "-lat"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2637 dired-sort-mode: " by date"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2638 End:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2639 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2640
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2641 into a @file{.dired} file of a directory to sort by date only in that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2642 directory. Note that since @code{dired-hack-local-variables} is run
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2643 inside @code{dired-mode-hook} the modeline has already been set, so you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2644 have to update that for yourself by setting @code{dired-sort-mode} in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2645 addition to changing the switches.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2646
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2647 @node Making Relative Symbolic Links in Dired, Letting Dired Guess What Shell Command to Apply, Dired Local Variables, Tree Dired Extra
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2648 @section Making Relative Symbolic Links in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2649
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2650 In GNU Emacs version 18, the built-in function @code{make-symbolic-link}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2651 always calls @code{expand-file-name} on its arguments, so relative
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2652 symlinks (e.g. @samp{foo -> ../bar/foo}) are impossible to create.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2653
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2654 Dired Extra uses @code{call-process} and @samp{ln -s} for a workaround.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2655
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2656 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2657
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2658 @item dired-make-symbolic-link
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2659 @findex dired-make-symbolic-link
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2660 Arguments @var{name1} @var{name2} and optional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2661 @var{ok-if-already-exists}. Create file @var{name2}, a symbolic link
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2662 pointing to @var{name1} (which may be any string whatsoever and is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2663 passed untouched to @samp{ln -s}). @var{ok-if-already-exists} means that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2664 @var{name2} will be overwritten if it already exists. If it is an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2665 integer, user will be asked about this. On error, signals a file-error.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2666
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2667 @item dired-make-relative-symlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2668 @findex dired-make-relative-symlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2669 Three arguments: @var{file1} @var{file2} and optional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2670 @var{ok-if-already-exists}. Make a symbolic link @var{file2} (pointing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2671 to @var{file1}). The link is relative (if possible), for example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2672
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2673 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2674 (dired-make-relative-symlink "/vol/tex/bin/foo"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2675 "/vol/local/bin/foo")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2676 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2677
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2678 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2679 results in a link
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2680
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2681 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2682 /vol/local/bin/foo -> ../../tex/bin/foo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2683 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2684
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2685 @item dired-do-relsymlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2686 @findex dired-do-relsymlink
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2687 (binding @kbd{S}) Symbolically link all marked (or next @var{N}) files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2688 into a directory, or make a symbolic link to the current file. This
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2689 creates relative symbolic links like
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2690
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2691 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2692 foo -> ../bar/foo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2693 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2694
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2695 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2696 not absolute ones like
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2697 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2698 foo -> /ugly/path/that/may/change/any/day/bar/foo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2699 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2700
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2701 @item dired-do-relsymlink-regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2702 @findex dired-do-relsymlink-regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2703 (@kbd{%S}) Symbolically link all marked files containing @var{regexp} to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2704 @var{newname}, using relative (not absolute) names. See functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2705 @code{dired-rename-regexp} and @code{dired-do-relsymlink} for more info.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2706
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2707 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2708
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2709 @node Letting Dired Guess What Shell Command to Apply, dired-trns.el, Making Relative Symbolic Links in Dired, Tree Dired Extra
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2710 @section Letting Dired Guess What Shell Command to Apply
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2711
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2712 Based upon the name of a filename, Dired tries to guess what shell
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2713 command you might want to apply to it. For example, if you have point
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2714 on a file named @file{foo.tar} and you press @kbd{!}, Dired will guess
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2715 you want to @samp{tar xvf} it and suggest that as the default shell
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2716 command.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2717
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2718 If you are using the @file{gmhist} package (@xref{Dired Minibuffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2719 History}), the default will be mentioned in brackets and you can type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2720 @kbd{M-p} to get the default into the minibuffer so that you can edit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2721 it, e.g., changing @samp{tar xvf} to @samp{tar tvf}. If there are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2722 several commands for a given file, e.g., @samp{xtex} and @samp{dvips}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2723 for a @file{.dvi} file, you can type @kbd{M-p} several times to see each
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2724 of the matching commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2725
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2726 Dired only tries to guess a command for a single file, never for a list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2727 of marked files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2728
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2729 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2730
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2731 @item dired-auto-shell-command-alist-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2732 @vindex dired-auto-shell-command-alist-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2733
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2734 Predefined rules for shell commands. Set this to nil to turn guessing off.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2735 The elements of @code{dired-auto-shell-command-alist} (defined by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2736 user) will override these rules.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2737
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2738 @item dired-auto-shell-command-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2739 @vindex dired-auto-shell-command-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2740
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2741 If non-nil, an alist of file regexps and their suggested commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2742 overriding the predefined rules in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2743 @code{dired-auto-shell-command-alist-default}.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2744
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2745 Each element of the alist looks like
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2746
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2747 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2748 (@var{regexp} @var{command}@dots{})
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2749 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2750
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2751 where each @var{command} can either be a string or a lisp expression
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2752 that evaluates to a string. If several @var{COMMAND}s are given, all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2753 will temporarily be pushed on the history.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2754
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2755 These rules take precedence over the predefined rules in the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2756 @code{dired-auto-shell-command-alist-default} (to which they are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2757 prepended when @file{dired-x} is loaded).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2758
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2759 You can set this variable in your @file{~/.emacs}. For example,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2760 to add rules for @samp{.foo} and @samp{.bar} file extensions, write
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2761
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2762 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2763 (setq dired-auto-shell-command-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2764 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2765 (list "\\.foo$" "@var{foo-command}");; fixed rule
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2766 ;; possibly more rules...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2767 (list "\\.bar$";; rule with condition test
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2768 '(if @var{condition}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2769 "@var{bar-command-1}"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2770 "@var{bar-command-2}"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2771 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2772
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2773 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2774 This will override any predefined rules for the same extensions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2775
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2776 @item dired-guess-have-gnutar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2777 @vindex dired-guess-have-gnutar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2778
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2779 Default: @code{nil}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2780
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2781 If non-nil, name of the GNU tar executable (e.g., @samp{"tar"} or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2782 @samp{"gnutar"}). GNU tar's @samp{z} switch is used for compressed tar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2783 files. If you don't have GNU tar, set this to nil: a pipe using
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2784 @samp{zcat} is then used.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2785
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2786 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2787
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2788 @node dired-trns.el, dired-cd.el, Letting Dired Guess What Shell Command to Apply, Tree Dired Extra
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2789 @section Filename Transformers for Dired Shell Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2790
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2791 @cindex Transformer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2792 @cindex Basename of a file, how to use in Dired shell commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2793 @cindex Extension of a file, how to use in Dired shell commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2794 File name @dfn{transformers} are functions that take a filename (a string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2795 as an argument and transform it into some other string (e.g., a filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2796 without an extension). This package makes transformers available in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2797 Dired shell commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2798
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2799 For example, running the Dired shell command (type @kbd{!} or @kbd{M-x}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2800 @code{dired-do-shell-command})@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2801
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2802 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2803 echo * [b] [db]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2804 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2805
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2806 would list the full name, the basename, and the absolute basename of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2807 each marked file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2808
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2809 Each transformer is associated with a dispatch character. The associations
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2810 are stored in a keymap for fast and easy lookup. The dispatch character
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2811 is used to activate the associated transformer function at a particular
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2812 position in a shell command issued in Dired. The dispatch character
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2813 must be enclosed in brackets to distinguish it from normal letters.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2814
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2815 To take advantage of this package, simply load it after loading Dired,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2816 e.g., in your @code{dired-load-hook}. You can then use transformers like
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2817 "[b]" for the basename in your Dired shell commands (see below).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2818
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2819 You can define your own transformers using the macro @code{dired-trans-define}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2820
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2821 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2822
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2823 @item dired-trans-define
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2824 @findex dired-trans-define
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2825 Macro that assigns the transformer function @code{(lambda (file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2826 @var{body})} to @var{char} (a character or string). @var{body} must
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2827 return a string: the transformed file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2828 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2829
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2830 Several transformers are predefined:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2831
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2832 @table @samp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2833
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2834 @item *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2835 returns the unmodified filename (equivalent to @samp{[dbe]}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2836
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2837 @item n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2838 returns the Name component of a filename without directory information
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2839
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2840 @item d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2841 returns the Directory component of a filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2842
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2843 @item b
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2844 returns the Basename of a filename, i.e., the name of the file without
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2845 directory and extension (see variable @code{dired-trans-re-ext})
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2846 A basename with directory component can be obtained by @samp{[db]}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2847
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2848 @item e
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2849 returns the Extension of a filename (i.e., whatever
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2850 @code{dired-trans-re-ext} splits off)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2851
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2852 @item v
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2853 returns a file without directory and without @file{,v} suffixes if any.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2854
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2855 @item z
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2856 returns a file without directory and without @file{.Z} suffixes if any.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2857
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2858 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2859
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2860 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2861 The following variables can be used to customize @file{dired-trns.el}:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2862
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2863 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2864
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2865 @item dired-trans-re-ext
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2866 @vindex dired-trans-re-ext
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2867 Default: @code{"\\.[^.]*\\(\\.Z\\)?$"}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2868
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2869 The part of a filename matching this regexp will be viewed as extension.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2870
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2871 @item dired-trans-starters
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2872 @vindex dired-trans-starters
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2873 Default: @code{"[#[]"}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2874
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2875 User definable set of characters to be used to indicate the start of a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2876 transformer sequence.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2877
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2878 @item dired-trans-enders
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2879 @vindex dired-trans-enders
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2880 Default: @code{"[]# ]"}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2881
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2882 User definable set of characters to be used to indicate the end of a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2883 transformer sequence.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2884
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2885 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2886
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2887 @node dired-cd.el, dired-nstd.el, dired-trns.el, Tree Dired Extra
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2888 @section Changing the Working Directory for Dired Shell Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2889
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2890 The package @file{dired-cd.el} permits the working directory of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2891 Dired shell commands @kbd{!} (@code{dired-do-shell-command}) and @kbd{&}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2892 (@code{dired-do-background-shell-command}) to be the files' subdirectory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2893 under certain circumstances. Loading this extension does not change the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2894 behavior of Dired until the variables @code{dired-cd-same-subdir} and/or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2895 @code{dired-cd-on-each} are non-nil.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2896
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2897 @vindex dired-cd-same-subdir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2898 If @code{dired-cd-same-subdir} is non-nil and if all the selected files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2899 (marked, non-zero numeric argument, etc.) are in the same subdirectory,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2900 then @code{dired-do-shell-command} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2901 @code{dired-do-background-shell-command} cause the shell to perform a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2902 @samp{cd} into that directory before the commands are executed. Also,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2903 the selected filenames are provided to the command without any directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2904 components.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2905
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2906 @vindex dired-cd-on-each
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2907 If @code{dired-cd-on-each} is non-nil and if the @samp{on-each} option
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2908 is specified (numeric argument of zero), then @kbd{!}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2909 (@code{dired-do-shell-command}) and @kbd{&}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2910 (@code{dired-mark-background-shell-command}) use a subshell to perform a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2911 @samp{cd} into the subdirectory of each file before the commands on that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2912 file are executed. Also, each filename is provided to the command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2913 without any directory components. Note that this behavior occurs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2914 regardless of whether the files are all in the same directory or not.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2915
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2916 After the above @samp{cd} wrapping has occured, the existing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2917 @code{dired-shell-stuff-it} is used to do the actual file-name quoting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2918 and substitution into the command. Thus, custom versions of this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2919 procedure should work, e.g., the @samp{dired-trans} package will transform
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2920 commands correctly. However, since filenames lack any directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2921 components, features that use the directory components will fail, e.g.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2922 the @samp{[d]} transform specifier will be empty.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2923
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2924 To use this package, load it in your @code{dired-load-hook}. Do
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2925
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2926 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2927 (setq dired-cd-same-subdir t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2928 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2929
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2930 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2931 and perhaps
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2932
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2933 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2934 (setq dired-cd-on-each t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2935 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2936
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2937 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2938 in your @file{~/.emacs}. By default, @code{dired-cd} doesn't change the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2939 behavior of Dired when it is loaded.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2940
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2941 @vindex dired-cd-same-subdir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2942 If @code{dired-cd-same-subdir} is non-nil, then the shell commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2943 @samp{cd} to the appropriate directory if all the selected files are in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2944 that directory; however, on-each behavior (with zero prefix argument) is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2945 not changed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2946
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2947 @vindex dired-cd-on-each
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2948 If @code{dired-cd-on-each} is non-nil, then each instance of the command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2949 for an on-each shell command runs in the file's directory regardless of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2950 whether the files are all in the same directory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2951
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2952 @node dired-nstd.el, find-dired.el, dired-cd.el, Tree Dired Extra
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2953 @section Nested Dired format
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2954
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2955 [NO DOCUMENTATION YET]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2956
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2957 This is still buggy, @xref{Dired Known Problems}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2958
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2959 @node find-dired.el, , dired-nstd.el, Tree Dired Extra
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2960 @section Feeding Find Output to Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2961
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2962 @cindex Find and Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2963 The @code{find-dired} command runs the @samp{find} command in a buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2964 and starts Dired on the inserted file lines, even while @samp{find} is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2965 still running. For example, with @samp{-type d} as argument, you will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2966 get a Dired buffer that contains all subdirectories of a given
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2967 directory, but none of the other files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2968
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2969 Note that @samp{find} just gives you file lines, not inserted
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2970 subdirectories with associated headerlines as repeated use of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2971 @kbd{i} (@code{dired-maybe-insert-subdir}) command would. Also, the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2972 names contain slashes if they are in a subdirectory, which never occurs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2973 in a normal Dired buffer. Dired understands these names anyway and you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2974 can for example type @kbd{f} on such lines as usual. However, while
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2975 @samp{find} is still running you shouldn't type @kbd{i} to insert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2976 subdirectories, since new @samp{find} output is always appended at the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2977 end. Use @kbd{f} or @kbd{o} instead to dired the specific subdirectory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2978 in a new Dired buffer. After @samp{find} has finished (as indicated by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2979 a message and the modeline) all Dired commands work as usual.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2980
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2981 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2982
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2983 @item find-dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2984 @findex find-dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2985 Run @samp{find} on a directory @var{dir}, with find arguments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2986 @var{args}, and go into dired-mode on a buffer of the output. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2987 command run (after changing into @var{dir}) is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2988 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2989 find . \( @var{args} \) -ls
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2990 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2991
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2992 @item find-name-dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2993 @findex find-name-dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2994 Search @var{dir} recursively for files matching the globbing pattern
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2995 @var{pattern}, and run Dired on those files. @var{pattern} is a shell
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2996 wildcard (not an Emacs regexp) and need not be quoted. The command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2997 run (after changing into @var{dir}) is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2998 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2999 find . -name '@var{pattern}' -ls
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3000 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3001
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3002 @item find-grep-dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3003 @findex find-grep-dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3004 Find files in directory @var{dir} containing a regexp @var{arg} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3005 start Dired on output. The command run (after changing into @var{dir})
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3006 is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3007 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3008 find . -exec grep -s @var{arg} @{@} \; -ls
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3009 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3010 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3011
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3012 @node Dired Internals, Dired Known Problems, Tree Dired Extra, Top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3013 @appendix Dired Internals
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3014
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3015 This is a short introduction about how Dired's Tree and Mark features
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3016 work. You are encouraged to read the code (@file{dired.el}) for more
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3017 information.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3018
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3019 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3020 * Tree Dired Internals::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3021 * Dired Mark Internals::
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3022 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3023
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3024 @node Tree Dired Internals, Dired Mark Internals, Dired Internals, Dired Internals
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3025 @section Tree Dired Internals
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3026
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3027 @cindex Internals of Tree Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3028 @cindex Tree Dired Internals
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3029 @vindex dired-subdir-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3030 @vindex default-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3031 In Tree Dired, instead of just one directory, all or part of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3032 directory @emph{tree} starting at the top level directory (the working
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3033 directory or @code{default-directory} of the buffer) may be in a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3034 Dired buffer. Each file line belongs to exactly one of those
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3035 subdirectories. After the @code{ls} program has inserted its output,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3036 Dired parses the buffer once to find out where the subdirectory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3037 boundaries are and saves them in the variable @code{dired-subdir-alist}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3038 The beginning of the headerline inserted by @code{ls} serves as boundary
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3039 between subdirectories.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3040
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3041 @kindex i
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3042 @findex dired-maybe-insert-subdir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3043 Subsequent @kbd{i} (@code{dired-maybe-insert-subdir}) commands update this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3044 alist and insert the appropriate headerline. Each retrieval of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3045 filename on the current line first extracts the basename (assuming a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3046 more or less standard @code{ls} output format), and then function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3047 @code{dired-current-directory} looks up the current Dired directory in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3048 @code{dired-subdir-alist}. The lookup is keyed on buffer position, as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3049 each buffer position is between exactly two subdirectory boundaries. (The end
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3050 of the buffer serves as an implicit subdirectory boundary.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3051
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3052 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3053
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3054 @item dired-subdir-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3055 @vindex dired-subdir-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3056 Association list of subdirectories and their buffer positions:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3057
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3058 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3059 ((@var{lastdir} . @var{lastmarker}) @dots{} (@var{default-directory} . @var{firstmarker})).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3060 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3061
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3062 The markers point right before the beginning of the line, so that they
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3063 separate subdirectories adjacent in the buffer. The directories must be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3064 in the form returned by @code{file-name-as-directory}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3065
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3066 @item dired-subdir-regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3067 @vindex dired-subdir-regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3068 Value: "^. \\([^ \n\r]+\\)\\(:\\)[\n\r]"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3069
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3070 Regexp matching a maybe hidden subdirectory line in @samp{ls -lR}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3071 output. Subexpression 1 is subdirectory proper, no trailing colon. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3072 match starts at the beginning of the line and ends after the end of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3073 line (@samp{\n} or @samp{\r}). Subexpression 2 must end right before
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3074 the @samp{\n} or @code{\r}. This is so that Dired can easily check
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3075 whether a subdirectory is hidden or not: hidden lines end with @samp{\r}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3076 (@kbd{C-m}) instead of a newline.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3077
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3078 This regexp used to be @code{"^. \\(/[^\n\r]*\\)\\(:\\)[\n\r]"},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3079 allowing spaces, but disallowing relative filenames (which occur when
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3080 browsing ls -lR listing in virtual Dired mode, so I changed it).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3081
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3082 Note that @code{"^. \\([^\n\r]+\\)\\(:\\)[\n\r]"} (desirable since it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3083 allows both spaces and relative names) will not always work: if you have
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3084 a file that ends in a colon, its whole line (including permission bits,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3085 date etc.) would be mistaken for a subdirectory headerline when parsing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3086 @samp{ls -lR} output.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3087
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3088 @code{dired-subdir-regexp} is only relevant for parsing @samp{ls -lR}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3089 output. If Dired inserts subdirectories itself (using
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3090 @code{dired-insert-subdir}), they will always be absolute and there is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3091 no restriction on the format of filenames, e.g., they can contain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3092 spaces.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3093
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3094 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3095
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3096 @node Dired Mark Internals, , Tree Dired Internals, Dired Internals
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3097 @section Dired Mark Internals
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3098
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3099 This is a short overview about how marking files and retrieving marked
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3100 files in Dired works.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3101
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3102 @cindex Internal of Dired file marking
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3103 @cindex Dired file marking internals
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3104 @cindex File marking internals in Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3105 @cindex Marking files in Dired, internals of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3106 @code{ls} output is indented two spaces two make room for an optional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3107 marker character in front of each file line. Marking simply replaces the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3108 first space with the marker character, usually @code{*} or, for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3109 deletions, @code{D}. Indenting just by one would leave the markers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3110 adjacent to the permission bits.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3111
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3112 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3113
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3114 @item dired-mark-if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3115 @findex dired-mark-if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3116 The macro @code{dired-mark-if} is used internally to mark files matching
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3117 certain criteria. It takes two arguments, the @var{predicate}, a lisp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3118 expression evaluating non-nil on file lines to be marked, and @var{msg},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3119 a message to be displayed while scanning the buffer. @var{msg} may be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3120 nil to suppress the message.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3121
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3122 @findex dired-mark-map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3123 @item dired-mark-map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3124 To operate on the marked files, all internal Dired functions ultimately
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3125 call the macro @code{dired-mark-map}. It takes two arguments,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3126 @var{body} and @var{arg}, plus an optional argument @var{show-progress}:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3127
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3128 Perform @var{body} with point somewhere on each marked line (inside a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3129 @code{save-excursion}) and return a list of @var{body}'s results. If no
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3130 marked file could be found, execute @var{body} on the current line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3131
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3132 If @var{arg} is an integer, use the next @var{arg} (or previous
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3133 -@var{arg}, if @var{arg}<0) files instead of the marked files. In that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3134 case point is dragged along. This is so that commands on the next ARG
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3135 (instead of the marked) files can be chained easily. Note that for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3136 positive ARG point is left on the first file not operated upon, for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3137 negative on the last file operated upon
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3138
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3139 If @var{arg} is otherwise non-nil, use current file instead.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3140
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3141 If optional third argument @var{show-progress} evaluates to non-nil, we
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3142 redisplay the Dired buffer after each file is processed. No guarantee
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3143 is made about the position on the marked line. @var{body} must ensure
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3144 this itself if it depends on this. Search starts at the beginning of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3145 the buffer, thus the @code{car} of the list corresponds to the line nearest to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3146 the buffer's bottom. This is also true for (positive and negative)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3147 integer values of @var{arg}. The @var{body} should not be too long as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3148 it is expanded four times.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3149
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3150 @c This warning should no longer apply. sk 6-Sep-1991 16:28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3151 @c Warning: @var{body} must not add new lines before point - this may cause
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3152 @c an endless loop.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3153
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3154 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3155
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3156 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3157 A common case is to retrieve the names of all marked files:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3158
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3159 @table @code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3160
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3161 @findex dired-mark-get-files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3162 @item dired-mark-get-files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3163 Return the marked files as list of strings. The list is in the same
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3164 order as the buffer, that is, the car is the first marked file. Values
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3165 returned are normally absolute pathnames. Optional argument @var{localp}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3166 equal to @code{no-dir} means return the filename proper only, with no
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3167 directory information; any other non-nil value means make them relative
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3168 to default-directory. Optional second argument @var{arg} forces use of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3169 other files. If @var{arg} is an integer, use the next @var{arg} files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3170 If @var{arg} is otherwise non-nil, use the current file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3171
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3172 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3173
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3174 @node Dired Known Problems, Dired Variable Index, Dired Internals, Top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3175 @appendix Known Problems with Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3176
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3177 There are some problems with Dired that are either not Dired's fault,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3178 hard to fix or not worth fixing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3179
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3180 @itemize @bullet
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3181
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3182 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3183 Renaming directories usually works fine (all affected Dired and file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3184 buffers are updated), but moving a directory between different
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3185 filesystems (those on different hard disks or different partitions) does
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3186 not work: it creates a plain target file containing the contents of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3187 original directory (inodes and filenames) or fails completely.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3188
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3189 Unfortunately Emacs' builtin function @code{rename-file} does not give
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3190 you a clear error message like @samp{cross-device link attempted}, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3191 rather a spurious @code{(file-error "Removing old name" "not owner")},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3192 at least in Emacs 18.55.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3193
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3194 On some systems renaming a directory always fails (even within
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3195 the same filesystem) with the spurious @samp{not owner} error.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3196 @c This was reported for HP-UX.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3197 @c
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3198 @c On one system (IBM Rs6000 running AIX 3.1.3) date lossage was reported,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3199 @c but this was not reproducible.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3200
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3201 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3202 If @file{foo} is a symlink to a non-existing file, @code{(file-exists-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3203 "foo")} returns nil. Thus, Dired will overwite such (strange) kinds of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3204 symlinks without noticing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3205
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3206 Dired could test both @code{file-symlink-p} and @code{file-exists-p},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3207 but this would slow down all file operations to catch a very rare case.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3208
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3209 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3210 Copying a directory does not work - it results in a zero-length
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3211 target file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3212
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3213 This comes from Emacs' @code{copy-file} function, not from Dired.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3214
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3215 If you really want to copy a directory (recursively), use `!' and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3216 your favorite shell command to do it (e.g. cp -R or cp -r).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3217
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3218 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3219 Initial spaces in a filename are not recognized. If I could be sure
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3220 that all @samp{ls} programs insert exactly one space between the time and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3221 the filename, I could easily fix this. But @samp{ls} programs tend to vary
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3222 in their amount of white space, and even with one @samp{ls} program there
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3223 is a difference between year and clocktime formats
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3224 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3225 drwxr-xr-x 2 ab027 thp 512 Aug 13 1990 thp/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3226 drwxr-xr-x 4 ab027 thp 512 Feb 3 21:59 ./
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3227 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3228 If your @samp{ls} supports the @samp{-b} switch and quotes spaces with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3229 that switch, simply add @samp{b} to your @code{dired-listing-switches}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3230 @xref{Listing Files in Dired}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3231
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3232 Spaces anywhere but at the beginning do work.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3233
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3234 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3235 In general, only commands that may have targets outside of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3236 current directory tree update other buffers (copy, move and link
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3237 commands).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3238
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3239 Especially, deletions, (un)compress, chmod/chgrp/chown update only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3240 the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3241
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3242 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3243 Some compress programs make output even if all goes well. Dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3244 takes output as a sign of trouble and assumes that the subprocess
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3245 failed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3246
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3247 Redefine function @code{dired-check-process-checker} suitably to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3248 look closer at the generated output. In Emacs 19, the exit status
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3249 of compress will be checked.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3250
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3251 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3252 Aliases like @samp{rm -i} for @samp{rm} or @samp{ls -F} for @samp{ls}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3253 can cause problems in Dired's (and Emacs') shell command. (Aliases for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3254 @samp{ls} only matter if you dired wildcards, because only then the shell is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3255 used to run @samp{ls}.) Csh expands aliases only for interactive shells, which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3256 is probably what you want. In Bash, you can achieve this by testing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3257 @code{PS1} in your @file{~/.bashrc}:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3258 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3259 # `.bashrc' file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3260 # this test fails when invoked by rsh
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3261 if [ "$@{PS1-no@}" != "no" ] # is this an interactive shell?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3262 then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3263 . ~/.bash_alias # if so, source aliases
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3264 fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3265 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3266
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3267 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3268 Directory names starting with @file{-} (a minus) may lose when they are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3269 to be created or removed. If you care about this, and your rmdir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3270 and mkdir understand about @file{--} meaning end of options, change
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3271 @file{emacs-19.el} accordingly.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3272
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3273 In Emacs 19 the @code{make-directory} and @code{remove-directory}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3274 operations will be builtin, not implemented with @samp{rmdir} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3275 @samp{mkdir} subprocesses.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3276
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3277 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3278 @file{dired-nstd.el}: This is still buggy. For example, after you've
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3279 compressed the last file it may not correctly return that file's
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3280 absolute pathname (@code{dired-current-directory} erronously returns nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3281 because of markers collapsed during redisplay), ultimately leading to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3282 lisp errors.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3283
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3284 @c Not longer a problem as of dired-version 5.242, sk 28-Jan-1992 11:17.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3285 @c @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3286 @c Symbolic links to directories are sometimes strange. On System V
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3287 @c derived systems (e.g., DG/UX, AIX/370), after
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3288 @c @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3289 @c mkdir dir; ln -s dir link
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3290 @c @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3291 @c both @file{link} and @file{link/} are considered symbolic links by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3292 @c @samp{stat(2)} system call, while on BSD derived systems (e.g., Sun OS,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3293 @c Mach, HP/UX, Ultrix) @file{link/} is considered a directory. In
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3294 @c general, the BSD behaviour is preferable, at least for Dired. On the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3295 @c other systems it is cumbersome to get Dired to dereference those links.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3296
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3297 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3298 The regexp-using @kbd{%}-commands get into an endless loop if you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3299 specify a regular expression that matches the empty string.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3300
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3301 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3302 Function @code{find-alternate-file} in Emacs 18.57 has a bug that causes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3303 @kbd{C-x C-v RET} (which usually re-visits the current buffer) to fail
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3304 on Dired buffers. This is fixed in the version in @file{emacs-19.el},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3305 automatically loaded by Dired.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3306
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3307 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3308 It is not possible to resort the Dired buffer without reverting it. That
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3309 would be hard to implement (and slow to run) given that ls date format
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3310 would have to be parsed for @samp{ls -t} sorting order.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3311
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3312 @end itemize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3313
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3314 @node Dired Variable Index, Dired Function Index, Dired Known Problems, Top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3315 @unnumbered Dired Variable Index
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3316 @printindex vr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3317
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3318 @node Dired Function Index, Dired Key Index, Dired Variable Index, Top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3319 @unnumbered Dired Function Index
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3320 @printindex fn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3321
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3322 @node Dired Key Index, Dired Concept Index, Dired Function Index, Top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3323 @unnumbered Dired Key Index
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3324 @printindex ky
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3325
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3326 @node Dired Concept Index, , Dired Key Index, Top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3327 @unnumbered Dired Concept Index
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3328 @printindex cp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3329
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3330 @c @summarycontents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3331 @contents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3332
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3333 @bye
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3334