((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))
+ (if (and (fboundp 'TeX-current-macro)
+ (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)))
+ t))
+ (push (reftex-label-info (reftex-match-string 1) file bound)
+ docstruct)))
((match-end 3)
;; It is a section
; "\\(\\`\\|[\n\r]\\)[^%]*\\\\\\("
"\\(^\\)[^%\n\r]*\\\\\\("
(mapconcat 'identity reftex-bibliography-commands "\\|")
- "\\){[ \t]*\\([^}]+\\)") nil t)
+ "\\)\\(\\[.+?\\]\\)?{[ \t]*\\([^}]+\\)") nil t)
(setq files
- (split-string (reftex-match-string 3)
+ (split-string (reftex-match-string 4)
"[ \t\n\r]*,[ \t\n\r]*")))))
(when files
(setq files