emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Fix RefTeX to show table of contents for dtx files


From: Sašo Živanović
Subject: [PATCH] Fix RefTeX to show table of contents for dtx files
Date: Fri, 30 Dec 2016 11:49:41 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1

I've fixed a tiny bug in RefTeX: TOC was not shown for dtx files.

Dtx files mix code and documentation. Any comment with the comment character at the beginning of the line is considered a part of the docs.

The regexp gathering sections allowed only whitespace before the section command. I've changed this so that now, the comment character is also allowed at the very beginning. In the parser code, I've added a filter that accepts only commented lines for dtx files and only uncommented ones for other files.

I've relied on the file name (ending in ".dtx", obviously), to detect dtx files. Using the major mode (doctex-mode or not) of the file that is currently visited does not work, as a tex file can input a dtx file, or vice versa. Maybe there's a way to also check file variables of included files, but I don't know about it, and it would probably be an overkill, anyway.

Best,
Sašo

Attachment: 0001-Fix-RefTeX-to-show-table-of-contents-for-dtx-files.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]