summaryrefslogtreecommitdiff
path: root/lisp/textmodes/reftex.el
diff options
context:
space:
mode:
authorTassilo Horn <tassilo@member.fsf.org>2012-07-27 09:59:50 +0200
committerTassilo Horn <tassilo@member.fsf.org>2012-07-27 09:59:50 +0200
commit86332df22ae3934334c7ced64aa6aedd5767b121 (patch)
tree05ec47a532dd1b853963cb6ae665641a8e33e581 /lisp/textmodes/reftex.el
parenteeaea515623db982d4e7d453711e6f0fad9c08d8 (diff)
downloademacs-86332df22ae3934334c7ced64aa6aedd5767b121.tar.gz
* textmodes/reftex-vars.el (reftex-label-alist-builtin): Add
support for the lstlisting and minted environments, and for the ctable macro. * textmodes/reftex.el (reftex-compile-variables): Also recognize labels written in keyvals syntax.
Diffstat (limited to 'lisp/textmodes/reftex.el')
-rw-r--r--lisp/textmodes/reftex.el12
1 files changed, 11 insertions, 1 deletions
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index 8c349a2e20a..c2270323843 100644
--- a/lisp/textmodes/reftex.el
+++ b/lisp/textmodes/reftex.el
@@ -1284,7 +1284,15 @@ This enforces rescanning the buffer on next use."
; (wbol "\\(\\`\\|[\n\r]\\)[ \t]*")
(wbol "\\(^\\)[ \t]*") ; Need to keep the empty group because
;;; because match number are hard coded
- (label-re "\\\\label{\\([^}]*\\)}")
+ (label-re (concat "\\(?:"
+ ;; Normal \label{...}
+ "\\\\label{\\([^}]*\\)}"
+ "\\|"
+ ;; keyvals [..., label = {foo}, ...]
+ ;; forms used by ctable, listings,
+ ;; minted, ...
+ "\\[[^]]*label[[:space:]]*=[[:space:]]*{?\\(?1:[^],}]+\\)}?[^[]*\\]"
+ "\\)"))
(include-re (concat wbol
"\\\\\\("
(mapconcat 'identity
@@ -1312,6 +1320,8 @@ This enforces rescanning the buffer on next use."
"\\)\\([[{][^]}]*[]}]\\)*[[{]\\(%s\\)[]}]"))
(find-label-re-format
(concat "\\("
+ "\\[[^]]*label[[:space:]]*=[[:space:]]*{?\\(?1:[^],}]+\\)}?[^[]*\\]"
+ "\\|"
(mapconcat 'regexp-quote (append '("\\label")
macros-with-labels) "\\|")
"\\)\\([[{][^]}]*[]}]\\)*[[{]\\(%s\\)[]}]"))