Mercurial > emacs
annotate etc/dired-ref.tex @ 78271:713172dcf518
Switch license to GPLv3 or later.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Wed, 25 Jul 2007 06:47:31 +0000 |
parents | b5d2e3c4669c |
children | 1dd7437446ea f55f9811f5d7 |
rev | line source |
---|---|
30871 | 1 % Reference Card for Dired |
65088
f05a048483cc
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64092
diff
changeset
|
2 % Copyright (C) 2000, 2001, 2002, 2003, 2004, |
75329
77e0772c5159
Update copyright for years from Emacs 21 to present (mainly adding
Glenn Morris <rgm@gnu.org>
parents:
68640
diff
changeset
|
3 % 2005, 2006, 2007 Free Software Foundation, Inc. |
30871 | 4 |
5 % This file is part of GNU Emacs. | |
6 | |
7 % GNU Emacs is free software; you can redistribute it and/or modify | |
8 % it under the terms of the GNU General Public License as published by | |
78271
713172dcf518
Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents:
76609
diff
changeset
|
9 % the Free Software Foundation; either version 3, or (at your option) |
30871 | 10 % any later version. |
11 | |
12 % GNU Emacs is distributed in the hope that it will be useful, | |
13 % but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 % GNU General Public License for more details. | |
16 | |
17 % You should have received a copy of the GNU General Public License | |
18 % along with GNU Emacs; see the file COPYING. If not, write to | |
64083 | 19 % the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
20 % Boston, MA 02110-1301, USA. | |
30871 | 21 |
22 % This file can be printed with 1, 2, or 3 columns per page (see below). | |
23 % Specify how many you want here. Nothing else needs to be changed. | |
24 %**start of header | |
25 | |
26 \newcount\columnsperpage | |
27 | |
28 \columnsperpage=2 | |
29 | |
30 % This file is intended to be processed by plain TeX (TeX82). | |
31 % The reference card looks OK with 2 columns per page, portrait mode. | |
32 % I haven't tried it with 3 columns per page. | |
33 | |
34 % This is a bit of a dirty hack on the GNU Emacs reference card | |
35 % to produce a Dired reference card instead. | |
36 | |
35680 | 37 % I (Evgeny Roubinchtein, eroubinc@u.washington.edu) put this together |
38 % because I wanted a Dired reference card, | |
30871 | 39 % but couldn't find anything on the 'net. |
40 % Based mostly off Dired's describe-mode. | |
41 | |
42 | |
43 \def\versionnumber{0.1} | |
75329
77e0772c5159
Update copyright for years from Emacs 21 to present (mainly adding
Glenn Morris <rgm@gnu.org>
parents:
68640
diff
changeset
|
44 \def\year{2007} % latest copyright year |
77e0772c5159
Update copyright for years from Emacs 21 to present (mainly adding
Glenn Morris <rgm@gnu.org>
parents:
68640
diff
changeset
|
45 \def\version{May 2006\ v\versionnumber} |
30871 | 46 |
47 \def\shortcopyrightnotice{\vskip 1ex plus 2 fill | |
48 \centerline{\small \copyright\ \year\ Free Software Foundation, Inc. | |
49 Permissions on back. v\versionnumber}} | |
50 | |
51 \def\copyrightnotice{ | |
52 \vskip 1ex plus 2 fill\begingroup\small | |
53 \centerline{Copyright \copyright\ \year\ Free Software Foundation, Inc.} | |
54 \centerline{designed by Stephen Gildea, \version} | |
55 \centerline{for GNU Emacs version 19 on Unix systems} | |
36868 | 56 \centerline{Updated for Dired in May 2000 by Evgeny Roubinchtein} |
30871 | 57 |
58 Permission is granted to make and distribute copies of | |
59 this card provided the copyright notice and this permission notice | |
60 are preserved on all copies. | |
61 | |
62 For copies of the GNU Emacs manual, write to the Free Software | |
64092 | 63 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
64 MA 02110-1301, USA. | |
30871 | 65 |
66 \endgroup} | |
67 | |
68 % make \bye not \outer so that the \def\bye in the \else clause below | |
69 % can be scanned without complaint. | |
70 \def\bye{\par\vfill\supereject\end} | |
71 | |
72 \newdimen\intercolumnskip %horizontal space between columns | |
73 \newbox\columna %boxes to hold columns already built | |
74 \newbox\columnb | |
75 | |
76 \def\ncolumns{\the\columnsperpage} | |
77 | |
35680 | 78 \message{[\ncolumns\space |
30871 | 79 column\if 1\ncolumns\else s\fi\space per page]} |
80 | |
81 \def\scaledmag#1{ scaled \magstep #1} | |
82 | |
83 % This multi-way format was designed by Stephen Gildea October 1986. | |
84 % Note that the 1-column format is fontfamily-independent. | |
85 \if 1\ncolumns %one-column format uses normal size | |
86 \hsize 4in | |
87 \vsize 10in | |
88 \voffset -.7in | |
89 \font\titlefont=\fontname\tenbf \scaledmag3 | |
90 \font\headingfont=\fontname\tenbf \scaledmag2 | |
91 \font\smallfont=\fontname\sevenrm | |
92 \font\smallsy=\fontname\sevensy | |
93 | |
94 \footline{\hss\folio} | |
95 \def\makefootline{\baselineskip10pt\hsize6.5in\line{\the\footline}} | |
96 \else %2 or 3 columns uses prereduced size | |
97 \hsize 3.4in | |
76184
8340a8571aa8
(vsize): Increase in 2 column case to make room for copyright notice.
Glenn Morris <rgm@gnu.org>
parents:
75329
diff
changeset
|
98 \vsize 9.2in |
30871 | 99 \hoffset -.75in |
100 \voffset -.745in | |
101 \font\titlefont=cmbx10 \scaledmag2 | |
102 \font\headingfont=cmbx10 \scaledmag1 | |
103 \font\smallfont=cmr6 | |
104 \font\smallsy=cmsy6 | |
105 \font\eightrm=cmr8 | |
106 \font\eightbf=cmbx8 | |
107 \font\eightit=cmti8 | |
108 \font\eighttt=cmtt8 | |
109 \font\eightmi=cmmi8 | |
110 \font\eightsy=cmsy8 | |
111 \textfont0=\eightrm | |
112 \textfont1=\eightmi | |
113 \textfont2=\eightsy | |
114 \def\rm{\eightrm} | |
115 \def\bf{\eightbf} | |
116 \def\it{\eightit} | |
117 \def\tt{\eighttt} | |
118 \normalbaselineskip=.8\normalbaselineskip | |
119 \normallineskip=.8\normallineskip | |
120 \normallineskiplimit=.8\normallineskiplimit | |
121 \normalbaselines\rm %make definitions take effect | |
122 | |
123 \if 2\ncolumns | |
124 \let\maxcolumn=b | |
125 \footline{\hss\rm\folio\hss} | |
126 \def\makefootline{\vskip 2in \hsize=6.86in\line{\the\footline}} | |
127 \else \if 3\ncolumns | |
128 \let\maxcolumn=c | |
129 \nopagenumbers | |
130 \else | |
131 \errhelp{You must set \columnsperpage equal to 1, 2, or 3.} | |
132 \errmessage{Illegal number of columns per page} | |
133 \fi\fi | |
134 | |
135 \intercolumnskip=.46in | |
136 \def\abc{a} | |
137 \output={% %see The TeXbook page 257 | |
138 % This next line is useful when designing the layout. | |
139 %\immediate\write16{Column \folio\abc\space starts with \firstmark} | |
140 \if \maxcolumn\abc \multicolumnformat \global\def\abc{a} | |
141 \else\if a\abc | |
142 \global\setbox\columna\columnbox \global\def\abc{b} | |
143 %% in case we never use \columnb (two-column mode) | |
144 \global\setbox\columnb\hbox to -\intercolumnskip{} | |
145 \else | |
146 \global\setbox\columnb\columnbox \global\def\abc{c}\fi\fi} | |
147 \def\multicolumnformat{\shipout\vbox{\makeheadline | |
148 \hbox{\box\columna\hskip\intercolumnskip | |
149 \box\columnb\hskip\intercolumnskip\columnbox} | |
150 \makefootline}\advancepageno} | |
151 \def\columnbox{\leftline{\pagebody}} | |
152 | |
153 \def\bye{\par\vfill\supereject | |
154 \if a\abc \else\null\vfill\eject\fi | |
155 \if a\abc \else\null\vfill\eject\fi | |
35680 | 156 \end} |
30871 | 157 \fi |
158 | |
159 % we won't be using math mode much, so redefine some of the characters | |
160 % we might want to talk about | |
161 \catcode`\^=12 | |
162 \catcode`\_=12 | |
163 | |
164 \chardef\\=`\\ | |
165 \chardef\{=`\{ | |
166 \chardef\}=`\} | |
167 | |
168 \hyphenation{mini-buf-fer} | |
169 \hyphenation{de-le-tion} | |
170 | |
171 \parindent 0pt | |
172 \parskip 1ex plus .5ex minus .5ex | |
173 | |
174 \def\small{\smallfont\textfont2=\smallsy\baselineskip=.8\baselineskip} | |
175 | |
176 % newcolumn - force a new column. Use sparingly, probably only for | |
177 % the first column of a page, which should have a title anyway. | |
178 \outer\def\newcolumn{\vfill\eject} | |
179 | |
180 % title - page title. Argument is title text. | |
181 \outer\def\title#1{{\titlefont\centerline{#1}}\vskip 1ex plus .5ex} | |
182 | |
183 % section - new major section. Argument is section name. | |
184 \outer\def\section#1{\par\filbreak | |
185 \vskip 3ex plus 2ex minus 2ex {\headingfont #1}\mark{#1}% | |
186 \vskip 2ex plus 1ex minus 1.5ex} | |
187 | |
188 \newdimen\keyindent | |
189 | |
190 % beginindentedkeys...endindentedkeys - key definitions will be | |
191 % indented, but running text, typically used as headings to group | |
192 % definitions, will not. | |
193 \def\beginindentedkeys{\keyindent=1em} | |
194 \def\endindentedkeys{\keyindent=0em} | |
195 \endindentedkeys | |
196 | |
197 % paralign - begin paragraph containing an alignment. | |
198 % If an \halign is entered while in vertical mode, a parskip is never | |
199 % inserted. Using \paralign instead of \halign solves this problem. | |
200 \def\paralign{\vskip\parskip\halign} | |
201 | |
202 % \<...> - surrounds a variable name in a code example | |
203 \def\<#1>{{\it #1\/}} | |
204 | |
205 % kbd - argument is characters typed literally. Like the Texinfo command. | |
206 \def\kbd#1{{\tt#1}\null} %\null so not an abbrev even if period follows | |
207 | |
208 % beginexample...endexample - surrounds literal text, such a code example. | |
209 % typeset in a typewriter font with line breaks preserved | |
210 \def\beginexample{\par\leavevmode\begingroup | |
211 \obeylines\obeyspaces\parskip0pt\tt} | |
212 {\obeyspaces\global\let =\ } | |
213 \def\endexample{\endgroup} | |
214 | |
215 % key - definition of a key. | |
216 % \key{description of key}{key-name} | |
217 % prints the description left-justified, and the key-name in a \kbd | |
218 % form near the right margin. | |
219 \def\key#1#2{\leavevmode\hbox to \hsize{\vtop | |
220 {\hsize=.75\hsize\rightskip=1em | |
221 \hskip\keyindent\relax#1}\kbd{#2}\hfil}} | |
222 | |
223 \newbox\metaxbox | |
224 \setbox\metaxbox\hbox{\kbd{M-x }} | |
225 \newdimen\metaxwidth | |
226 \metaxwidth=\wd\metaxbox | |
227 | |
228 % metax - definition of a M-x command. | |
229 % \metax{description of command}{M-x command-name} | |
230 % Tries to justify the beginning of the command name at the same place | |
231 % as \key starts the key name. (The "M-x " sticks out to the left.) | |
232 \def\metax#1#2{\leavevmode\hbox to \hsize{\hbox to .75\hsize | |
233 {\hskip\keyindent\relax#1\hfil}% | |
234 \hskip -\metaxwidth minus 1fil | |
235 \kbd{#2}\hfil}} | |
236 | |
237 % threecol - like "key" but with two key names. | |
238 % for example, one for doing the action backward, and one for forward. | |
239 \def\threecol#1#2#3{\hskip\keyindent\relax#1\hfil&\kbd{#2}\hfil\quad | |
240 &\kbd{#3}\hfil\quad\cr} | |
241 | |
242 % I cannot figure out how to make all dired-x | |
243 % commands fit on a page in two-column format | |
35680 | 244 \def\dx{{\bf (DX)}} |
30871 | 245 |
76184
8340a8571aa8
(vsize): Increase in 2 column case to make room for copyright notice.
Glenn Morris <rgm@gnu.org>
parents:
75329
diff
changeset
|
246 \nopagenumbers |
8340a8571aa8
(vsize): Increase in 2 column case to make room for copyright notice.
Glenn Morris <rgm@gnu.org>
parents:
75329
diff
changeset
|
247 |
30871 | 248 %**end of header |
249 | |
250 | |
251 \title{Dired Reference Card} | |
252 | |
76609 | 253 \centerline{(based on Dired in GNU Emacs 22)} |
30871 | 254 \centerline{Commands marked with \dx{} require dired-x} |
255 | |
256 % trim this down to fit everything on one page | |
257 % \section{General} | |
258 % In dired, you can edit a list of the files in a directory (and optionally | |
259 % its subdirectories in the `ls -lR' format). | |
260 | |
261 % Editing a directory means that you can visit, rename, copy, compress, | |
262 % load, byte-compile files. You can change files' attributes, run shell | |
263 % commands on files, or insert subdirectories into the edit buffer. You can | |
264 % "flag" files for deletion or "mark" files for later commands, either one | |
265 % file at a time or by all files matching certain criteria (e.g., files that | |
266 % match a certain regexp). | |
35680 | 267 |
30871 | 268 % You move throughout the buffer using the usual cursor motion commands. |
269 % Letters no longer insert themselves, but execute commands instead. The | |
270 % digits (0-9) are prefix arguments. | |
35680 | 271 |
30871 | 272 % Most commands operate either on all marked files or on the current file if |
273 % no files are marked. Use a numeric prefix argument to operate on the next | |
274 % ARG files (or previous ARG if ARG $<$ 0). Use the prefix argument `1' to | |
275 % operate on the current file only. Prefix arguments override marks. Commands | |
276 % which run a sub-process on a group of files will display a list of files | |
277 % for which the sub-process failed. Typing y will try to tell | |
278 % you what went wrong. | |
35680 | 279 |
30871 | 280 % When editing several directories in one buffer, each directory acts as a |
281 % page, so C-x [ and C-x ] can be used to move between directories. | |
282 | |
283 \section{Entering and Exiting Dired} | |
284 | |
285 \key{run dired}{C-x d} | |
35680 | 286 \key{dired the directory of the file you are editing}{C-x C-j \dx} |
30871 | 287 \key{quit dired}{q} |
288 | |
289 \section{Motion Commands} | |
290 | |
291 \key{move up to previous line}{p} | |
292 \key{move down to next line}{n} | |
293 \key{move up to previous directory line}{<} | |
294 \key{move down to next directory line}{>} | |
295 \key{move to next marked file}{M-\}} | |
296 \key{move to previous marked file}{M-\{} | |
297 \key{move up to previous subdirectory}{M-C-p} | |
298 \key{move down to next subdirectory}{M-C-n} | |
299 \key{move to parent directory}{^} | |
300 \key{move to first child subdirectory}{M-C-d} | |
301 | |
302 \section{Mouse Commands} | |
303 \metax{visit file}{Mouse_Button_2} | |
35680 | 304 \metax{popup menu}{Control-Mouse_Button_3} |
30871 | 305 |
306 \section{Immediate Actions on Files} | |
307 | |
308 \key{visit current file}{f} | |
309 \key{view current file}{v} | |
310 \key{visit current file in other window}{o} | |
311 \key{visit current file in other frame}{w} | |
312 \key{display current file}{C-u o} | |
313 \key{create a new subdirectory}{+} | |
314 \key{compare file at point with the one at mark}{=} | |
315 | |
316 \section{Marking and Unmarking Files} | |
317 | |
318 \key{mark a file or subdirectory for later commands}{m} | |
319 \key{unmark a file or all files of a subdirectory}{u} | |
320 \key{unmark all marked files in a buffer}{M-delete} | |
321 \key{mark files with a given extension}{* .} | |
322 \key{mark all directories}{* /} | |
323 \key{mark all symlinks}{* @} | |
324 \key{mark all executables}{* *} | |
325 \key{invert marking}{* t} | |
326 \key{mark all files in the current subdir}{* s} | |
327 \key{mark file names matching a regular expression}{* \%} | |
328 \key{change the marks to a different character}{* c} | |
35680 | 329 \key{mark files for which Elisp expression returns t}{* ( \dx} |
30871 | 330 |
76184
8340a8571aa8
(vsize): Increase in 2 column case to make room for copyright notice.
Glenn Morris <rgm@gnu.org>
parents:
75329
diff
changeset
|
331 \section{Modifying the Dired Buffer} |
30871 | 332 |
76184
8340a8571aa8
(vsize): Increase in 2 column case to make room for copyright notice.
Glenn Morris <rgm@gnu.org>
parents:
75329
diff
changeset
|
333 \key{insert a subdirectory into this buffer}{i} |
8340a8571aa8
(vsize): Increase in 2 column case to make room for copyright notice.
Glenn Morris <rgm@gnu.org>
parents:
75329
diff
changeset
|
334 \key{remove marked files from the listing}{k} |
8340a8571aa8
(vsize): Increase in 2 column case to make room for copyright notice.
Glenn Morris <rgm@gnu.org>
parents:
75329
diff
changeset
|
335 \key{remove a subdir listing}{C-u k} |
8340a8571aa8
(vsize): Increase in 2 column case to make room for copyright notice.
Glenn Morris <rgm@gnu.org>
parents:
75329
diff
changeset
|
336 \key{re-read all directories (retains all marks)}{g} |
8340a8571aa8
(vsize): Increase in 2 column case to make room for copyright notice.
Glenn Morris <rgm@gnu.org>
parents:
75329
diff
changeset
|
337 \key{toggle sorting of current subdir by name/date}{s} |
8340a8571aa8
(vsize): Increase in 2 column case to make room for copyright notice.
Glenn Morris <rgm@gnu.org>
parents:
75329
diff
changeset
|
338 \key{edit ls switches}{C-u s} |
8340a8571aa8
(vsize): Increase in 2 column case to make room for copyright notice.
Glenn Morris <rgm@gnu.org>
parents:
75329
diff
changeset
|
339 \key{recover marks, hidden lines, and such}{C-_} |
8340a8571aa8
(vsize): Increase in 2 column case to make room for copyright notice.
Glenn Morris <rgm@gnu.org>
parents:
75329
diff
changeset
|
340 \key{hide all subdirectories}{M-\$} |
8340a8571aa8
(vsize): Increase in 2 column case to make room for copyright notice.
Glenn Morris <rgm@gnu.org>
parents:
75329
diff
changeset
|
341 \key{hide or unhide subdirectory}{\$} |
30871 | 342 |
343 \section{Commands on Files Marked or Specified by the Prefix} | |
344 | |
345 \key{copy file(s)}{C} | |
346 \key{rename a file or move files to another directory}{R} | |
347 \key{change ownership of file(s)}{O} | |
348 \key{change the group of the file(s)}{G} | |
349 \key{change mode of file(s)}{M} | |
350 \key{print file(s)}{P} | |
351 \key{convert filename(s) to lower case}{\% l} | |
352 \key{convert filename(s) to upper case}{\% u} | |
353 \key{delete marked (as opposed to flagged) files}{X} | |
354 \key{uuencode or uudecode file(s)}{U} | |
355 \key{compress or uncompress file(s)}{Z} | |
35680 | 356 \key{run info on file}{I \dx} |
30871 | 357 \key{make symbolic link(s)}{S} |
358 \key{make relative symbolic links}{Y} | |
36868 | 359 \key{make hard link(s)}{H} |
30871 | 360 \key{search files for a regular expression}{A} |
361 \key{query replace regular expression}{Q} | |
362 \key{byte-compile files}{B} | |
363 \key{load files}{L} | |
364 \key{shell command on file(s)}{!} | |
365 | |
366 \section{Flagging Files for Deletion} | |
367 \leftline{\bf Unmark commands remove delete flags} | |
368 \key{flag file for deletion}{d} | |
369 \key{backup and remove deletion flag}{delete} | |
370 \key{flag all backup files (file names ending in \~{})}{\~{}} | |
371 \key{flag all auto-save files}{\#} | |
372 \key{flag various intermediate files}{\&} | |
373 \key{flag numeric backups (ending in .\~{}1\~{}, .\~{}2\~{}, etc.)}{.} | |
374 \key{execute the deletions requested (flagged files)}{x} | |
36867 | 375 \key{flag files matching a regular expression}{\% d} |
30871 | 376 |
377 \section{Regular Expression Commands} | |
378 | |
379 \key{mark filenames matching a regular expression}{\% m} | |
380 \key{copy marked files by regexp}{\% C} | |
381 \key{rename marked files by regexp}{\% R} | |
382 \key{hardlink}{\% H} | |
383 \key{symlink}{\% S} | |
384 \key{symlink, with relative paths}{\% Y} | |
385 \key{mark for deletion}{\% d} | |
386 | |
387 \section{Dired and Find} | |
36868 | 388 \metax{dired file(s) whose name matches a pattern}{M-x find-name-dired} |
30871 | 389 \metax{dired file(s) that contain pattern}{M-x find-grep-dired} |
390 \metax{dired file(s) based on \kbd{find} output}{M-x find-dired} | |
391 | |
76184
8340a8571aa8
(vsize): Increase in 2 column case to make room for copyright notice.
Glenn Morris <rgm@gnu.org>
parents:
75329
diff
changeset
|
392 \section{Getting Help} |
8340a8571aa8
(vsize): Increase in 2 column case to make room for copyright notice.
Glenn Morris <rgm@gnu.org>
parents:
75329
diff
changeset
|
393 |
8340a8571aa8
(vsize): Increase in 2 column case to make room for copyright notice.
Glenn Morris <rgm@gnu.org>
parents:
75329
diff
changeset
|
394 \key{dired help}{h} |
8340a8571aa8
(vsize): Increase in 2 column case to make room for copyright notice.
Glenn Morris <rgm@gnu.org>
parents:
75329
diff
changeset
|
395 \key{dired summary (short help) and error log}{?} |
8340a8571aa8
(vsize): Increase in 2 column case to make room for copyright notice.
Glenn Morris <rgm@gnu.org>
parents:
75329
diff
changeset
|
396 |
8340a8571aa8
(vsize): Increase in 2 column case to make room for copyright notice.
Glenn Morris <rgm@gnu.org>
parents:
75329
diff
changeset
|
397 \copyrightnotice |
30871 | 398 |
399 \bye | |
400 | |
52401 | 401 % arch-tag: 483e7bb4-4576-4733-9fca-0eae1c861484 |