emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/auctex 00df9a5 37/57: Check new custom option before ac


From: Tassilo Horn
Subject: [elpa] externals/auctex 00df9a5 37/57: Check new custom option before activating RefTeX cite format
Date: Wed, 11 Jan 2017 18:01:40 +0000 (UTC)

branch: externals/auctex
commit 00df9a526165836430c9b0d8ddfb261550f30a88
Author: Arash Esbati <address@hidden>
Commit: Arash Esbati <address@hidden>

    Check new custom option before activating RefTeX cite format
    
    * doc/changes.texi: Document new variable.
    
    * style/biblatex.el ("biblatex"):
    * style/harvard.el ("harvard"):
    * style/jurabib.el ("jurabib"):
    * style/natbib.el ("natbib"): Set cite format provided by RefTeX
    when `LaTeX-reftex-cite-format-auto-activate' is non-nil.
    
    * tex-style.el (LaTeX-reftex-cite-format-auto-activate): New
    customizable variable.
---
 doc/changes.texi  |    9 +++++++++
 style/biblatex.el |    3 ++-
 style/harvard.el  |    3 ++-
 style/jurabib.el  |    5 ++---
 style/natbib.el   |    5 +++--
 tex-style.el      |    5 +++++
 6 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/doc/changes.texi b/doc/changes.texi
index c737a7f..54abc65 100644
--- a/doc/changes.texi
+++ b/doc/changes.texi
@@ -12,6 +12,15 @@
 
 @itemize @bullet
 @item
address@hidden has a new custom option
address@hidden which controls the
+automatic activation of citation formats provided by RefTeX when a style
+file is loaded and RefTeX is enabled.  Currently, @file{biblatex.el},
address@hidden, @file{jurabib.el} and @file{natbib.el} use this
+feature.  If you have customized @code{reftex-cite-format} and want to
+use your settings, you should set this variable to @code{nil}.
+
address@hidden
 In addition to the completion performed by @code{TeX-complete-symbol},
 @AUCTeX{} now also supports the new Emacs standard completion-at-point
 facility (see the Emacs command @code{completion-at-point}).  This also
diff --git a/style/biblatex.el b/style/biblatex.el
index 4231509..32d585a 100644
--- a/style/biblatex.el
+++ b/style/biblatex.el
@@ -556,7 +556,8 @@ for citation keys."
    ;; `reftex-cite-format-builtin' in reftex-vars.el which will be
    ;; part of Emacs >= 25.3.  It does not issue an error for older
    ;; Emacsen, but does not work either, i.e. it is ignored.
-   (when (fboundp 'reftex-set-cite-format)
+   (when (and LaTeX-reftex-cite-format-auto-activate
+             (fboundp 'reftex-set-cite-format))
      (if (or (LaTeX-provided-package-options-member "biblatex" "natbib")
             (LaTeX-provided-package-options-member "biblatex" "natbib=true"))
         (reftex-set-cite-format 'natbib)
diff --git a/style/harvard.el b/style/harvard.el
index 08addb4..9a97e71 100644
--- a/style/harvard.el
+++ b/style/harvard.el
@@ -103,7 +103,8 @@
                 LaTeX-item-list))
 
      ;; Tell RefTeX
-     (when (fboundp 'reftex-set-cite-format)
+     (when (and LaTeX-reftex-cite-format-auto-activate
+               (fboundp 'reftex-set-cite-format))
        (reftex-set-cite-format 'harvard)))
  LaTeX-dialect)
 
diff --git a/style/jurabib.el b/style/jurabib.el
index 1919c06..b8fc87c 100644
--- a/style/jurabib.el
+++ b/style/jurabib.el
@@ -144,9 +144,8 @@
                                'variable))
 
      ;; Tell RefTeX (Thanks, Carsten)
-     (when (and (fboundp 'reftex-set-cite-format)
-               ;; Is it `reftex-cite-format' customized?
-               (not (get 'reftex-cite-format 'saved-value)))
+     (when (and LaTeX-reftex-cite-format-auto-activate
+               (fboundp 'reftex-set-cite-format))
        ;; Check if RefTeX supports jurabib.
        (if (assoc 'jurabib reftex-cite-format-builtin)
           ;; Yes, use the provided default.
diff --git a/style/natbib.el b/style/natbib.el
index 2bad500..f0664fd 100644
--- a/style/natbib.el
+++ b/style/natbib.el
@@ -159,8 +159,9 @@
                              'function))
 
    ;; Tell RefTeX
-   (if (fboundp 'reftex-set-cite-format)
-       (reftex-set-cite-format 'natbib)))
+   (when (and LaTeX-reftex-cite-format-auto-activate
+             (fboundp 'reftex-set-cite-format))
+     (reftex-set-cite-format 'natbib)))
  LaTeX-dialect)
 
 (defun LaTeX-arg-natbib-notes (optional)
diff --git a/tex-style.el b/tex-style.el
index 8a11de9..223c364 100644
--- a/tex-style.el
+++ b/tex-style.el
@@ -41,6 +41,11 @@
   :type 'boolean
   :group 'LaTeX-style)
 
+(defcustom LaTeX-reftex-cite-format-auto-activate t
+  "Whether to activate automatically RefTeX citation format."
+  :type 'boolean
+  :group 'LaTeX-style)
+
 ;; style/amsmath.el
 
 (defcustom LaTeX-amsmath-label nil



reply via email to

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