+2012-07-27 Tassilo Horn <tsdh@gnu.org>
+
+ * 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.
+
2012-07-27 Jay Belanger <jay.p.belanger@gmail.com>
* calc/calccomp.el (math-compose-expr): Use parentheses when
;;("\\label{*}" nil nil nil nil)
))
- )
+ (ctable "The ctable package"
+ (("\\ctable[]{}{}{}" ?t "tab:" "\\ref{%s}" 1 ("table" "Tabelle"))))
+
+ (listings "The listings package"
+ (("lstlisting" ?l "lst:" "~\\ref{%s}" nil (regexp "[Ll]isting"))))
+
+ (minted "The minted package"
+ (("minted" ?l "lst:" "~\\ref{%s}" nil (regexp "[Ll]isting")))))
"The default label environment descriptions.
Lower-case symbols correspond to a style file of the same name in the LaTeX
distribution. Mixed-case symbols are convenience aliases.")
; (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
"\\)\\([[{][^]}]*[]}]\\)*[[{]\\(%s\\)[]}]"))
(find-label-re-format
(concat "\\("
+ "\\[[^]]*label[[:space:]]*=[[:space:]]*{?\\(?1:[^],}]+\\)}?[^[]*\\]"
+ "\\|"
(mapconcat 'regexp-quote (append '("\\label")
macros-with-labels) "\\|")
"\\)\\([[{][^]}]*[]}]\\)*[[{]\\(%s\\)[]}]"))