AUCTeX Sync -- Updated Style Files.
[packages] / xemacs-packages / auctex / style / varioref.el
1 ;;; varioref.el --- AUCTeX style file with support for varioref.sty
2
3 ;; Copyright (C) 1999, 2013, 2015 Free Software Foundation, Inc.
4
5 ;; Author: Carsten Dominik <dominik@strw.leidenuniv.nl>
6 ;;         Mads Jensen <mje@inducks.org>
7 ;; Maintainer: auctex-devel@gnu.org
8
9 ;; This file is part of AUCTeX.
10
11 ;; AUCTeX is free software; you can redistribute it and/or modify it
12 ;; under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 3, or (at your option)
14 ;; any later version.
15
16 ;; AUCTeX is distributed in the hope that it will be useful, but
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19 ;; General Public License for more details.
20
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with AUCTeX; see the file COPYING.  If not, write to the Free
23 ;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
24 ;; 02110-1301, USA.
25
26 ;;; Code:
27
28 (TeX-add-style-hook "varioref"
29    (lambda ()
30
31      (TeX-add-symbols
32
33       ;; The macros with label arguments
34       '("vref" TeX-arg-ref)
35       '("Vref" TeX-arg-ref)
36       '("vrefrange" [ "Same page text" ] TeX-arg-ref TeX-arg-ref)
37       '("vrefrange*" [ "Same page text" ] TeX-arg-ref TeX-arg-ref)
38       '("vref*" TeX-arg-ref)
39       '("Vref" TeX-arg-ref)
40       '("Ref" TeX-arg-ref)
41       '("vpageref" [ "Same page text" ] [ "Different page text" ] TeX-arg-ref)
42       '("vpageref*" [ "Same page text" ] [ "Different page text" ]
43         TeX-arg-ref)
44       '("fullref" TeX-arg-ref)
45       '("labelformat" TeX-arg-counter t)
46
47       '("vpagerefrange" [ "Same page text" ] TeX-arg-ref TeX-arg-ref)
48       '("vpagerefrange*" [ "Same page text" ] TeX-arg-ref TeX-arg-ref)
49
50       ;; And the other macros used for customization
51       "reftextbefore" "reftextfacebefore"
52       "reftextafter"  "reftextfaceafter" "reftexlabelrange"
53       "reftextfaraway" "vreftextvario" "vrefwarning"
54       "vpagerefnum" "vrefshowerrors")
55
56      ;; Install completion for labels.  Only offer completion for
57      ;; commands that take only one reference as an argument
58      (setq TeX-complete-list
59            (append
60             '(("\\\\[Vv]ref{\\([^{}\n\r\\%,]*\\)" 1 LaTeX-label-list "}")
61               ("\\\\vref\\*?{\\([^{}\n\r\\%,]*\\)" 1 LaTeX-label-list "}")
62               ("\\\\Ref{\\([^{}\n\r\\%,]*\\)" 1 LaTeX-label-list "}")
63               ("\\\\vref\\*{\\([^{}\n\r\\%,]*\\)" 1 LaTeX-label-list "}")
64               ("\\\\fullref{\\([^{}\n\r\\%,]*\\)" 1 LaTeX-label-list "}")
65               ("\\\\vpageref\\*?\\(\\[[^]]*\\]\\)*{\\([^{}\n\r\\%,]*\\)"
66                2 LaTeX-label-list "}"))
67             TeX-complete-list))
68
69      ;; Fontification
70      (when (and (fboundp 'font-latex-add-keywords)
71                 (eq TeX-install-font-lock 'font-latex-setup))
72        (font-latex-add-keywords '(;; vref is already in font-latex.el,
73                                   ;; so don't add it here again
74                                   ("Vref"          "*{")
75                                   ("vpageref"      "*[[{")
76                                   ("vrefrange"     "*[{{")
77                                   ("Ref"           "{")
78                                   ("fullref"       "{")
79                                   ("vpagerefrange" "*[{{"))
80                                 'reference))
81
82      ;; Activate RefTeX reference style.
83      (and LaTeX-reftex-ref-style-auto-activate
84           (fboundp 'reftex-ref-style-activate)
85           (reftex-ref-style-activate "Varioref")))
86    LaTeX-dialect)
87
88 (defvar LaTeX-varioref-package-options
89   '("draft" "final" "afrikaans" "american" "austrian" "naustrian" "basque"
90     "brazil" "breton" "bahasam" "catalan" "croatian" "czech" "danish"
91     "dutch" "english" "esperanto" "finnish" "french" "galician" "german"
92     "icelandic" "ngerman" "greek" "italian" "magyar" "norsk" "nynorsk"
93     "polish" "portuges" "romanian" "russian" "slovak" "slovene"
94     "spanish" "swedish" "turkish" "ukrainian" "francais" "germanb")
95   "Package options for the varioref package.")
96
97 ;;; varioref.el ends here