chiark / gitweb /
doc/sod.sty: Make the `modindex' and `modlabel' argument order less mad.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 7 Aug 2019 15:15:31 +0000 (16:15 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 7 Aug 2019 16:31:24 +0000 (17:31 +0100)
Now it's {MOD}{CAT}{...}...{NAME}, like (nearly) everything else.

doc/sod.sty

index d314ee11473d8bb30b18838025ee4b531fd98f20..75acc2d592a9fad663363480a00059cda95ef04b 100644 (file)
 
 %% Category-kind methods for plain categories.
 \@namedef{descargs/plain}#1{#1{}}
-\@namedef{desclabel/plain}#1#2#3{#1:\@mod@dispatch{modlabel}{#2}{#3}}
+\@namedef{desclabel/plain}#1#2#3{#2:\@mod@dispatch{modlabel}{#1}{#3}}
 \@namedef{descindex/plain}#1#2#3{%
-  \@mod@dispatch{modindex}{#2}{#3}!%
-  \protect\describecategoryname[#2]{#1}%
+  \@mod@dispatch{modindex}{#1}{#3}!%
+  \protect\describecategoryname[#1]{#2}%
 }
 
 %% Category-kind methods for `method' categories.  Collect an extra argument
 }
 \@namedef{descargs/method}#1#2{#1{{#2}}}
 \@namedef{desclabel/method}#1#2#3#4%
-  {#1:\@mod@dispatch{modlabel}{#2}{#3}(#4)}
+  {#2:\@mod@dispatch{modlabel}{#1}{#4}(#3)}
 \@namedef{descindex/method}#1#2#3#4{%
-  \@mod@dispatch{modindex}{#2}{#3}!%
-  \protect\describecategoryname[#2]{#1}%
-  \protect\fmtspecs{ specialized at }{#4}%
+  \@mod@dispatch{modindex}{#1}{#4}!%
+  \protect\describecategoryname[#1]{#2}%
+  \protect\fmtspecs{ specialized at }{#3}%
 }
 
 %% Some magic strings.
   \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}%
+   \edef\temp@{\@desc@dispatch{desclabel}{#2}{#1}{#2}#3{#4}}%
    \def\@uscore{_\@gobble}\expandafter\message\expandafter{\temp@}%
    \def\@uscore{-\@gobble}\expandafter\label\expandafter{\temp@}}%
   {\begingroup\lccode`\~=`\_\lowercase{\endgroup\def~{_}}%
    \protected@edef\@tempa##1{%
-     \noexpand\index{\@desc@dispatch{descindex}{#2}{#2}{#1}{#4}#3##1}}%
+     \noexpand\index{\@desc@dispatch{descindex}{#2}{#1}{#2}#3{#4}##1}}%
    \toks@\expandafter{\@tempa{|)}}%
    \toks\tw@\expandafter{\after@desc}%
    \xdef\after@desc{\the\toks\tw@\the\toks@}%