X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/ac6e7a4ee6738e242e63d8cd2a05ca17d3e394c1..984c3fc3a94a81c2e6752031ed6a8b9a6c948658:/doc/sod.sty

diff --git a/doc/sod.sty b/doc/sod.sty
index d954b89..ddf2c86 100644
--- a/doc/sod.sty
+++ b/doc/sod.sty
@@ -7,7 +7,7 @@
 
 %%%----- Licensing notice ---------------------------------------------------
 %%%
-%%% This file is part of the Sensble Object Design, an object system for C.
+%%% This file is part of the Sensible Object Design, an object system for C.
 %%%
 %%% SOD is free software; you can redistribute it and/or modify
 %%% it under the terms of the GNU General Public License as published by
@@ -63,7 +63,10 @@
 
 %% Literal code is in sans face.
 \let\codeface\sffamily
-\def\code#1{\ifmmode\hbox\fi{\normalfont\codeface\/#1\/}}
+\DeclareRobustCommand\code[1]{%
+  \ifmmode\hbox\else\leavevmode\fi%
+  {\normalfont\codeface\/#1\/}%
+}
 \def\ulitleft{\normalfont\codeface}
 \let\ulitright\empty
 
@@ -149,6 +152,7 @@
 \definedescribecategory{fun}{function}
 \definedescribecategory{gf}{generic function}
 \definedescribecategory{var}{variable}
+\definedescribecategory{modvar}{module variable}
 \definedescribecategory{const}{constant}
 \definedescribecategory{meth}{primary method}
 \definedescribecategory{ar-meth}{around method}
@@ -156,12 +160,14 @@
 \definedescribecategory{af-meth}{after method}
 \definedescribecategory{cls}{class}
 \definedescribecategory{ty}{type}
+\definedescribecategory{type}{type}
 \definedescribecategory{mac}{macro}
 \definedescribecategory{lmac}{local macro}
 \definedescribecategory{parse}{parser spec}
 \definedescribecategory{parseform}{parser form}
 \definedescribecategory{opt}{option handler}
 \definedescribecategory{optmac}{option macro}
+\definedescribecategory{plug}{pluggable parser}
 \def\nlret{\\\hspace{4em}\returns}
 
 \def\q@{\q@}
@@ -176,12 +182,26 @@
   \if@dheadfirst\global\@dheadfirstfalse\else\relax\\[\smallskipamount]\fi%
   {\let\protect\@empty\def\@uscore{_\@gobble}\message{#2:#1}%
    \def\@uscore{-\@gobble}\edef\@tempa{\noexpand\label{#2:#1}}\@tempa}%
+  {\begingroup\lccode`\~=`\_\lowercase{\endgroup\def~{_}}%
+   \protected@edef\@tempa##1{%
+     \noexpand\index{%
+       #1@{\noexpand\code{#1}}!%
+       \csname cat!#2\endcsname%
+       ##1%
+     }%
+   }%
+   \@tempa{|(}%
+   \toks@\expandafter{\after@desc}%
+   \toks\tw@\expandafter{\@tempa{|)}}%
+   \xdef\after@desc{\the\toks@\the\toks\tw@}}%
   \rlap{\hb@xt@\linewidth{\hfil\normalfont\bfseries
       [\describecategoryname{#2}]}}%
   #3%
 }
 
 \def\desc@begin#1{%
+  \let\saved@after@desc\after@desc%
+  \gdef\after@desc{}%
   \normalfont%
   \if@nobreak\else\par\goodbreak\fi%
   \global\@dheadfirsttrue%
@@ -194,7 +214,7 @@
   \penalty\@M\@afterheading%
   \list{}{\rightmargin\z@\topsep\z@}\item%
 }
-\let\desc@end\endlist
+\def\desc@end{\endlist\after@desc\global\let\after@desc\saved@after@desc}
 
 \@namedef{describe*}#1{\desc@begin{#1}}
 \expandafter\let\csname enddescribe*\endcsname\desc@end
