[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 1e8bb31: Fix RefTeX to show table of contents for d
From: |
Tassilo Horn |
Subject: |
[Emacs-diffs] master 1e8bb31: Fix RefTeX to show table of contents for dtx files (tiny change) |
Date: |
Mon, 2 Jan 2017 12:14:26 +0000 (UTC) |
branch: master
commit 1e8bb313eaa98928dc258f4b903bb10c33c21642
Author: Sašo Živanović <address@hidden>
Commit: Tassilo Horn <address@hidden>
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)
---
lisp/textmodes/reftex-parse.el | 5 ++++-
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 a2de416..af2810d 100644
--- a/lisp/textmodes/reftex-parse.el
+++ b/lisp/textmodes/reftex-parse.el
@@ -270,7 +270,10 @@ of master file."
(when (eq (char-before) ?\\) (backward-char))
;; Insert in List
(setq toc-entry (funcall reftex-section-info-function file))
- (when toc-entry
+ (when (and toc-entry
+ (eq ;; Either both are t or both are nil.
+ (= (char-after bound) ?%)
+ (string-suffix-p ".dtx" file)))
;; It can happen that section info returns nil
(setq level (nth 5 toc-entry))
(setq highest-level (min highest-level level))
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index 2de83a8..18b3598 100644
--- a/lisp/textmodes/reftex.el
+++ b/lisp/textmodes/reftex.el
@@ -1015,8 +1015,8 @@ This enforces rescanning the buffer on next use."
;; Calculate the regular expressions
(let* (
; (wbol "\\(\\`\\|[\n\r]\\)[ \t]*")
- (wbol "\\(^\\)[ \t]*") ; Need to keep the empty group because
- ; match numbers are hard coded
+ (wbol "\\(^\\)%?[ \t]*") ; Need to keep the empty group because
+ ; match numbers are hard coded
(label-re (concat "\\(?:"
(mapconcat 'identity reftex-label-regexps "\\|")
"\\)"))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 1e8bb31: Fix RefTeX to show table of contents for dtx files (tiny change),
Tassilo Horn <=