X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/a4094071c983a452769615e22b342e14836ce424..2242bae8744c32179cd43ff3531f0f4843b28254:/doc/sod.sty

diff --git a/doc/sod.sty b/doc/sod.sty
index 6a2c1c3..d3e7740 100644
--- a/doc/sod.sty
+++ b/doc/sod.sty
@@ -58,10 +58,13 @@
 \let\listingsize\relax
 
 %% Notes for later.
-\def\fixme#1{\leavevmode\marginpar{FIXME}[FIXME: #1]}
+\def\fixme#1{\leavevmode\marginpar{FIXME}\index{FIXME}[FIXME: #1]}
 
 %% Diagram settings.
-\tikzset{every picture/.style={>=stealth, thick}}
+\tikzset{
+  every picture/.style={>=stealth, thick},
+  lit/.style={font=\sffamily}
+}
 
 %% Metavariables are italics without decoration.
 \def\syntleft{\normalfont\itshape}
@@ -207,14 +210,23 @@
 \def\nlret{\\\hspace{4em}\returns}
 
 \def\q@{\q@}
-\def\parse@dhd#1{\@ifnextchar[{\parse@dhd@a{#1}}{\parse@dhd@c{#1}}}
-\def\parse@dhd@a#1[#2]{#1{#2}}
-\def\parse@dhd@c#1#2#3{\parse@dhd@cc{#1}{#2}{#3}#3 \q@}
-\def\parse@dhd@cc#1#2#3#4 #5\q@{#1{#4}{#2}{#3}}
+
+%% \parse@dhd{NEXT}[NAME]{CAT}{SYNOPSIS}
+%% call NEXT{NAME}{CAT}{SYNOPSIS}
+%%            #1    #2     #3
+\def\parse@dhd#1{%  {NEXT}
+  \@ifnextchar[{\parse@dhd@cc{#1}}{\parse@dhd@cd{#1}}}
+\def\parse@dhd@cc#1[#2]#3#4{%  {NEXT}[NAME]{CAT}{SYNOPSIS}
+  #1{#2}{#3}{#4}}
+\def\parse@dhd@cd#1#2#3{%  {NEXT}{CAT}{SYNOPSIS}
+  \parse@dhd@ce{#1}{#2}{#3}#3 \q@}
+\def\parse@dhd@ce#1#2#3#4 #5\q@{%
+  % {NEXT}{CAT}{SYNOPSIS}NAME [ARGS...]\q@
+  #1{#4}{#2}{#3}}
 
 \newif\if@dheadfirst
 \def\dhead{\parse@dhd\dhead@}
-\def\dhead@#1#2#3{%
+\def\dhead@#1#2#3{%  {NAME}{CAT}{SYNOPSIS}
   \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}%
