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

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

[elpa] elpa 7e3bec8 44/51: Run `TeX-add-symbols' if "xcolor" is not an a


From: Tassilo Horn
Subject: [elpa] elpa 7e3bec8 44/51: Run `TeX-add-symbols' if "xcolor" is not an active style
Date: Sun, 22 May 2016 07:22:50 +0000 (UTC)

branch: elpa
commit 7e3bec88c69b684bb98c0d6b5b0031ad8aa80eca
Author: Arash Esbati <address@hidden>
Commit: Mosè Giordano <address@hidden>

    Run `TeX-add-symbols' if "xcolor" is not an active style
    
    * style/color.el ("color"): Check if "xcolor" is an active style
    and then run `TeX-add-symbols' on commands defined by "color.sty"
    and add fontification support.
    
    Signed-off-by: Mosè Giordano <address@hidden>
---
 style/color.el |   79 ++++++++++++++++++++++++++++----------------------------
 1 file changed, 40 insertions(+), 39 deletions(-)

diff --git a/style/color.el b/style/color.el
index 9d008b7..a7cce3f 100644
--- a/style/color.el
+++ b/style/color.el
@@ -1,6 +1,6 @@
 ;;; color.el --- AUCTeX style for `color.sty' (v1.1a)
 
-;; Copyright (C) 2015 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2016 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <esbati'at'gmx.de>
 ;; Maintainer: address@hidden
@@ -259,44 +259,45 @@ package.")
                  (LaTeX-provided-package-options-member "color" "dvipsnames")))
      (apply #'LaTeX-add-color-definecolors LaTeX-color-dvipsnames-colors))
 
-   (TeX-add-symbols
-    ;; \definecolor{<name>}{<model>}{<color spec>}
-    '("definecolor" TeX-arg-color-definecolor)
-
-    ;; \color{<name>} or \color[<model>]{<color spec>}
-    '("color" TeX-arg-color)
-
-    ;; \textcolor{<name>}{<text>} or
-    ;; \textcolor[<model>]{<color spec>}{<text>}
-    '("textcolor" TeX-arg-color "Text")
-
-    ;; \pagecolor{<name>} or
-    ;; \pagecolor[<model>]{<color spec>}
-    '("pagecolor" TeX-arg-color)
-
-    ;; \nopagecolor
-    '("nopagecolor" 0)
-
-    ;; \colorbox{<name>}{<text>} or
-    ;; \colorbox[<model>]{<color spec>}{<text>}
-    '("colorbox" TeX-arg-color "Text")
-
-    ;; \fcolorbox{<frame color name>}{<box color name>}{<text>} or
-    ;; \fcolorbox[<model>]{<frame color spec>}{<box color spec>}{<text>}
-    '("fcolorbox" TeX-arg-color-fcolorbox "Text"))
-
-   ;; Fontification
-   (when (and (featurep 'font-latex)
-             (eq TeX-install-font-lock 'font-latex-setup))
-     (font-latex-add-keywords '(("color"         "[{")
-                               ("pagecolor"     "[{"))
-                             'type-declaration)
-     (font-latex-add-keywords '(("textcolor"     "[{{")
-                               ("colorbox"      "[{{" )
-                               ("fcolorbox"     "[{{{"))
-                             'type-command)
-     (font-latex-add-keywords '(("definecolor"    "{{{"))
-                             'function)))
+   (unless (member "xcolor" (TeX-style-list))
+     (TeX-add-symbols
+      ;; \definecolor{<name>}{<model>}{<color spec>}
+      '("definecolor" TeX-arg-color-definecolor)
+
+      ;; \color{<name>} or \color[<model>]{<color spec>}
+      '("color" TeX-arg-color)
+
+      ;; \textcolor{<name>}{<text>} or
+      ;; \textcolor[<model>]{<color spec>}{<text>}
+      '("textcolor" TeX-arg-color "Text")
+
+      ;; \pagecolor{<name>} or
+      ;; \pagecolor[<model>]{<color spec>}
+      '("pagecolor" TeX-arg-color)
+
+      ;; \nopagecolor
+      '("nopagecolor" 0)
+
+      ;; \colorbox{<name>}{<text>} or
+      ;; \colorbox[<model>]{<color spec>}{<text>}
+      '("colorbox" TeX-arg-color "Text")
+
+      ;; \fcolorbox{<frame color name>}{<box color name>}{<text>} or
+      ;; \fcolorbox[<model>]{<frame color spec>}{<box color spec>}{<text>}
+      '("fcolorbox" TeX-arg-color-fcolorbox "Text"))
+
+     ;; Fontification
+     (when (and (featurep 'font-latex)
+               (eq TeX-install-font-lock 'font-latex-setup))
+       (font-latex-add-keywords '(("color"         "[{")
+                                 ("pagecolor"     "[{"))
+                               'type-declaration)
+       (font-latex-add-keywords '(("textcolor"     "[{{")
+                                 ("colorbox"      "[{{" )
+                                 ("fcolorbox"     "[{{{"))
+                               'type-command)
+       (font-latex-add-keywords '(("definecolor"    "{{{"))
+                               'function))))
  LaTeX-dialect)
 
 (defvar LaTeX-color-package-options



reply via email to

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