| 1 |
% Makes a landscape listing of one or more files with wide lines |
| 2 |
% Typical usage: |
| 3 |
% tex list *.c \\end |
| 4 |
|
| 5 |
\hsize=9in |
| 6 |
\vsize=6.5in |
| 7 |
\special{landscape} |
| 8 |
|
| 9 |
\def\grabfile#1 {\setbox0=\lastbox\endgraf\doit{#1}} |
| 10 |
\everypar{\grabfile} |
| 11 |
|
| 12 |
\font\filenamefont= cmtt8 scaled\magstep3 |
| 13 |
\font\headlinefont= cmr8 |
| 14 |
\font\listingfont= cmtex8 |
| 15 |
\font\eoffont= cmti8 |
| 16 |
|
| 17 |
\def\today{\ifcase\month\or |
| 18 |
January\or February\or March\or April\or May\or June\or |
| 19 |
July\or August\or September\or October\or November\or December\fi |
| 20 |
\space\number\day, \number\year} |
| 21 |
\newcount\m \newcount\n |
| 22 |
\n=\time \divide\n 60 \m=-\n \multiply\m 60 \advance\m \time |
| 23 |
\def\hours{\twodigits\n\twodigits\m} |
| 24 |
\def\twodigits#1{\ifnum #1<10 0\fi \number#1} |
| 25 |
|
| 26 |
\newlinechar=`@ |
| 27 |
\message{@\today\space at \hours} |
| 28 |
|
| 29 |
\baselineskip=9pt |
| 30 |
\medskipamount=4pt minus 1pt |
| 31 |
\raggedbottom |
| 32 |
\nopagenumbers |
| 33 |
|
| 34 |
\chardef\other=12 |
| 35 |
\def\doit#1{\message{@Listing #1@} |
| 36 |
\begingroup \everypar{} \frenchspacing |
| 37 |
\headline{\filenamefont#1\quad\headlinefont \today\ at \hours |
| 38 |
\hfill Page \folio} |
| 39 |
\def\do##1{\catcode`##1=\other}\dospecials |
| 40 |
\catcode127=\other \catcode9=\other \catcode12=\other |
| 41 |
\parindent 0pt \parfillskip=0pt plus 1fil minus 1in |
| 42 |
\everypar{\hangindent 1in} \rightskip=0pt plus 2in |
| 43 |
\def\par{\ifvmode\penalty-500\medskip\else\endgraf\fi} |
| 44 |
\listingfont \obeylines \obeyspaces \global\pageno=1 |
| 45 |
\input #1 {\eoffont(end of\/ file)}\endgraf\vfill\eject\endgroup} |
| 46 |
{\obeyspaces\global\let =\ } |
| 47 |
\catcode`\_=\other % allow _ in file names |
| 48 |
|
| 49 |
% A tab (^^I) prints as lowercase gamma. |
| 50 |
% Character ^^M could be made visible, with a bit of work; |
| 51 |
% at present, it's indistinguishable from newline (^^J). |
| 52 |
|
| 53 |
% You can get up to 170 characters on a line without an overfull box. |