branch: elpa
commit 4ed66ee71b12f88010808972f1cf697a7b72828d
Author: Mosè Giordano <[email protected]>
Commit: Mosè Giordano <[email protected]>
Activate RefTeX reference styles
* tex-style.el (LaTeX-reftex-ref-style-auto-activate): New
customizable variable.
* style/cleveref.el ("cleveref"): Activate RefTeX reference style.
* style/fancyref.el ("fancyref"): Ditto.
* style/varioref.el ("varioref"): Ditto.
* style/hyperref.el ("hyperref"): Use
`LaTeX-reftex-ref-style-auto-activate'.
---
style/cleveref.el | 9 +++++++--
style/fancyref.el | 9 +++++++--
style/hyperref.el | 7 ++++---
style/varioref.el | 9 +++++++--
tex-style.el | 9 ++++++++-
5 files changed, 33 insertions(+), 10 deletions(-)
diff --git a/style/cleveref.el b/style/cleveref.el
index 755239d..4d039e1 100644
--- a/style/cleveref.el
+++ b/style/cleveref.el
@@ -1,6 +1,6 @@
;;; cleveref.el --- Style hook for the `cleveref.sty' package.
-;; Copyright (C) 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2014, 2015 Free Software Foundation, Inc.
;; Author: Matthew Leach <[email protected]>
;; Maintainer: [email protected]
@@ -93,7 +93,12 @@ list of defined labels."
("labelcpageref" "{"))
'reference)
;; For syntactic fontification, e.g. verbatim constructs.
- (font-latex-set-syntactic-keywords)))
+ (font-latex-set-syntactic-keywords))
+
+ ;; Activate RefTeX reference style.
+ (and LaTeX-reftex-ref-style-auto-activate
+ (fboundp 'reftex-ref-style-activate)
+ (reftex-ref-style-activate "Cleveref")))
LaTeX-dialect)
(defvar LaTeX-cleveref-package-options
diff --git a/style/fancyref.el b/style/fancyref.el
index 94b7e15..ce3053d 100644
--- a/style/fancyref.el
+++ b/style/fancyref.el
@@ -1,6 +1,6 @@
;;; fancyref.el --- AUCTeX style file with support for fancyref.sty
-;; Copyright (C) 1999, 2014 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2014, 2015 Free Software Foundation, Inc.
;; Author: Carsten Dominik <[email protected]>
;; Maintainer: [email protected]
@@ -92,7 +92,12 @@
;; Fontification
(when (and (featurep 'font-latex)
(eq TeX-install-font-lock 'font-latex-setup))
- (font-latex-add-keywords '(("fref" "[{") ("Fref" "[{")) 'reference)))
+ (font-latex-add-keywords '(("fref" "[{") ("Fref" "[{")) 'reference))
+
+ ;; Activate RefTeX reference style.
+ (and LaTeX-reftex-ref-style-auto-activate
+ (fboundp 'reftex-ref-style-activate)
+ (reftex-ref-style-activate "Fancyref")))
LaTeX-dialect)
;; The following list keeps a list of available format names
diff --git a/style/hyperref.el b/style/hyperref.el
index 630f24c..f2063b9 100644
--- a/style/hyperref.el
+++ b/style/hyperref.el
@@ -299,9 +299,10 @@
;; For syntactic fontification, e.g. verbatim constructs.
(font-latex-set-syntactic-keywords))
- ;; RefTeX
- (when (fboundp 'reftex-ref-style-activate)
- (reftex-ref-style-activate "Hyperref")))
+ ;; Activate RefTeX reference style.
+ (and LaTeX-reftex-ref-style-auto-activate
+ (fboundp 'reftex-ref-style-activate)
+ (reftex-ref-style-activate "Hyperref")))
LaTeX-dialect)
(defun LaTeX-hyperref-package-options ()
diff --git a/style/varioref.el b/style/varioref.el
index 8811391..7684ba4 100644
--- a/style/varioref.el
+++ b/style/varioref.el
@@ -1,6 +1,6 @@
;;; varioref.el --- AUCTeX style file with support for varioref.sty
-;; Copyright (C) 1999, 2013 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2013, 2015 Free Software Foundation, Inc.
;; Author: Carsten Dominik <[email protected]>
;; Mads Jensen <[email protected]>
@@ -64,7 +64,12 @@
("\\\\fullref{\\([^{}\n\r\\%,]*\\)" 1 LaTeX-label-list "}")
("\\\\vpageref\\*?\\(\\[[^]]*\\]\\)*{\\([^{}\n\r\\%,]*\\)"
2 LaTeX-label-list "}"))
- TeX-complete-list)))
+ TeX-complete-list))
+
+ ;; Activate RefTeX reference style.
+ (and LaTeX-reftex-ref-style-auto-activate
+ (fboundp 'reftex-ref-style-activate)
+ (reftex-ref-style-activate "Varioref")))
LaTeX-dialect)
(defvar LaTeX-varioref-package-options
diff --git a/tex-style.el b/tex-style.el
index b03a004..a1ffb97 100644
--- a/tex-style.el
+++ b/tex-style.el
@@ -1,6 +1,6 @@
;;; tex-style.el --- Customizable variables for AUCTeX style files
-;; Copyright (C) 2005, 2007, 2009, 2012-2014
+;; Copyright (C) 2005, 2007, 2009, 2012-2015
;; Free Software Foundation, Inc.
;; Author: Reiner Steib <[email protected]>
@@ -34,6 +34,13 @@
;; Note: We don't have any defcustom in plain TeX style files yet. Else we
;; should also create a TeX-style group.
+;; Common
+
+(defcustom LaTeX-reftex-ref-style-auto-activate t
+ "Whether to activate automatically RefTeX reference styles."
+ :type 'boolean
+ :group 'LaTeX-style)
+
;; style/amsmath.el
(defcustom LaTeX-amsmath-label nil