+%% \descindex[MOD]{CAT}{...}...{LABEL}[SUFFIX]
+%%
+%% Set a label and index entry here, as if for a description. The CAT names
+%% the category of thing being described, and the LABEL names the specific
+%% thing, as for `\descref'. The {...}... are any additional arguments
+%% required by the category's kind (e.g., method specializers). The MOD is
+%% the modifier to apply; see `\descref' for the details.
+%%
+%% The SUFFIX is appended to the index-entry text; by default it is empty.
+%% Useful values are `|(' and `|)' to set ranges.
+\def\descindex{\parse@dlbl\descindex@i}
+\def\descindex@i#1#2#3#4{\@ifnextchar[%
+ {\descindex@ii{#1}{#2}{#3}{#4}}%
+ {\descindex@ii{#1}{#2}{#3}{#4}[]}}
+\def\descindex@ii#1#2#3#4[#5]{%
+ {\begingroup\lccode`\~=`\_\lowercase{\endgroup\def~{_}}%
+ \protected@edef\@tempa{%
+ \noexpand\index{\@desc@dispatch{descindex}{#2}{#1}{#2}#3{#4}#5}}%
+ \@tempa}%
+}
+
+%% \desclabel[MOD]{CAT}{...}...{LABEL}[INDEX-SUFFIX]
+%%
+%% Set a label and index entry here, as if for a description. The CAT names
+%% the category of thing being described, and the LABEL names the specific
+%% thing, as for `\descref'. The {...}... are any additional arguments
+%% required by the category's kind (e.g., method specializers). The MOD is
+%% the modifier to apply; see `\descref' for the details.
+%%
+%% This will also add an index entry, as for `\descindex'; the INDEX-SUFFIX
+%% argument has the same effect as its SUFFIX argument.
+\def\desclabel{\parse@dlbl\desclabel@i}
+\def\desclabel@i#1#2#3#4{%
+ \begingroup%
+ \let\protect\@empty\def\@uscore{-\@gobble}%
+ \edef\@tempa{\@desc@dispatch{desclabel}{#2}{#1}{#2}#3{#4}}%
+ \phantomsection\label{\@tempa}%
+ \endgroup%
+ \descindex@i{#1}{#2}{#3}{#4}%
+}
+
+%% Description categories.
+\definedescribecategory{sym}{symbol}
+\definedescribecategory{fun}{#1{function}}
+\definedescribecategory{gf}{generic #1{function}}
+\definedescribecategory{msg}{message}
+\definedescribecategory{var}{variable}
+\definedescribecategory{modvar}{module variable}
+\definedescribecategory{const}{constant}
+\definedescribecategory{meth}[method]{primary #1{method}}
+\definedescribecategory{ar-meth}[method]{\code{:around} #1{method}}
+\definedescribecategory{be-meth}[method]{\code{:before} #1{method}}
+\definedescribecategory{af-meth}[method]{\code{:after} #1{method}}
+\definedescribecategory{cls}{class}
+\definedescribecategory{rst}{restart}
+\definedescribecategory{ty}{type}
+\definedescribecategory{mac}{#1{macro}}
+\definedescribecategory{feat}{feature macro}
+\definedescribecategory{lmac}{local #1{macro}}
+\definedescribecategory{parse}{parser spec}
+\definedescribecategory{parseform}{parser form}
+\definedescribecategory{opt}{option handler}
+\definedescribecategory{optmac}{option macro}
+\definedescribecategory{plug}{pluggable parser}
+