When using texdef to learn the definitions of environments sometimes not all the relevant lines are shown. I guess this has do with how the definitions are written. It seems that when environments are defined as
\def\environmentname{A}
\def\endenvironmentname{B}
or as
\def\environmentname{A}
\let\endenvironmentname B
then texdef returns only A (and not B). Is it possible to make texdef return both A and B? This would make sense because someone who wants to look up a definition of an environment would like to know the definition of the whole environment, i.e. both the beginning and the end.
For example texdef -t latex equation returns
\equation:
macro:->$$\refstepcounter {equation}
when the relevant lines are
\def\equation{$$\refstepcounter{equation}}
\def\endequation{\eqno \hbox{\@eqnnum}$$\@ignoretrue}
Another example is that texdef -t latex enumerate returns
\enumerate:
macro:->\ifnum \@enumdepth >\thr@@ \@toodeep \else \advance \@enumdepth \@ne \edef \@enumctr {enum\romannumeral \the \@enumdepth }\expandafter \list \csname label\@enumctr \endcsname {\usecounter \@enumctr \def \makelabel ##1{\hss \llap {##1}}}\fi
when the relevant lines are
\def\enumerate{%
\ifnum \@enumdepth >\thr@@\@toodeep\else
\advance\@enumdepth\@ne
\edef\@enumctr{enum\romannumeral\the\@enumdepth}%
\expandafter
\list
\csname label\@enumctr\endcsname
{\usecounter\@enumctr\def\makelabel##1{\hss\llap{##1}}}%
\fi}
\let\endenumerate =\endlist
\endfooif not undefined (or equivalent to\relax). – egreg Jan 30 '12 at 19:01