X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/be18b63c233dae3873691486a2d858e600b087f8..19a890755c41015df023f1f42ada443568d45386:/doc/sod.sty

diff --git a/doc/sod.sty b/doc/sod.sty
index 90a3838..d9cfabc 100644
--- a/doc/sod.sty
+++ b/doc/sod.sty
@@ -187,9 +187,15 @@
 \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 descmod/#1\endcsname%
+  \expandafter\let\expandafter\@tempb\csname modcat/#1\endcsname%
   \ifx\@tempa\relax\@tempb{#2}\else\@tempa\@tempb\fi}
 \def\@maybe@modlabel#1#2{\if!#1!\else#1/\fi#2}
+\def\@desc@dispatch#1#2{%
+  \csname #1/%
+  \expandafter\ifx\csname catsw!#2\endcsname\relax plain%
+  \else \csname catsw!#2\endcsname \fi%
+  \endcsname%
+}
 
 \definedescribecategory{sym}{symbol}
 \definedescribecategory{fun}{#1{function}}
@@ -215,9 +221,9 @@
 \definedescribecategory{plug}{pluggable parser}
 \def\nlret{\\\hspace{4em}\returns}
 
-\@namedef{descmod/}#1{#1}
+\@namedef{modcat/}#1{#1}
 
-\@namedef{descmod/setf}#1{\code{setf}-#1}
+\@namedef{modcat/setf}#1{\code{setf}-#1}
 
 \@namedef{descargs/plain}#1{#1{}}
 \@namedef{desclabel/plain}#1#2#3{#1:\@maybe@modlabel{#2}{#3}}
@@ -234,13 +240,6 @@
   \protect\fmtspecs{ specialized at }{#4}%
 }
 
-\def\@desc@dispatch#1#2{%
-  \csname #1/%
-  \expandafter\ifx\csname catsw!#2\endcsname\relax plain%
-  \else \csname catsw!#2\endcsname \fi%
-  \endcsname%
-}
-
 \def\q@{\q@}
 \def\@setf{setf}
 
@@ -303,7 +302,8 @@
 \newif\if@dheadfirst
 \def\dhead{\parse@dhd\dhead@}
 \def\dhead@#1#2#3#4#5{%  {MOD}{CAT}{{...}...}{NAME}{SYNOPSIS}
-  \if@dheadfirst\global\@dheadfirstfalse\else\relax\\[\smallskipamount]\fi%
+  \if@dheadfirst\global\@dheadfirstfalse\else\relax\\*[\smallskipamount]\fi%
+  \phantomsection%
   {\let\protect\@empty\let\@uscore\relax%
    \edef\temp@{\@desc@dispatch{desclabel}{#2}{#2}{#1}{#4}#3}%
    \def\@uscore{_\@gobble}\expandafter\message\expandafter{\temp@}%
