]> code.delx.au - gnu-emacs/blobdiff - lisp/textmodes/reftex-vars.el
tildify.el: Rewrite `tildify-region' and co., add foreach function.
[gnu-emacs] / lisp / textmodes / reftex-vars.el
index df3d729adca5e3764a761d176b13ae34f7756ae9..3b497f2fb11982742c972cc9d12e519349b5558d 100644 (file)
@@ -1,6 +1,6 @@
 ;;; reftex-vars.el --- configuration variables for RefTeX
 
-;; Copyright (C) 1997-1999, 2001-2012 Free Software Foundation, Inc.
+;; Copyright (C) 1997-1999, 2001-2014 Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
 ;; Maintainer: auctex-devel@gnu.org
@@ -89,7 +89,7 @@
      (("wrapfigure" ?f nil nil caption)))
 
     (ctable    "The ctable package"
-     (("\\ctable[]{}{}{}" ?t "tab:" "\\ref{%s}" 1 ("table" "Tabelle"))))
+     (("\\ctable[]{}{}{}" ?t "tab:" "~\\ref{%s}" 1 ("table" "Tabelle"))))
 
     (listings  "The listings package"
      (("lstlisting" ?l "lst:" "~\\ref{%s}" nil (regexp "[Ll]isting"))))
 
       ;; The label macro is hard coded, but it *could* be defined like this:
       ;;("\\label{*}" nil nil nil nil)
-      )))
+      ))
+
+    ;; Texinfo
+    (Texinfo "Texinfo default environments" nil))
   "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.")
@@ -863,6 +866,49 @@ 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.
+
+When changed from Lisp, make sure to call
+`reftex-compile-variables' afterwards to make the change
+effective."
+  :version "24.4"
+  :set (lambda (symbol value)
+        (set symbol value)
+        (when (fboundp 'reftex-compile-variables)
+          (reftex-compile-variables)))
+  :group 'reftex-defining-label-environments
+  :type '(repeat (regexp :tag "Regular Expression")))
+
+(defcustom reftex-label-ignored-macros-and-environments nil
+  "List of macros and environments to be ignored when searching for labels.
+The purpose is to ignore environments and macros that use keyval
+style label=foo arguments, but the label has a different meaning
+than a \\label{foo}.  Standard \\label{...} definitions are never
+ignored.
+
+E.g., TikZ defines several macros/environments where [label=foo]
+defines the label to be printed at some node or edge, but it's
+not a label used for referencing.
+
+Note that this feature is only supported if you are using AUCTeX
+and the functions `TeX-current-macro' and
+`LaTeX-current-environment' are bound.  Also note that this
+feature might slow down the reftex parsing process for large TeX
+files."
+  :version "24.4"
+  :group 'reftex-defining-label-environments
+  :type '(repeat string))
+
 (defcustom reftex-label-illegal-re "[^-a-zA-Z0-9_+=:;,.]"
   "Regexp matching characters not valid in labels."
   :group 'reftex-making-and-inserting-labels
@@ -890,7 +936,7 @@ The function will be called with two arguments, the LABEL and the DEFAULT
 FORMAT, which usually is `\\label{%s}'.  The function should return the
 string to insert into the buffer."
   :group 'reftex-making-and-inserting-labels
-  :type 'function)
+  :type '(choice (const nil) function))
 
 ;; Label referencing
 
@@ -958,7 +1004,9 @@ This is used to string together whole reference sets, like
     ("Fancyref" "fancyref"
      (("\\fref" ?f) ("\\Fref" ?F)))
     ("Hyperref" "hyperref"
-     (("\\autoref" ?a) ("\\autopageref" ?u))))
+     (("\\autoref" ?a) ("\\autopageref" ?u)))
+    ("Cleveref" "cleveref"
+     (("\\cref" ?c) ("\\Cref" ?C) ("\\cpageref" ?d) ("\\Cpageref" ?D))))
   "Alist of reference styles.
 Each element is a list of the style name, the name of the LaTeX
 package associated with the style or t for any package, and an
@@ -968,6 +1016,7 @@ the macro type is being prompted for.  (See also
 `reftex-ref-macro-prompt'.)  The keys, represented as characters,
 have to be unique."
   :group 'reftex-referencing-labels
+  :version "24.3"
   :type '(alist :key-type (string :tag "Style name")
                :value-type (group (choice :tag "Package"
                                           (const :tag "Any package" t)
@@ -979,6 +1028,7 @@ have to be unique."
 (defcustom reftex-ref-macro-prompt t
   "If non-nil, `reftex-reference' prompts for the reference macro."
   :group 'reftex-referencing-labels
+  :version "24.3"
   :type 'boolean)
 
 (defcustom reftex-vref-is-default nil
@@ -1014,6 +1064,7 @@ can be cycled in the buffer for selecting a label.  The entries
 in the list have to match the respective reference style names
 used in the variable `reftex-ref-style-alist'."
   :group 'reftex-referencing-labels
+  :version "24.3"
   :type `(set ,@(mapcar (lambda (x) (list 'const (car x)))
                        reftex-ref-style-alist)))
 
@@ -1067,7 +1118,7 @@ buffer."
   :group 'reftex)
 
 (defcustom reftex-bibliography-commands
-  '("bibliography" "nobibliography" "setupbibtex\\[.*?database=")
+  '("bibliography" "nobibliography" "setupbibtex\\[.*?database=" "addbibresource")
   "LaTeX commands which specify the BibTeX databases to use with the document."
   :group 'reftex-citation-support
   :type '(repeat string))
@@ -1122,12 +1173,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).
@@ -1257,17 +1308,20 @@ should return the string to insert into the buffer."
 (defcustom reftex-cite-key-separator ","
   "String to be used for separating several keys in a \\cite macro."
   :group 'reftex-citation-support
+  :version "24.3"
   :type 'string)
 
 (defcustom reftex-create-bibtex-header nil
   "Header to insert in BibTeX files generated by RefTeX."
   :group 'reftex-citation-support
-  :type 'string)
+  :version "24.3"
+  :type '(choice (const :tag "No header" nil) string))
 
 (defcustom reftex-create-bibtex-footer nil
   "Footer to insert in BibTeX files generated by RefTeX."
   :group 'reftex-citation-support
-  :type 'string)
+  :version "24.3"
+  :type '(choice (const :tag "No footer" nil) string))
 
 ;; Index Support Configuration
 
@@ -1392,7 +1446,7 @@ last      The last used index tag will be offered as default."
   :group 'reftex-index-support
   :type '(choice
           (const :tag  "no default" nil)
-          (const :tag  "last used " 'last)
+          (const :tag  "last used " last)
           (string :tag "index tag " "idx")))
 
 (defcustom reftex-index-math-format "$%s$"