chiark / gitweb /
doc/sod.sty: Keep `muffs' and `kwd' names decorated.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 7 Aug 2019 15:10:14 +0000 (16:10 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 7 Aug 2019 16:31:24 +0000 (17:31 +0100)
Have the `modindex' method strip off the decorations instead.

doc/sod.sty

index 59adff5d7ebb7c50ab867fee47eee13a4c056cd0..d314ee11473d8bb30b18838025ee4b531fd98f20 100644 (file)
 %% Modifier methods for words with *earmuffs*.  Sort into the index without
 %% the earmuffs.
 \@namedef{modcat/muffs}#1{#1}
-\@namedef{modlabel/muffs}#1{*#1*}
-\@namedef{modindex/muffs}#1{#1@\noexpand\code{*#1*}}
+\@namedef{modlabel/muffs}#1{#1}
+\@namedef{modindex/muffs}#1{\@unmuff#1@\noexpand\code{#1}}
+\def\@unmuff*#1*{#1}
 
 %% Modifier methods for :keywords.  Sort into the index without the `:'.
 \@namedef{modcat/kwd}#1{#1}
-\@namedef{modlabel/kwd}#1{:#1}
-\@namedef{modindex/kwd}#1{#1@\noexpand\code{:#1}}
+\@namedef{modlabel/kwd}#1{#1}
+\@namedef{modindex/kwd}#1{\@gobble#1@\noexpand\code{#1}}
 
 %% Category-kind methods for plain categories.
 \@namedef{descargs/plain}#1{#1{}}
   \def\temp@{#5}%
   \ifx\@setf\temp@\def\next@{\parse@dhd@csetf{#1}{#2}{#3}{#4}#6 \q@}%
   \else\def\temp@##1##2*##3\q@{\def\temp@{##1##3}}\temp@#5*\q@%
-    \ifx\temp@\@starstar\def\next@{\parse@dhd@cmuffs{#1}{#2}{#3}{#4}#5}%
+    \ifx\temp@\@starstar\def\next@{#1{muffs}{#2}{#3}{#5}{#4}}%
     \else\def\temp@##1##2\q@{\def\temp@{##1}}\temp@#5\q@%
-      \if:\temp@\def\next@{\parse@dhd@ckwd{#1}{#2}{#3}{#4}#5\q@}%
+      \if:\temp@\def\next@{#1{kwd}{#2}{#3}{#5}{#4}}%
       \else\def\next@{#1{plain}{#2}{#3}{#5}{#4}}\fi\fi\fi%
   \next@%
 }
 \def\parse@dhd@csetf#1#2#3#4(#5 #6\q@{%
   % {NEXT}{CAT}{{...}...}{SYNOPSIS}(NAME [ARGS...])\q@
   #1{setf}{#2}{#3}{#5}{#4}}
-\def\parse@dhd@cmuffs#1#2#3#4*#5*{%
-  % {NEXT}{CAT}{{...}...}{SYNOPSIS}*NAME*
-  #1{muffs}{#2}{#3}{#5}{#4}}
-\def\parse@dhd@ckwd#1#2#3#4:#5\q@{%
-  % {NEXT}{CAT}{{...}...}{SYNOPSIS}:NAME\q@
-  #1{kwd}{#2}{#3}{#5}{#4}}
 
 %% \dhead[MOD]{CAT}{...}...[NAME]{SYNOPSIS}
 %%
 %%
 %%   * `setf (NAME ...) ...': selects NAME, and defaults MOD to `setf'.
 %%
-%%   * `*NAME*': selects NAME, without the earmuffs, and defaults MOD to
-%%     `muffs'.
+%%   * `*NAME*': defaults MOD to `muffs'.
 %%
-%%   * `:NAME': selects NAME, withtout the colon, and defaults MOD to `kwd'.
+%%   * `:NAME': defaults MOD to `kwd'.
 \def\describe{\parse@dhd\desc@}
 \def\desc@#1#2#3#4#5{\desc@begin{\dhead@{#1}{#2}{#3}{#4}{#5}}}
 \let\enddescribe\desc@end
 %% The precise rules for how the LABEL matches the name in the description
 %% depend on the description's modifier:
 %%
-%%   * `plain': the LABEL is the same as the NAME.
+%%   * `plain', `muffs', and `kwd': the LABEL is the same as the NAME.
 %%   * `setf': the LABEL should be `setf/NAME'.
-%%   * `muffs': the LABEL should be `*NAME*', i.e., with the earmuffs
-%%     restored.
-%%   * `kwd: the LABEL should be `:NAME', i.e., with the colon restored.
 %%
 %% Usually a page-number cross-reference is included, so as to help readers
 %% of a dead-tree copy; this is suppressed by the `*' version.