branch: externals/auctex commit d5951e68d492e6b7509fb18fdc98622c003a3c76 Author: Arash Esbati <ar...@gnu.org> Commit: Arash Esbati <ar...@gnu.org>
Improve skipping of inline verbatim macros * tex-ispell.el (TeX-ispell-verb-opening-delimiters) (TeX-ispell-verb-closing-delimiters): New customizable options. (TeX-ispell-skip-setcar): Skip inline verbatim macros from listings and fancyvrb package. Use new variables for minted package. --- tex-ispell.el | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/tex-ispell.el b/tex-ispell.el index 7fba305..0b08f40 100644 --- a/tex-ispell.el +++ b/tex-ispell.el @@ -72,6 +72,18 @@ (require 'tex) +(defcustom TeX-ispell-verb-opening-delimiters "{!|#\"*/+-" + "String with all opening delimiters for verb macros. +The elements must match `TeX-ispell-verb-closing-delimiters'." + :group 'TeX-misc + :type 'string) + +(defcustom TeX-ispell-verb-closing-delimiters "}!|#\"*/+-" + "String with all closing delimiters for verb macros. +The elements must match `TeX-ispell-verb-opening-delimiters'." + :group 'TeX-misc + :type 'string) + ;; Add new macros here: (eval-when-compile (defvar TeX-ispell-skip-cmds-list @@ -281,19 +293,23 @@ Environments for math or verbatim text are candidates for this list.")) ;; Add others delimited here: (TeX-ispell-skip-setcar - '(;; LaTeX-base + `(;; LaTeX-base ("\\\\(" . "\\\\)") ("\\\\raisebox" TeX-ispell-tex-arg-end 1 2 0) ;; booktabs.sty ("\\\\cmidrule" . "{[-0-9]+}") ;; fontspec.sty ("\\\\fontspec" TeX-ispell-tex-arg-end 1 1 0) + ;; listings.sty & fancyvrb.sty: + (,(concat "\\\\\\(lstinline\\|Verb\\)\\(\\[[^]]*\\]\\)?" + "[" TeX-ispell-verb-opening-delimiters "]") + . + ,(concat "[" TeX-ispell-verb-closing-delimiters "]")) ;; minted.sty - ("\\\\mint\\(inline\\)?\\(\\[[^]]*\\]\\)?{\\([^}]+\\)}{" . "}") - ("\\\\mint\\(inline\\)?\\(\\[[^]]*\\]\\)?{\\([^}]+\\)}|" . "|") - ("\\\\mint\\(inline\\)?\\(\\[[^]]*\\]\\)?{\\([^}]+\\)}#" . "#") - ("\\\\mint\\(inline\\)?\\(\\[[^]]*\\]\\)?{\\([^}]+\\)}\\+" . "\\+") - ("\\\\mint\\(inline\\)?\\(\\[[^]]*\\]\\)?{\\([^}]+\\)}\\*" . "\\*"))) + (,(concat "\\\\mint\\(inline\\)?\\(\\[[^]]*\\]\\)?{\\([^}]+\\)}" + "[" TeX-ispell-verb-opening-delimiters "]") + . + ,(concat "[" TeX-ispell-verb-closing-delimiters "]")))) ;; Add environments here: