auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [AUCTeX] reftex-label-alist for ctable package


From: Tassilo Horn
Subject: Re: [AUCTeX] reftex-label-alist for ctable package
Date: Fri, 27 Jul 2012 20:04:39 +0200
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1.50 (gnu/linux)

Michael Bach <address@hidden> writes:

Hi Michael,

> I tried the newer patch in AUCTeX and org-mode and sadly this does not
> work for me... I also checked for old .elc files. RefTeX still works
> for figure labels but the table list in the *RefTeX Select* buffer
> remains empty.
>
> I double and triple checked whether I made the correct changes...
>
> Any ideas?

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.

Bye,
Tassilo

=== 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\\)[]}]"))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]