diff options
| author | Sašo Živanović | 2016-12-30 11:12:42 +0100 |
|---|---|---|
| committer | Tassilo Horn | 2017-01-02 13:11:49 +0100 |
| commit | 1e8bb313eaa98928dc258f4b903bb10c33c21642 (patch) | |
| tree | aa89bdc6986080f3500bc79ccd955e39ec14f05a | |
| parent | 367dadf5541f3cc10ba992efb885bd259246ca66 (diff) | |
| download | emacs-1e8bb313eaa98928dc258f4b903bb10c33c21642.tar.gz emacs-1e8bb313eaa98928dc258f4b903bb10c33c21642.zip | |
Fix RefTeX to show table of contents for dtx files (tiny change)
* lisp/textmodes/reftex.el (reftex-compile-variables): Change the
section regexp so that it accepts lines starting with the comment
character. (tiny change)
* lisp/textmodes/reftex-parse.el (reftex-parse-from-file): Filter
gathered toc entries, accepting a commented entry if and only if the
source file is a ".dtx" file. (tiny change)
| -rw-r--r-- | lisp/textmodes/reftex-parse.el | 5 | ||||
| -rw-r--r-- | lisp/textmodes/reftex.el | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/lisp/textmodes/reftex-parse.el b/lisp/textmodes/reftex-parse.el index a2de4166d24..af2810d72e8 100644 --- a/lisp/textmodes/reftex-parse.el +++ b/lisp/textmodes/reftex-parse.el | |||
| @@ -270,7 +270,10 @@ of master file." | |||
| 270 | (when (eq (char-before) ?\\) (backward-char)) | 270 | (when (eq (char-before) ?\\) (backward-char)) |
| 271 | ;; Insert in List | 271 | ;; Insert in List |
| 272 | (setq toc-entry (funcall reftex-section-info-function file)) | 272 | (setq toc-entry (funcall reftex-section-info-function file)) |
| 273 | (when toc-entry | 273 | (when (and toc-entry |
| 274 | (eq ;; Either both are t or both are nil. | ||
| 275 | (= (char-after bound) ?%) | ||
| 276 | (string-suffix-p ".dtx" file))) | ||
| 274 | ;; It can happen that section info returns nil | 277 | ;; It can happen that section info returns nil |
| 275 | (setq level (nth 5 toc-entry)) | 278 | (setq level (nth 5 toc-entry)) |
| 276 | (setq highest-level (min highest-level level)) | 279 | (setq highest-level (min highest-level level)) |
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el index 2de83a8e336..18b35981f82 100644 --- a/lisp/textmodes/reftex.el +++ b/lisp/textmodes/reftex.el | |||
| @@ -1015,8 +1015,8 @@ This enforces rescanning the buffer on next use." | |||
| 1015 | ;; Calculate the regular expressions | 1015 | ;; Calculate the regular expressions |
| 1016 | (let* ( | 1016 | (let* ( |
| 1017 | ; (wbol "\\(\\`\\|[\n\r]\\)[ \t]*") | 1017 | ; (wbol "\\(\\`\\|[\n\r]\\)[ \t]*") |
| 1018 | (wbol "\\(^\\)[ \t]*") ; Need to keep the empty group because | 1018 | (wbol "\\(^\\)%?[ \t]*") ; Need to keep the empty group because |
| 1019 | ; match numbers are hard coded | 1019 | ; match numbers are hard coded |
| 1020 | (label-re (concat "\\(?:" | 1020 | (label-re (concat "\\(?:" |
| 1021 | (mapconcat 'identity reftex-label-regexps "\\|") | 1021 | (mapconcat 'identity reftex-label-regexps "\\|") |
| 1022 | "\\)")) | 1022 | "\\)")) |