> Am 24.09.2016 um 14:16 schrieb David Reitter <
david....@gmail.com>:
>
> Konrad,
> I’m unfamiliar with the CocoAspell support we have. There is generally a lot of code for aspell, and ispell-language-abbrev-alist may be relevant.
>
> In any case, Aquamacs supports spelling with the system spell checker out of the box, which works well for me in various languages.
Sure, I know. However, for Aquamacs as LaTeX-editor, cocoaspell worked much better concerning skipping latex-code. Apparently, without cocoaspell, NS-spellchecking just deal with latex-code according to ispell.el’s code:
(defvar ispell-skip-region-alist
`((ispell-words-keyword forward-line)
(ispell-dictionary-keyword forward-line)
(ispell-pdict-keyword forward-line)
(ispell-parsing-keyword forward-line)
(,(purecopy "^---*BEGIN PGP [A-Z ]*--*")
. ,(purecopy "^---*END PGP [A-Z ]*--*"))
;; assume multiline uuencoded file? "\nM.*$"?
(,(purecopy "^begin [0-9][0-9][0-9] [^ \t]+$") . ,(purecopy "\nend\n"))
(,(purecopy "^%!PS-Adobe-[123].0") . ,(purecopy "\n%%EOF\n"))
(,(purecopy "^---* \\(Start of \\)?[Ff]orwarded [Mm]essage")
. ,(purecopy "^---* End of [Ff]orwarded [Mm]essage"))
;; Matches e-mail addresses, file names, http addresses, etc. The
;; `-+' `_+' patterns are necessary for performance reasons when
;; `-' or `_' part of word syntax.
; (,(purecopy "\\(--+\\|_+\\|\\(/\\w\\|\\(\\(\\w\\|[-_]\\)+[.:@]\\)\\)\\(\\w\\|[-_]\\)*\\([.:/@]+\\(\\w\\|[-_~=?&]\\)+\\)+\\)"))
;; above checks /.\w sequences
;;("\\(--+\\|\\(/\\|\\(\\(\\w\\|[-_]\\)+[.:@]\\)\\)\\(\\w\\|[-_]\\)*\\([.:/@]+\\(\\w\\|[-_~=?&]\\)+\\)+\\)")
;; This is a pretty complex regexp. It can be simplified to the following:
;; "\\(\\w\\|[-_]\\)*\\([.:/@]+\\(\\w\\|[-_]\\|~\\)+\\)+"
;; but some valid text will be skipped, e.g. "his/her". This could be
;; fixed up (at the expense of a moderately more complex regexp)
;; by not allowing "/" to be the character which triggers the
;; identification of the computer name, e.g.:
;; "\\(\\w\\|[-_]\\)+[.:@]\\(\\w\\|[-_]\\)*\\([.:/@]+\\(\\w\\|[-_]\\|~\\)+\\)+"
)
"Alist expressing beginning and end of regions not to spell check.
The alist key must be a regular expression.
Valid forms include:
(KEY) - just skip the key.
(KEY . REGEXP) - skip to the end of REGEXP. REGEXP may be string or symbol.
(KEY REGEXP) - skip to end of REGEXP. REGEXP must be a string.
(KEY FUNCTION ARGS) - FUNCTION called with ARGS returns end of region.")
(put 'ispell-skip-region-alist 'risky-local-variable t)
and
(defvar ispell-tex-skip-alists
(purecopy
'((;;("%\\[" . "%\\]") ; AMStex block comment...
;; All the standard LaTeX keywords from L. Lamport's guide:
;; \cite, \hspace, \hspace*, \hyphenation, \include, \includeonly, \input,
;; \label, \nocite, \rule (in ispell - rest included here)
("\\\\addcontentsline" ispell-tex-arg-end 2)
("\\\\add\\(tocontents\\|vspace\\)" ispell-tex-arg-end)
("\\\\\\([aA]lph\\|arabic\\)" ispell-tex-arg-end)
;;("\\\\author" ispell-tex-arg-end)
("\\\\bibliographystyle" ispell-tex-arg-end)
("\\\\makebox" ispell-tex-arg-end 0)
("\\\\e?psfig" ispell-tex-arg-end)
("\\\\document\\(class\\|style\\)" .
"\\\\begin[ \t\n]*{[ \t\n]*document[ \t\n]*}"))
(;; delimited with \begin. In ispell: displaymath, eqnarray, eqnarray*,
;; equation, minipage, picture, tabular, tabular* (ispell)
("\\(figure\\|table\\)\\*?" ispell-tex-arg-end 0)
("list" ispell-tex-arg-end 2)
("program" . "\\\\end[ \t\n]*{[ \t\n]*program[ \t\n]*}")
("verbatim\\*?" . "\\\\end[ \t\n]*{[ \t\n]*verbatim\\*?[ \t\n]*}"))))
"Lists of regions to be skipped in TeX mode.
First list is used raw.
Second list has key placed inside \\begin{}.
Delete or add any regions you want to be automatically selected
for skipping in latex mode.")
(put 'ispell-tex-skip-alist 'risky-local-variable t)
while with aspell on can use in addition via aspell-conf, e.g.,
mode tex
add-f-tex-command citet Op
add-f-tex-command possessivecite Op
add-f-tex-command citep OOp
add-f-tex-command citealp Oop
add-f-tex-command citeauthor p
add-f-tex-command citeyear p
add-f-tex-command eqref p
add-f-tex-command DeclareMathOperator pp
add-f-tex-command bibliographystyle p
add-f-tex-command @ifundefined pp
add-f-tex-command addtocounter pp
add-f-tex-command addtolength pp
add-f-tex-command alpha p
add-f-tex-command arabic p
add-f-tex-command fnsymbol p
add-f-tex-command roman p
add-f-tex-command stepcounter p
add-f-tex-command setcounter pp
add-f-tex-command usecounter p
add-f-tex-command value p
add-f-tex-command newcounter po
add-f-tex-command refstepcounter p
add-f-tex-command label p
add-f-tex-command pageref p
add-f-tex-command ref p
add-f-tex-command newcommand ppop
add-f-tex-command renewcommand ppop
add-f-tex-command newenvironment poopp
add-f-tex-command renewenvironment poOPP
add-f-tex-command newtheorem popo
add-f-tex-command newfont pp
add-f-tex-command documentclass op
add-f-tex-command usepackage op
add-f-tex-command begin po
add-f-tex-command end p
add-f-tex-command setlength pp
add-f-tex-command settowidth pp
add-f-tex-command settodepth pp
add-f-tex-command settoheight pp
add-f-tex-command enlargethispage p
add-f-tex-command hyphenation p
add-f-tex-command pagenumbering p
add-f-tex-command pagestyle p
add-f-tex-command addvspace p
add-f-tex-command framebox ooP
add-f-tex-command hspace p
add-f-tex-command vspace p
add-f-tex-command makebox ooP
add-f-tex-command parbox ooopP
add-f-tex-command raisebox pooP
add-f-tex-command rule opp
add-f-tex-command sbox pO
add-f-tex-command savebox pooP
add-f-tex-command usebox p
add-f-tex-command include p
add-f-tex-command includeonly p
add-f-tex-command input p
add-f-tex-command addcontentsline ppP
add-f-tex-command addtocontents pP
add-f-tex-command fontencoding p
add-f-tex-command fontfamily p
add-f-tex-command fontseries p
add-f-tex-command fontshape p
add-f-tex-command fontsize pp
add-f-tex-command usefont pppp
add-f-tex-command documentstyle op
add-f-tex-command cite p
add-f-tex-command nocite p
add-f-tex-command psfig p
add-f-tex-command selectlanguage p
add-f-tex-command includegraphics op
add-f-tex-command bibitem op
add-f-tex-command geometry p
add-f-tex-command @ifundefined pp
add-f-tex-command unknown o
which gives much better skipping of latex-code, and is easy to implement for a user.
Konrad
> --
> You received this message because you are subscribed to the Google Groups "aquamacs-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
aquamacs-deve...@googlegroups.com.