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:

-
Please provide a MWE. Show the command you use to build the pdf page. – Kurt Sep 24 '12 at 14:26
Sure, done, by I don't know how this will help. Sorry if I was unclear: compiling the file works fine. It is the RefTeX (an Emacs extension) that shows an empty table of contents, when I select RefTex->Table of contents from the menu, or press Ctrl-C-=. – Sašo Živanović Sep 24 '12 at 15:44
I don't think reftex know doctex mode, auctex does, but I'm not sure if reftex does. – daleif Sep 24 '12 at 15:58

closed as too localized by lockstep, Stefan Kottwitz♦Mar 24 at 13:23

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.