diff options
Diffstat (limited to 'lisp/textmodes/reftex-parse.el')
-rw-r--r-- | lisp/textmodes/reftex-parse.el | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lisp/textmodes/reftex-parse.el b/lisp/textmodes/reftex-parse.el index 095c5953947..6bfc70c5d44 100644 --- a/lisp/textmodes/reftex-parse.el +++ b/lisp/textmodes/reftex-parse.el @@ -234,8 +234,18 @@ of master file." ((match-end 1) ;; It is a label - (push (reftex-label-info (reftex-match-string 1) file bound) - docstruct)) + (when (or (null reftex-label-ignored-macros-and-environments) + ;; \label{} defs should always be honored, + ;; just no keyval style [label=foo] defs. + (string-equal "\label{" (substring (reftex-match-string 0) 0 7)) + (not (fboundp 'TeX-current-macro)) + (not (fboundp 'LaTeX-current-environment)) + (not (or (member (save-match-data (TeX-current-macro)) + reftex-label-ignored-macros-and-environments) + (member (save-match-data (LaTeX-current-environment)) + reftex-label-ignored-macros-and-environments)))) + (push (reftex-label-info (reftex-match-string 1) file bound) + docstruct))) ((match-end 3) ;; It is a section @@ -251,7 +261,7 @@ of master file." ;; the next parsing iteration. (when (eq (char-before) ?\\) (backward-char)) ;; Insert in List - (setq toc-entry (reftex-section-info file)) + (setq toc-entry (funcall reftex-section-info-function file)) (when toc-entry ;; It can happen that section info returns nil (setq level (nth 5 toc-entry)) |