aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTassilo Horn2012-07-27 09:59:50 +0200
committerTassilo Horn2012-07-27 09:59:50 +0200
commit86332df22ae3934334c7ced64aa6aedd5767b121 (patch)
tree05ec47a532dd1b853963cb6ae665641a8e33e581
parenteeaea515623db982d4e7d453711e6f0fad9c08d8 (diff)
downloademacs-86332df22ae3934334c7ced64aa6aedd5767b121.tar.gz
emacs-86332df22ae3934334c7ced64aa6aedd5767b121.zip
* 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.
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/textmodes/reftex-vars.el9
-rw-r--r--lisp/textmodes/reftex.el12
3 files changed, 27 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 99d41ee19bc..a91d5a2ea98 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12012-07-27 Tassilo Horn <tsdh@gnu.org>
2
3 * textmodes/reftex-vars.el (reftex-label-alist-builtin): Add
4 support for the lstlisting and minted environments, and for the
5 ctable macro.
6 * textmodes/reftex.el (reftex-compile-variables): Also recognize
7 labels written in keyvals syntax.
8
12012-07-27 Jay Belanger <jay.p.belanger@gmail.com> 92012-07-27 Jay Belanger <jay.p.belanger@gmail.com>
2 10
3 * calc/calccomp.el (math-compose-expr): Use parentheses when 11 * calc/calccomp.el (math-compose-expr): Use parentheses when
diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el
index 4c875a35b3e..187c98af21f 100644
--- a/lisp/textmodes/reftex-vars.el
+++ b/lisp/textmodes/reftex-vars.el
@@ -122,7 +122,14 @@
122 ;;("\\label{*}" nil nil nil nil) 122 ;;("\\label{*}" nil nil nil nil)
123 )) 123 ))
124 124
125 ) 125 (ctable "The ctable package"
126 (("\\ctable[]{}{}{}" ?t "tab:" "\\ref{%s}" 1 ("table" "Tabelle"))))
127
128 (listings "The listings package"
129 (("lstlisting" ?l "lst:" "~\\ref{%s}" nil (regexp "[Ll]isting"))))
130
131 (minted "The minted package"
132 (("minted" ?l "lst:" "~\\ref{%s}" nil (regexp "[Ll]isting")))))
126 "The default label environment descriptions. 133 "The default label environment descriptions.
127Lower-case symbols correspond to a style file of the same name in the LaTeX 134Lower-case symbols correspond to a style file of the same name in the LaTeX
128distribution. Mixed-case symbols are convenience aliases.") 135distribution. Mixed-case symbols are convenience aliases.")
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."
1284; (wbol "\\(\\`\\|[\n\r]\\)[ \t]*") 1284; (wbol "\\(\\`\\|[\n\r]\\)[ \t]*")
1285 (wbol "\\(^\\)[ \t]*") ; Need to keep the empty group because 1285 (wbol "\\(^\\)[ \t]*") ; Need to keep the empty group because
1286 ;;; because match number are hard coded 1286 ;;; because match number are hard coded
1287 (label-re "\\\\label{\\([^}]*\\)}") 1287 (label-re (concat "\\(?:"
1288 ;; Normal \label{...}
1289 "\\\\label{\\([^}]*\\)}"
1290 "\\|"
1291 ;; keyvals [..., label = {foo}, ...]
1292 ;; forms used by ctable, listings,
1293 ;; minted, ...
1294 "\\[[^]]*label[[:space:]]*=[[:space:]]*{?\\(?1:[^],}]+\\)}?[^[]*\\]"
1295 "\\)"))
1288 (include-re (concat wbol 1296 (include-re (concat wbol
1289 "\\\\\\(" 1297 "\\\\\\("
1290 (mapconcat 'identity 1298 (mapconcat 'identity
@@ -1312,6 +1320,8 @@ This enforces rescanning the buffer on next use."
1312 "\\)\\([[{][^]}]*[]}]\\)*[[{]\\(%s\\)[]}]")) 1320 "\\)\\([[{][^]}]*[]}]\\)*[[{]\\(%s\\)[]}]"))
1313 (find-label-re-format 1321 (find-label-re-format
1314 (concat "\\(" 1322 (concat "\\("
1323 "\\[[^]]*label[[:space:]]*=[[:space:]]*{?\\(?1:[^],}]+\\)}?[^[]*\\]"
1324 "\\|"
1315 (mapconcat 'regexp-quote (append '("\\label") 1325 (mapconcat 'regexp-quote (append '("\\label")
1316 macros-with-labels) "\\|") 1326 macros-with-labels) "\\|")
1317 "\\)\\([[{][^]}]*[]}]\\)*[[{]\\(%s\\)[]}]")) 1327 "\\)\\([[{][^]}]*[]}]\\)*[[{]\\(%s\\)[]}]"))