* textmodes/reftex-vars.el (reftex-label-regexps): New defcustom.
[bpt/emacs.git] / lisp / textmodes / reftex-vars.el
index db08ca3..c00cf36 100644 (file)
@@ -863,6 +863,20 @@ DOWNCASE    t:   Downcase words before using them."
                          (string :tag ""))
                 (option (boolean :tag "Downcase words          "))))
 
+(defcustom reftex-label-regexps
+  '(;; Normal \\label{foo} labels
+    "\\\\label{\\(?1:[^}]*\\)}"
+    ;; keyvals [..., label = {foo}, ...] forms used by ctable,
+    ;; listings, minted, ...
+    "\\[[^]]*\\<label[[:space:]]*=[[:space:]]*{?\\(?1:[^],}]+\\)}?")
+  "List of regexps matching \\label definitions.
+The default value matches usual \\label{...} definitions and
+keyval style [..., label = {...}, ...] label definitions.  It is
+assumed that the regexp group 1 matches the label text, so you
+have to define it using \\(?1:...\\) when adding new regexps."
+  :group 'reftex-defining-label-environments
+  :type '(repeat (regexp :tag "Regular Expression")))
+
 (defcustom reftex-label-illegal-re "[^-a-zA-Z0-9_+=:;,.]"
   "Regexp matching characters not valid in labels."
   :group 'reftex-making-and-inserting-labels
@@ -1125,12 +1139,12 @@ In the format, the following percent escapes will be expanded.
 %e   Works like %a, but on list of editor names. (%2e and %E work a well)
 
 It is also possible to access all other BibTeX database fields:
-%b booktitle     %c chapter        %d edition    %h howpublished
-%i institution   %j journal        %k key        %m month
-%n number        %o organization   %p pages      %P first page
-%r address       %s school         %u publisher  %t title
-%v volume        %y year
-%B booktitle, abbreviated          %T title, abbreviated
+%b booktitle     %c chapter   %d edition      %h howpublished
+%i institution   %j journal   %k key          %m month
+%n number        %N note      %o organization %p pages
+%P first page    %r address   %s school       %u publisher
+%U url           %t title     %v volume       %y year
+%B booktitle, abbreviated     %T title, abbreviated
 
 Usually, only %l is needed.  The other stuff is mainly for the echo area
 display, and for (setq reftex-comment-citations t).