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

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

[elpa] externals/auctex 7209776 46/57: Skip macros and environments from


From: Tassilo Horn
Subject: [elpa] externals/auctex 7209776 46/57: Skip macros and environments from tcolorbox and raster library
Date: Wed, 11 Jan 2017 18:01:42 +0000 (UTC)

branch: externals/auctex
commit 7209776eddeee0d01adf8f72ba4b5495c4bb7542
Author: Arash Esbati <address@hidden>
Commit: Arash Esbati <address@hidden>

    Skip macros and environments from tcolorbox and raster library
    
    * tex-ispell.el (TeX-ispell-sort-skip-cmds-list): Extract macros
    with optional argument from `TeX-ispell-skip-cmds-list'.
    (TeX-ispell-skip-cmds-opt-arg-regexp): New variable containing
    macros where only the optional argument is skipped while spell
    checking.
    Add macros and environments from tcolorbox.el and
    tcolorboxlib-raster.el.
---
 tex-ispell.el |   34 ++++++++++++++++++++++++++++------
 1 file changed, 28 insertions(+), 6 deletions(-)

diff --git a/tex-ispell.el b/tex-ispell.el
index 9578a91..2eb13c0 100644
--- a/tex-ispell.el
+++ b/tex-ispell.el
@@ -2,7 +2,7 @@
 
 ;; Copyright (C) 2016 Free Software Foundation, Inc.
 
-;; Author: Arash Esbati <arash.esbati'at'gmail.com>
+;; Author: Arash Esbati <address@hidden>
 ;; Maintainer: address@hidden
 ;; Keywords: tex, wp, convenience
 
@@ -59,6 +59,7 @@
 ;; splitidx.sty
 ;; tabularx.sty
 ;; tabulary.sty
+;; tcolorbox.sty
 ;; tikz.sty
 ;; varioref.sty
 
@@ -173,6 +174,12 @@
       ("SI" . 2)
       ;; splitidx.sty
       ("sindex" . 1)
+      ;; tcolorbox.sty
+      ("tcbox" . 0)
+      ("tcbset" . 1)
+      ("tcbsetforeverylayer" . 1)
+      ;; tcolorbox.sty -- raster library
+      ("tcbitem" . 0)
       ;; varioref.sty
       ("vref" . 1)
       ("Vref" . 1)
@@ -184,11 +191,12 @@
       ("vrefrange" . 2)
       ("vrefrange*" . 2)
       ("vpagerefrange" . 2)
-      ("vpagerefrange*" . 2) )
+      ("vpagerefrange*" . 2))
     "List of commands with arguments to be skipped.
 Each element of the list is a cons cell with command name
 \(string) as car and the number of mandatory arguments to be
-skipped as cdr."))
+skipped as cdr.  If number is 0, then only skip over the optional
+argument and spell check the mandatory one."))
 
 
 ;; Add new environments with one optional argument here:
@@ -202,7 +210,12 @@ skipped as cdr."))
       "itemize"
       "itemize*"
       ;; mdframed.sty
-      "mdframed")
+      "mdframed"
+      ;; tcolorbox.sty
+      "tcolorbox"
+      ;; tcolorbox.sty -- raster library
+      "tcbraster"
+      "tcbitemize")
     "List of LaTeX environments with an opt argument to be skipped."))
 
 
@@ -235,6 +248,8 @@ skipped as cdr."))
    ("minted" . "\\\\end{minted}")
    ;; tabularx.sty, tabulary.sty, Standard LaTeX tabular*-env
    ("tabular[*xy]" TeX-ispell-tex-arg-end)
+   ;; tcolorbox.sty -- raster library
+   ("tcboxed\\(raster\\|itemize\\)" ispell-tex-arg-end)
    ;; tikz.sty
    ("tikzpicture" . "\\\\end{tikzpicture}")
    ;; fancyvrb.sty: In practice, all verbatim environments have a *
@@ -248,13 +263,19 @@ skipped as cdr."))
 (eval-when-compile
   (defun TeX-ispell-sort-skip-cmds-list (arg)
     "Return elements from `TeX-ispell-skip-cmds-list' acc. to ARG."
-    (when (member arg '(1 2 3))
+    (when (member arg '(0 1 2 3))
       (let (cmds)
        (dolist (elt TeX-ispell-skip-cmds-list)
          (when (= (cdr elt) arg)
            (push (car elt) cmds)))
        cmds))))
 
+(defvar TeX-ispell-skip-cmds-opt-arg-regexp
+  (eval-when-compile
+    (concat "\\\\"
+           (regexp-opt (TeX-ispell-sort-skip-cmds-list 0) t)))
+  "Regexp of LaTeX commands with only optional arguments to be skipped.")
+
 (defvar TeX-ispell-skip-cmds-one-arg-regexp
   (eval-when-compile
     (concat "\\\\"
@@ -280,7 +301,8 @@ skipped as cdr."))
 
 ;; Make them available to Ispell:
 (TeX-ispell-skip-setcar
- `((,TeX-ispell-skip-cmds-one-arg-regexp ispell-tex-arg-end)
+ `((,TeX-ispell-skip-cmds-opt-arg-regexp ispell-tex-arg-end 0)
+   (,TeX-ispell-skip-cmds-one-arg-regexp ispell-tex-arg-end)
    (,TeX-ispell-skip-cmds-two-args-regexp ispell-tex-arg-end 2)
    (,TeX-ispell-skip-cmds-three-args-regexp ispell-tex-arg-end 3)))
 



reply via email to

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