From 6f38c318368a66033198ee3426adad433db12563 Mon Sep 17 00:00:00 2001 Message-Id: <6f38c318368a66033198ee3426adad433db12563.1719174418.git.mdw@distorted.org.uk> From: Mark Wooding Date: Wed, 7 Aug 2019 16:10:14 +0100 Subject: [PATCH] doc/sod.sty: Keep `muffs' and `kwd' names decorated. Organization: Straylight/Edgeware From: Mark Wooding Have the `modindex' method strip off the decorations instead. --- doc/sod.sty | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/doc/sod.sty b/doc/sod.sty index 59adff5..d314ee1 100644 --- a/doc/sod.sty +++ b/doc/sod.sty @@ -288,13 +288,14 @@ %% 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{}} @@ -374,21 +375,15 @@ \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} %% @@ -455,10 +450,9 @@ %% %% * `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 @@ -486,11 +480,8 @@ %% 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. -- [mdw]