When I use it on a .dtx file, RefTeX shows me an empty table of contents. What can I do about it?
EDIT: I think I know why this happens: RefTeX ignores all the comments in the file, which is what one would want for a .tex file. What I don't know is how to convince it to process the comments in the .dtx file, where the documentation lives. (An ideal situation would be that RefTeX would detect a .dtx file and automatically process the comments, but I could live with an ad-hoc solution as well.)
The issue does not arise for .tex files. The table of contents in the .pdf produced from my .dtx is fine as well.
I use Emacs 24.2.1, AUCTeX 11.86 and RefTeX 4.31. (But the problem was there in previous versions as well.)
%\iffalse
\documentclass{ltxdoc}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
%\fi
% \tableofcontents
%
% \section{Implementation}
% blabla
%
% \endinput
% Local Variables:
% mode: doctex
% TeX-master: t
% End:

pdfpage. – Kurt Sep 24 '12 at 14:26