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