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

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

[elpa] externals/auctex 5708567 26/95: Improve parsing process in style/


From: Tassilo Horn
Subject: [elpa] externals/auctex 5708567 26/95: Improve parsing process in style/color.el
Date: Sun, 16 Apr 2017 01:26:48 -0400 (EDT)

branch: externals/auctex
commit 570856701b560deb8853fbfc004e175eb8702b7c
Author: Arash Esbati <address@hidden>
Commit: Arash Esbati <address@hidden>

    Improve parsing process in style/color.el
    
    * style/color.el (LaTeX-color-definecolor-regexp): Remove
    unnecessary 2nd and 3rd arguments from regexp.
    (LaTeX-color-auto-cleanup): Delete unnecessary function and remove
    it from `TeX-auto-cleanup-hook'.
---
 style/color.el | 29 +++++------------------------
 1 file changed, 5 insertions(+), 24 deletions(-)

diff --git a/style/color.el b/style/color.el
index 1b878d3..0a9c74a 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, 2016 Free Software Foundation, Inc.
+;; Copyright (C) 2015--2017 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <address@hidden>
 ;; Maintainer: address@hidden
@@ -61,37 +61,18 @@
 ;; Needed for auto-parsing.
 (require 'tex)
 
-;; Plug color into the parser -- after that we have the following:
-;; 1. LaTeX-auto-color-definecolor: Name of temporary variable used
-;; when parsing.
-;; 2. LaTeX-add-color-definecolors: Name of function to add
-;; information to add to #3.
-;; 3. LaTeX-color-definecolor-list: Name of variable holding buffer
-;; local information.
-;; 4. LaTeX-color-definecolors-changed: Name of variable indicating
-;; that #3 has changed.
+;; Plug \definecolor into the parser
 (TeX-auto-add-type "color-definecolor" "LaTeX")
 
 (defvar LaTeX-color-definecolor-regexp
-  '("\\\\definecolor{\\([^}]+\\)}{\\([^}]+\\)}{\\([^}]+\\)}"
-    1 LaTeX-auto-color-definecolor)
-  "Matches the arguments of `\\definecolor' from `color'
-package.")
+  '("\\\\definecolor{\\([^}]+\\)}" 1 LaTeX-auto-color-definecolor)
+  "Matches the argument of \\definecolor from color package.")
 
 (defun LaTeX-color-auto-prepare ()
   "Clear `LaTeX-auto-color-definecolor' before parsing."
-  (setq        LaTeX-auto-color-definecolor nil))
-
-(defun LaTeX-color-auto-cleanup ()
-  "Move parsed colors from `LaTeX-auto-color-definecolor' to
-`LaTeX-color-definecolor-list'."
-  ;; \definecolor{<name>}{<model>}{<colour-spec>}
-  ;; color=<name>, ignored=<model>, ignored=<colour-spec>
-  (dolist (color LaTeX-auto-color-definecolor)
-    (add-to-list 'LaTeX-color-definecolor-list (list color))))
+  (setq LaTeX-auto-color-definecolor nil))
 
 (add-hook 'TeX-auto-prepare-hook #'LaTeX-color-auto-prepare t)
-(add-hook 'TeX-auto-cleanup-hook #'LaTeX-color-auto-cleanup t)
 (add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
 
 (defun TeX-arg-color-definecolor (optional &optional prompt)



reply via email to

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