(\putwordon, \putwordMethodon): New macros.

* texinfo/texinfo.tex (\putwordon, \putwordMethodon): New macros.
  	Use in \def... commands.
	(\indexdummies): make `\ ' be just ` ' for sorting.
	(\deftypemethparsebody): New macro.
	(\defmethod): Call it.
	Various doc fixes.
	Repored by: KHMarbaise@p69.ks.fido.de (Karl Heinz Marbaise)
	Date: Wed, 07 Jan 1998 10:19:42 +0100
This commit is contained in:
Karl Berry 1998-05-02 14:14:31 +00:00
parent 76ae1bc064
commit e3e88767f1

View File

@ -98,18 +98,20 @@
% starts a new line in the output. % starts a new line in the output.
\newlinechar = `^^J \newlinechar = `^^J
% Set up fixed words for English. % Set up fixed words for English if not already set.
\ifx\putwordChapter\undefined{\gdef\putwordChapter{Chapter}}\fi% \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
\def\putwordInfo{Info}% \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
\ifx\putwordSee\undefined{\gdef\putwordSee{See}}\fi% \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
\ifx\putwordsee\undefined{\gdef\putwordsee{see}}\fi% \ifx\putwordInfo\undefined \gdef\putwordfile{Info}\fi
\ifx\putwordfile\undefined{\gdef\putwordfile{file}}\fi% \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
\ifx\putwordpage\undefined{\gdef\putwordpage{page}}\fi% \ifx\putwordon\undefined \gdef\putwordon{on}\fi
\ifx\putwordsection\undefined{\gdef\putwordsection{section}}\fi% \ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
\ifx\putwordSection\undefined{\gdef\putwordSection{Section}}\fi% \ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
\ifx\putwordTableofContents\undefined{\gdef\putwordTableofContents{Table of Contents}}\fi% \ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
\ifx\putwordShortContents\undefined{\gdef\putwordShortContents{Short Contents}}\fi% \ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
\ifx\putwordAppendix\undefined{\gdef\putwordAppendix{Appendix}}\fi% \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
\ifx\putwordShortContents\undefined \gdef\putwordShortContents{Short Contents}\fi
\ifx\putwordTableofContents\undefined\gdef\putwordTableofContents{Table of Contents}\fi
% Ignore a token. % Ignore a token.
% %
@ -2325,6 +2327,7 @@ width0pt\relax} \fi
\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
\def\indexdummies{% \def\indexdummies{%
\def\ { }%
% Take care of the plain tex accent commands. % Take care of the plain tex accent commands.
\def\"{\realbackslash "}% \def\"{\realbackslash "}%
\def\`{\realbackslash `}% \def\`{\realbackslash `}%
@ -3924,7 +3927,12 @@ width0pt\relax} \fi
\catcode 61=\active % 61 is `=' \catcode 61=\active % 61 is `='
\obeylines\activeparens\spacesplit#3} \obeylines\activeparens\spacesplit#3}
\def\defmethparsebody #1#2#3#4 {\begingroup\inENV % % #1 is the \E... control sequence to end the definition (which we define).
% #2 is the \...x control sequence for consecutive fns (which we define).
% #3 is the control sequence to call to resume processing.
% #4, delimited by the space, is the class name.
%
\def\defmethparsebody#1#2#3#4 {\begingroup\inENV %
\medbreak % \medbreak %
% Define the end token that this defining construct specifies % Define the end token that this defining construct specifies
% so that it will exit this group. % so that it will exit this group.
@ -3935,6 +3943,19 @@ width0pt\relax} \fi
\exdentamount=\defbodyindent \exdentamount=\defbodyindent
\begingroup\obeylines\activeparens\spacesplit{#3{#4}}} \begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
% @deftypemethod has an extra argument that nothing else does. Sigh.
%
\def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV %
\medbreak %
% Define the end token that this defining construct specifies
% so that it will exit this group.
\def#1{\endgraf\endgroup\medbreak}%
\def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
\parindent=0in
\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
\exdentamount=\defbodyindent
\begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}}
\def\defopparsebody #1#2#3#4#5 {\begingroup\inENV % \def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
\medbreak % \medbreak %
% Define the end token that this defining construct specifies % Define the end token that this defining construct specifies
@ -4156,35 +4177,42 @@ width0pt\relax} \fi
% @defmethod, and so on % @defmethod, and so on
% @defop {Funny Method} foo-class frobnicate argument % @defop CATEGORY CLASS OPERATION ARG...
\def\defop #1 {\def\defoptype{#1}% \def\defop #1 {\def\defoptype{#1}%
\defopparsebody\Edefop\defopx\defopheader\defoptype} \defopparsebody\Edefop\defopx\defopheader\defoptype}
\def\defopheader #1#2#3{% \def\defopheader #1#2#3{%
\dosubind {fn}{\code{#2}}{on #1}% Make entry in function index \dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index
\begingroup\defname {#2}{\defoptype{} on #1}% \begingroup\defname {#2}{\defoptype{} on #1}%
\defunargs {#3}\endgroup % \defunargs {#3}\endgroup %
} }
% @deftypemethod foo-class return-type foo-method args % @deftypemethod CLASS RETURN-TYPE METHOD ARG...
% %
\def\deftypemethod{% \def\deftypemethod{%
\defmethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader} \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader}
% %
% #1 is the class name, #2 the data type, #3 the method name, #4 the args. % #1 is the class name, #2 the data type, #3 the method name, #4 the args.
\def\deftypemethodheader#1#2#3#4{% \def\deftypemethodheader#1#2#3#4{%
\deftypefnheaderx{Method on #1}{#2}#3 #4\relax \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
\begingroup
\defname{\defheaderxcond#2\relax$$$#3}{\putwordMethodon\ \code{#1}}%
\deftypefunargs{#4}%
\endgroup
} }
% @defmethod == @defop Method % @defmethod == @defop Method
%
\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader} \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
%
\def\defmethodheader #1#2#3{% % #1 is the class name, #2 the method name, #3 the args.
\dosubind {fn}{\code{#2}}{on #1}% entry in function index \def\defmethodheader#1#2#3{%
\begingroup\defname {#2}{Method on #1}% \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index
\defunargs {#3}\endgroup % \begingroup
\defname{#2}{\putwordMethodon\ \code{#1}}%
\defunargs{#3}%
\endgroup
} }
% @defcv {Class Option} foo-class foo-flag % @defcv {Class Option} foo-class foo-flag