\makeatletter
  % Define some commands that produce formatted index entries suitable for
  % cross-references.  ``\spec'' produces entries for specifications of
  % entities.  ``\impl'' produces entries for their implementations, and
  % ``\use'' for their uses.
%  \newcommand{\bold}[1]{{\bf #1}}
  \def\spec{\@bsphack\begingroup
             \def\protect##1{\string##1\space}\@sanitize
             \@wrxref{|bold}}
  \newcommand{\italic}[1]{{\em #1}}
  \def\impl{\@bsphack\begingroup
             \def\protect##1{\string##1\space}\@sanitize
             \@wrxref{|italic}}
  \newcommand{\indexcode}[1]{{\lstinline$#1$}}
  \def\use{\@bsphack\begingroup
             \def\protect##1{\string##1\space}\@sanitize
             \@wrxref{|indexcode}}
  \newcommand{\see}[2]{\emph{see} #1}
  %% \def\use{\@bsphack\begingroup
  %%            \def\protect##1{\string##1\space}\@sanitize
  %%            \@wrxref{}}
  \def\@wrxref#1#2{\let\thepage\relax
     \xdef\@gtempa{\write\@indexfile{\string
        \indexentry{#2@{\lstinline$#2$}#1}{\thepage}}}\endgroup\@gtempa
     \if@nobreak \ifvmode\nobreak\fi\fi\@esphack}
\makeatother
