Source

XEmacs / man / dired-ref.tex

Full commit
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
% Document Type: TeX
% Master File: dired-ref.tex
% TREE DIRED Reference Card for GNU Emacs version 18 on Unix systems
%**start of header
\newcount\columnsperpage

% This file can be printed with 1, 2, or 3 columns per page (see below).
% Specify how many you want here.  Nothing else needs to be changed.

\columnsperpage=1

% Copyright (c) 1991 Free Software Foundation, Inc.

% This file is part of GNU Emacs.

% This file is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY.  No author or distributor
% accepts responsibility to anyone for the consequences of using it
% or for whether it serves any particular purpose or describes
% any piece of software unless they say so in writing.  Refer to the
% GNU Emacs General Public License for full details.
%
% Permission is granted to copy, modify and redistribute this source
% file provided the copyright notice and permission notices are
% preserved on all copies.
%
% Permission is granted to process this file through TeX and print the
% results, provided the printed document carries copyright and
% permission notices identical to the ones below.

% This file is intended to be processed by plain TeX (TeX82).
%
% The final reference card has six columns, three on each side.
% This file can be used to produce it in any of three ways:
% 1 column per page
%    produces six separate pages, each of which needs to be reduced to 80%.
%    This gives the best resolution.
% 2 columns per page
%    produces three already-reduced pages.
%    You will still need to cut and paste.
% 3 columns per page
%    produces two pages which must be printed sideways to make a
%    ready-to-use 8.5 x 11 inch reference card.
%    For this you need a dvi device driver that can print sideways.
% Which mode to use is controlled by setting \columnsperpage above.
%
% TeX Layout commands taken from the GNU Emacs Refcard (thanks to
% Stephen Gildea <gildea@erl.mit.edu> for this work)

\def\diredx{$^\dagger$}		% marks extra feature not present in dired.el
\let\diredx\diredx		% `compile' while ^ still active
\overfullrule0pt
\def\~{\char`~}			% an ASCII tilde character

\def\versionnumber{1.0}
\def\year{1992}
\def\version{\year\ v\versionnumber}

\def\shortcopyrightnotice{\vskip 1ex plus 2 fill
  \centerline{\small \copyright\ \year\ Free Software Foundation, Inc.
  Permissions on back.  v\versionnumber}}

\def\copyrightnotice{
\vskip 1ex plus 2 fill\begingroup\small
\centerline{Copyright \copyright\ \year\ Free Software Foundation, Inc.}
% \centerline{designed by Stephen Gildea, \version}
\centerline{\version}
\centerline{for GNU Emacs version 18 on Unix systems}

Permission is granted to make and distribute copies of
this card provided the copyright notice and this permission notice
are preserved on all copies.

For copies of the GNU Emacs manual, write to the Free Software
Foundation, Inc., 675 Massachusetts Ave, Cambridge MA 02139.

\endgroup}

% make \bye not \outer so that the \def\bye in the \else clause below
% can be scanned without complaint.
\def\bye{\par\vfill\supereject\end}

\newdimen\intercolumnskip
\newbox\columna
\newbox\columnb

\def\ncolumns{\the\columnsperpage}

\message{[\ncolumns\space 
  column\if 1\ncolumns\else s\fi\space per page]}

\def\scaledmag#1{ scaled \magstep #1}

% This multi-way format was designed by Stephen Gildea
% October 1986.
\if 1\ncolumns
  \hsize 4in
  \vsize 10in
  \voffset -.7in
  \font\titlefont=\fontname\tenbf \scaledmag3
  \font\headingfont=\fontname\tenbf \scaledmag2
  \font\smallfont=\fontname\sevenrm
  \font\smallsy=\fontname\sevensy

  \footline{\hss\folio}
  \def\makefootline{\baselineskip10pt\hsize6.5in\line{\the\footline}}
\else
  \hsize 3.2in
  \vsize 7.95in
  \hoffset -.75in
  \voffset -.745in
  \font\titlefont=cmbx10 \scaledmag2
  \font\headingfont=cmbx10 \scaledmag1
  \font\smallfont=cmr6
  \font\smallsy=cmsy6
  \font\eightrm=cmr8
  \font\eightbf=cmbx8
  \font\eightit=cmti8
  \font\eighttt=cmtt8
  \font\eightsy=cmsy8
  \textfont0=\eightrm
  \textfont2=\eightsy
  \def\rm{\eightrm}
  \def\bf{\eightbf}
  \def\it{\eightit}
  \def\tt{\eighttt}
  \normalbaselineskip=.8\normalbaselineskip
  \normallineskip=.8\normallineskip
  \normallineskiplimit=.8\normallineskiplimit
  \normalbaselines\rm		%make definitions take effect

  \if 2\ncolumns
    \let\maxcolumn=b
    \footline{\hss\rm\folio\hss}
    \def\makefootline{\vskip 2in \hsize=6.86in\line{\the\footline}}
  \else \if 3\ncolumns
    \let\maxcolumn=c
    \nopagenumbers
  \else
    \errhelp{You must set \columnsperpage equal to 1, 2, or 3.}
    \errmessage{Illegal number of columns per page}
  \fi\fi

  \intercolumnskip=.46in
  \def\abc{a}
  \output={%
      % This next line is useful when designing the layout.
      %\immediate\write16{Column \folio\abc\space starts with \firstmark}
      \if \maxcolumn\abc \multicolumnformat \global\def\abc{a}
      \else\if a\abc
	\global\setbox\columna\columnbox \global\def\abc{b}
        %% in case we never use \columnb (two-column mode)
        \global\setbox\columnb\hbox to -\intercolumnskip{}
      \else
	\global\setbox\columnb\columnbox \global\def\abc{c}\fi\fi}
  \def\multicolumnformat{\shipout\vbox{\makeheadline
      \hbox{\box\columna\hskip\intercolumnskip
        \box\columnb\hskip\intercolumnskip\columnbox}
      \makefootline}\advancepageno}
  \def\columnbox{\leftline{\pagebody}}

  \def\bye{\par\vfill\supereject
    \if a\abc \else\null\vfill\eject\fi
    \if a\abc \else\null\vfill\eject\fi
    \end}  
\fi

% we won't be using math mode much, so redefine some of the characters
% we might want to talk about
\catcode`\^=12
\catcode`\_=12

\chardef\\=`\\
\chardef\{=`\{
\chardef\}=`\}

\hyphenation{mini-buf-fer}

\parindent 0pt
\parskip 1ex plus .5ex minus .5ex

\def\small{\smallfont\textfont2=\smallsy\baselineskip=.8\baselineskip}

\outer\def\newcolumn{\vfill\eject}

\outer\def\title#1{{\titlefont\centerline{#1}}\vskip 1ex plus .5ex}

\outer\def\section#1{\par\filbreak
  \vskip 3ex plus 2ex minus 2ex {\headingfont #1}\mark{#1}%
  \vskip 2ex plus 1ex minus 1.5ex}

\newdimen\keyindent

\def\beginindentedkeys{\keyindent=1em}
\def\endindentedkeys{\keyindent=0em}
\endindentedkeys

\def\paralign{\vskip\parskip\halign}

\def\<#1>{$\langle${\rm #1}$\rangle$}

\def\kbd#1{{\tt#1}\null}	%\null so not an abbrev even if period follows

\def\beginexample{\par\leavevmode\begingroup
  \obeylines\obeyspaces\parskip0pt\tt}
{\obeyspaces\global\let =\ }
\def\endexample{\endgroup}

\def\key#1#2{\leavevmode\hbox to \hsize{\vtop
  {\hsize=.75\hsize\rightskip=1em
  \hskip\keyindent\relax#1}\kbd{#2}\hfil}}

\newbox\metaxbox
\setbox\metaxbox\hbox{\kbd{M-x }}
\newdimen\metaxwidth
\metaxwidth=\wd\metaxbox

\def\metax#1#2{\leavevmode\hbox to \hsize{\hbox to .75\hsize
  {\hskip\keyindent\relax#1\hfil}%
  \hskip -\metaxwidth minus 1fil
  \kbd{#2}\hfil}}

\def\threecolumn#1#2#3{\hskip\keyindent\relax{#1}\hfil&{#2}\quad &{#3}\quad\cr}
\def\threecol#1#2#3{\threecolumn{#1}{\kbd{#2}}{\kbd{#3}}}

%**end of header


\title{Tree Dired Reference Card}

\centerline{(for GNU Emacs version 18)}

\centerline{$ !Id: dired-ref.tex,v 1.1.1.1 1992/06/29 22:33:08 devin Exp ! $}

A feature marked like this\diredx{} is optional and not part of dired
proper. 


\section{Starting Dired}

\key{Dired in current window} {C-x d}
\key{Dired in other window} {C-x 4 d}

The last component of the pathname may contain wildcards.  With prefix
argument, Dired asks you to enter the listing switches for the {\tt
ls} command.

Another way is from within {\tt find-file}, \kbd{C-x C-f}: just enter
a directory name (no wildcards possible).


\section {Cursor Motion}
All the usual Emacs cursor motion commands are available in Dired
buffers. Special motion commands are (see also ``Subdirectories''
below):

\beginindentedkeys
\paralign to \hsize{#\tabskip=10pt plus 1 fil&#\tabskip=0pt&#\cr
\threecol{\bf go to}           {\bf previous}      {\bf next}
\threecol{line}                {C-p {\rm or} p}    {C-n {\rm or} n}
\threecol{directory line}      {<}                 {>}
%\threecol{inserted directory}  {ESC C-p}           {ESC C-n} % now below
\threecol{marked file}         {ESC \{}            {ESC \}}
}
\endindentedkeys


\section{Visiting Files}

\key{visit current file (dired if directory)} {f}
\key{visit current file in other window}{o}
\key{view current file read-only} {v}


\section{Displaying Files}

\key{toggle between sort by name/date} {s}
\key{specify new ls switches}{C-u s}
\key{redisplay current, marked or next N files}{l}
\key{revert buffer}{g}

\key{kill this line (but not this file)}{k}
\key{undo changes to Dired buffer}  {C-x u {\rm or} C-_}
\key{copy file name(s) to kill ring\diredx} {w}


\section{Marking and Unmarking Files}

\key{mark (with \kbd{*}) the current or next N file(s)} {m}
\key{remove mark}{u}
\key{remove mark on previous line}{DEL}

\key{mark all files matching REGEXP}{\%m}
\key{mark all executable files}{*}
\key{mark all symbolic links}{@}
\key{mark all directories}{/}

\key{unmark the current or next N file(s)} {u}
\key{move up lines and remove flags there} {DEL}
\key{remove a specific or all flags from every file}{ESC DEL}
%\key{toggle marks\diredx}{T} % this command is not very important


\section {Mark Using Commands} 

The following commands are applied to the marked files or (if there
are none) to the current file. Numeric prefix argument means, apply
command to the next N (previous N if negative) files.  Digits work as
prefix arguments.

{\bf Copying And Moving Files\dots}

Default target directory is where point is.

\beginindentedkeys
\key{move or rename} {r}
\key{copy} {c}
\key{make hard links} {H}
\key{make symbolic links} {Y}
\key{make relative symbolic links\diredx} {S}
\endindentedkeys

{\bf \dots With Regexps}

{\tt \\\&} in NEWNAME stands for the entire text being replaced.  {\tt
\\N} in NEWNAME, where N is a digit, stands for whatever matched the
N'th parenthesized grouping in REGEXP.

\beginindentedkeys
\key{move or rename} {\%r}
\key{copy} {\%c}
\key{make hard links} {\%H}
\key{make symbolic links} {\%Y}
\key{make relative symbolic links\diredx} {\%S}

\key{rename to upper case}{\%u}
\key{rename to lower case}{\%l}
\endindentedkeys

{\bf Shell Commands}

Shell commands have the top level directory as working directory.
A {\tt *} indicates where filenames go (default: at end).

\beginindentedkeys
\key{run a shell command}{!}
\key{run a shell command in background\diredx}{\&}
\endindentedkeys

{\bf Other Mark Using Commands}

\beginindentedkeys
\key{compress files}{C}
\key{uncompress files}{U}

\key{change the mode ({\tt g+w} etc. allowed)} {M}
\key{change the group} {G}
\key{change the owner} {O}

\key{load elisp files}{L}
\key{byte compile elisp files} {B}

\key{print files} {P}
\endindentedkeys


\section {Deleting Files}

\key{flag (with \kbd{D}) file for deletion}{d}

\key{flag auto-save files}{\#}
\key{flag backup files}{\~}
\key{flag excess numeric backup files}{.}
\key{flag files matching REGEXP}{\%d}

\key{delete \kbd{D}-flagged files}{x}
\key{delete \kbd{*}-marked files} {X}


\section{Comparing files}

\key{diff current file with file mark is on} {D}
\key{diff current file with its backup file} {ESC \~}


\section{Making Directories}

\key{create a new directory}{+}


\section{Error Logging}

\key{see why something went wrong}{W}


\section{Subdirectories}

\key{insert directory into same Dired buffer}{i}
\key{insert all marked directories\diredx}{I}

\key{relist subdirectory of this headerline}{l}
\key{kill subdirectory of this headerline}{k}

\key{go up (Dired parent directory)}{^}
\key{go down (view this directory)}{v}

\key{go up in inserted directory tree}{ESC C-u}
\key{go down in inserted directory tree}{ESC C-d}
\key{next inserted directory}{ESC C-n}
\key{previous inserted directory}{ESC C-p}


\section{Hiding Directories}
\key{hide or unhide current inserted directory}{\$}
\key{hide or unhide all inserted directories}{=}


\section{Advanced Commands\diredx}

%{\bf Dynamic Markers}
%\section{Dynamic Markers\diredx}

\key{push a new marker character}{(}
\key{pop current marker off stack}{)}

%{\bf Omitting}
%\section{Omitting\diredx}

\key{toggle omitting}{ESC o}

%{\bf Advanced Mark Commands}
%\section{Advanced Mark Commands\diredx}

\key{mark files for which PREDICATE is non-nil}{ESC (}

{\beginindentedkeys
\advance\leftskip by \keyindent
%
PREDICATE is a lisp expression, e.g., {\tt (= size 0)}, that can refer
to the following symbols:

\paralign to \hsize{#\tabskip=10pt plus 1 fil&#\tabskip=0pt&#\cr
\threecolumn{\bf meaning}                             {\bf symbol} {\bf type}
\threecolumn{inode (only for {\tt ls -i})}            {\tt inode}{\rm integer} 
\threecolumn{size, usually in blocks (only for {\tt ls -s})}{\tt s}{\rm integer}
\threecolumn{file permission bits ({\tt "-rw-r--r--"})}{\tt mode}{\rm string} 
\threecolumn{number of links to file}                 {\tt nlink}{\rm integer}
\threecolumn{owner}                                   {\tt uid}{\rm string}
\threecolumn{group}                                   {\tt gid}{\rm string}
\threecolumn{file size in bytes}                      {\tt size}{\rm integer}
\threecolumn{time that {\tt ls} displays ({\tt "Feb 12 14:17"})}{\tt time}{\rm string}
\threecolumn{name of the file}                        {\tt name}{\rm string}
\threecolumn{if symlink, linked-to name, else {\tt ""}}{\tt sym}{\rm string}
}
\endindentedkeys
}

\section{Filename Transformers\diredx}
Use e.g. {\tt [b]} instead of {\tt *} to access basenames in shell
commands.

\key{unmodified filename (equivalent to {\tt [dbe]}).}{*}
\key{name without directory information}{n}
\key{directory component}{d}
\key{basename, without directory and extension}{b}
\key{extension}{e}
\key{file without directory and without {\tt,v} suffix.}{v}
\key{without directory and without {\tt .Z} suffix}{z}


\section{Find Dired\diredx}

\metax{Feed arbitrary find(1) command to Dired}{M-x find-dired}
\metax{Find file names matching WILDCARD}{M-x find-name-dired}
\metax{Find files containing PATTERN}{M-x find-grep-dired}

\bye