]> git.eshelyaron.com Git - emacs.git/commitdiff
* textmodes/reftex-vars.el (reftex-label-alist-builtin): Add
authorTassilo Horn <tassilo@member.fsf.org>
Fri, 27 Jul 2012 07:59:50 +0000 (09:59 +0200)
committerTassilo Horn <tassilo@member.fsf.org>
Fri, 27 Jul 2012 07:59:50 +0000 (09:59 +0200)
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.

lisp/ChangeLog
lisp/textmodes/reftex-vars.el
lisp/textmodes/reftex.el

index 99d41ee19bcf5ae237ce6dad6870cc5e1b8db3da..a91d5a2ea9812519a996aa0a9c1da9aab9cfc1f3 100644 (file)
@@ -1,3 +1,11 @@
+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
index 4c875a35b3e88db6f6cbca341e1c0997fbd2755e..187c98af21fa1739b2676505ac01b3dec3dca62e 100644 (file)
       ;;("\\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.")
index 8c349a2e20a0c614aba6c30b58950f352feb355c..c22703238435c4c9a7d3c738f380507a02a74550 100644 (file)
@@ -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\\)[]}]"))