-%% Put a chunk of text in a box.
-\newenvironment{boxy}[1][\q@]{%
- \savenotes
- \dimen@\linewidth\advance\dimen@-1.2pt\advance\dimen@-2ex%
- \medskip%
- \vbox\bgroup\hrule\hbox\bgroup\vrule%
- \vbox\bgroup\vskip1ex\hbox\bgroup\hskip1ex\minipage\dimen@%
- \def\@temp{#1}\ifx\@temp\q@\else\leavevmode{\headfam\bfseries#1\quad}\fi%
-}{%
- \endminipage\hskip1ex\egroup\vskip1ex\egroup%
- \vrule\egroup\hrule\egroup%
- \medskip%
- \spewnotes%
+%% Set a program in `codeface', with implicit tabbing and other toys.
+%% Newlines are explicit, because otherwise I need comments in weird places
+%% to make the vertical spacing come out properly. You can write
+%% `\obeylines' if you really want to.
+\def\prog{\quote\@prog}
+\def\endprog{\endtabbing\endquote}
+
+%% Like `prog', but without indenting the code. Use this within environments
+%% which already set their contents out from the body text in some
+%% distinctive way.
+\let\nprog\@prog
+\let\endnprog\endtabbing
+
+%% Indent the following material. Cancel using `\-'.
+\def\ind{\quad\=\+\kill}
+
+%% Show a backslash by the right-hand margin; for multiline macros etc.
+\def\macsl{\`\textbackslash\hskip\leftmargin}
+
+%%%--------------------------------------------------------------------------
+%%% Machinery for describing functions, etc.
+
+%% \definedescribecategory{CAT}[KIND]{NAME}
+%%
+%% Define a category of things to document. CAT is a short label identifying
+%% the category to `\describe', `\descref', and friends. The NAME is the
+%% text to show in the description headline; it is a macro body which is
+%% passed an argument `#1' that applies a modifier to some portion of the
+%% text.
+%%
+%% The KIND allows additional arguments to be collected, included in label
+%% strings, and mentioned in the index. The default is `plain'.
+\def\definedescribecategory#1{%
+ \@ifnextchar[{\def@desc{#1}}{\def@desc{#1}[plain]}}
+\def\def@desc#1[#2]#3{\@namedef{cat!#1}##1{#3}\@namedef{catsw!#1}{#2}}
+
+%% \describecategoryname[MOD]{CAT}
+%%
+%% Typeset the category name for CAT, modified by MOD.
+\def\describecategoryname{\@ifnextchar[\@descname@i{\@descname@i[]}}
+\def\@descname@i[#1]#2{%
+ \expandafter\let\expandafter\@tempa\csname cat!#2\endcsname%
+ \expandafter\let\expandafter\@tempb\csname modcat/#1\endcsname%
+ \ifx\@tempa\relax\@tempb{#2}\else\@tempa\@tempb\fi}
+
+%% Call a modifier method.
+\def\@mod@dispatch#1#2{\csname #1/#2\endcsname}
+
+%% Call a description method given the category.
+\def\@desc@dispatch#1#2{%
+ \csname #1/%
+ \expandafter\ifx\csname catsw!#2\endcsname\relax plain%
+ \else \csname catsw!#2\endcsname \fi%
+ \endcsname%