[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX] reftex-label-alist for ctable package
From: |
Michael Bach |
Subject: |
Re: [AUCTeX] reftex-label-alist for ctable package |
Date: |
Tue, 31 Jul 2012 08:33:25 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
> Yes, stupidity on my side. I forgot to save a file before committing,
> so what ended up in the patch wasn't the final version.
>
> Attached is the corrected patch which works for me. If it doesn't for
> you, it would be good if you had a test document and a recipe how to
> reproduce the problem.
>
Patch did not work in my 23.0.92 emacs. Still no completion choices in the
*RefTeX Select* buffer.
My .emacs could also be the culprit so I went ahead and installed the
precompiled emacs 24.1 from GNU website. It did not work either...
Steps to reproduce:
1. Install fresh emacs 24.1 for Windows
2. M-x package-list-packages -> installed auctex 11.86
3. Applied latest patch via GnuWin patch utility from emacs home dir (patch -p0
< reftexpatch.patch).
4. Opened test file below
5. M-x reftex-mode
6. placed point after 'hallo'
7. C-c ) (reftex-reference)
8. t for tables -> empty selection buffer
Contents of test file:
--8<---------------cut here---------------start------------->8---
\documentclass{article}
\usepackage{ctable}
\begin{document}
hallo<POINT>
\ctable[
pos = htbp,
cap = shortcap,
caption = longcap,
label = me:tab,
]{lll}{
%\tnote[a]{Who is that guy?}
}{
\FL
Me & Myself & I
\ML
how & are & you? \NN
%\tnote[a]
I & am & fine
\LL
}
\end{document}
--8<---------------cut here---------------end--------------->8---
Patch below for reference. Hope this helps for debugging.
Best Regards,
Michael
=== modified file 'lisp/textmodes/reftex-vars.el'
--- lisp/textmodes/reftex-vars.el 2012-04-09 13:05:48 +0000
+++ lisp/textmodes/reftex-vars.el 2012-07-27 07:41:35 +0000
@@ -122,7 +122,14 @@
;;("\\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.")
=== modified file 'lisp/textmodes/reftex.el'
--- lisp/textmodes/reftex.el 2012-01-19 07:21:25 +0000
+++ lisp/textmodes/reftex.el 2012-07-27 17:55:20 +0000
@@ -1284,7 +1284,15 @@
; (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 @@
"\\)\\([[{][^]}]*[]}]\\)*[[{]\\(%s\\)[]}]"))
(find-label-re-format
(concat "\\("
+ "label[[:space:]]*=[[:space:]]*"
+ "\\|"
(mapconcat 'regexp-quote (append '("\\label")
macros-with-labels) "\\|")
"\\)\\([[{][^]}]*[]}]\\)*[[{]\\(%s\\)[]}]"))