[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX-devel] Spell checking of macros
From: |
Arash Esbati |
Subject: |
Re: [AUCTeX-devel] Spell checking of macros |
Date: |
Thu, 30 Jun 2016 12:53:30 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 |
Mosè Giordano <address@hidden> writes:
> 2016-06-26 11:06 GMT+02:00 Arash Esbati <address@hidden>:
>>
>> Currently, I don't have an idea how to integrate Flyspell into this.
>
> Ok, fine, this shouldn't prevent you from going on with your work on
> ispell ;-)
No worries ;-) Here is the current state of affairs. I patched tex.el
and latex.el with:
--8<---------------cut here---------------start------------->8---
diff --git a/latex.el b/latex.el
index babcd1a..c21699d 100644
--- a/latex.el
+++ b/latex.el
@@ -30,6 +30,7 @@
(require 'tex)
(require 'tex-style)
+(require 'tex-ispell)
(eval-when-compile (require 'cl)) ;FIXME: Use cl-lib.
;;; Syntax
diff --git a/tex.el b/tex.el
index 6c302bb..748782b 100644
--- a/tex.el
+++ b/tex.el
@@ -6521,6 +6521,39 @@ NAME may be a package, a command, or a document."
(append '(plain-tex-mode ams-tex-mode latex-mode doctex-mode)
ispell-tex-major-modes))
+(defcustom TeX-ispell-extend-skip-list t
+ "Whether to extend regions selected for skipping during spell checking."
+ :group 'TeX-misc
+ :type 'boolean)
+
+;; These functions are used to add new items to
+;; `ispell-tex-skip-alists' -- see tex-ispell.el:
+(defun TeX-ispell-skip-setcar (skip)
+ "Add SKIP to car of `ispell-tex-skip-alists'.
+SKIP is a list of lists. Lists have the format described in
+`ispell-tex-skip-alists' and are added on top of the car of it.
+This only happens if `TeX-ispell-extend-skip-list' is non-nil."
+ (if TeX-ispell-extend-skip-list
+ (let ((raws (car ispell-tex-skip-alists))
+ (envs (cadr ispell-tex-skip-alists)))
+ (dolist (x skip)
+ (pushnew x raws :test #'equal))
+ (setq ispell-tex-skip-alists (list raws envs)))
+ (ignore skip)))
+
+(defun TeX-ispell-skip-setcdr (skip)
+ "Add SKIP to cdr of `ispell-tex-skip-alists'.
+SKIP is a list of lists. Lists have the format described in
+`ispell-tex-skip-alists' and are added on top of the cdr of it.
+This only happens if `TeX-ispell-extend-skip-list' is non-nil."
+ (if TeX-ispell-extend-skip-list
+ (let ((raws (car ispell-tex-skip-alists))
+ (envs (cadr ispell-tex-skip-alists)))
+ (dolist (x skip)
+ (pushnew x envs :test #'equal))
+ (setq ispell-tex-skip-alists (list raws envs)))
+ (ignore skip)))
+
;;; Abbrev mode
--8<---------------cut here---------------end--------------->8---
and wrote tex-ispell.el.
tex-ispell.el
Description: application/emacs-lisp
I also have a small file for testing; my plan is to put it under
tests/latex.
ispell-addons.tex
Description: TeX document
Comments are welcome.
Best, Arash