>From 5350f9675f0826de3eca10852513125fbeadac14 Mon Sep 17 00:00:00 2001 From: Arash Esbati Date: Tue, 17 May 2016 14:09:19 +0200 Subject: [PATCH 2/5] 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. --- 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 ;; 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{}{}{} - '("definecolor" TeX-arg-color-definecolor) - - ;; \color{} or \color[]{} - '("color" TeX-arg-color) - - ;; \textcolor{}{} or - ;; \textcolor[]{}{} - '("textcolor" TeX-arg-color "Text") - - ;; \pagecolor{} or - ;; \pagecolor[]{} - '("pagecolor" TeX-arg-color) - - ;; \nopagecolor - '("nopagecolor" 0) - - ;; \colorbox{}{} or - ;; \colorbox[]{}{} - '("colorbox" TeX-arg-color "Text") - - ;; \fcolorbox{}{}{} or - ;; \fcolorbox[]{}{}{} - '("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{}{}{} + '("definecolor" TeX-arg-color-definecolor) + + ;; \color{} or \color[]{} + '("color" TeX-arg-color) + + ;; \textcolor{}{} or + ;; \textcolor[]{}{} + '("textcolor" TeX-arg-color "Text") + + ;; \pagecolor{} or + ;; \pagecolor[]{} + '("pagecolor" TeX-arg-color) + + ;; \nopagecolor + '("nopagecolor" 0) + + ;; \colorbox{}{} or + ;; \colorbox[]{}{} + '("colorbox" TeX-arg-color "Text") + + ;; \fcolorbox{}{}{} or + ;; \fcolorbox[]{}{}{} + '("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 -- 2.8.1