AtomLinter / linter-spell-latex

Provider for Atom linter-spell package to enable LaTeX spell checking.
MIT License
8 stars 7 forks source link

Make language selection not cause warnings #14

Closed raphinesse closed 7 years ago

raphinesse commented 7 years ago

Allow a format for the language selection comment that does not itself cause a spelling warning.

This allows %!TeX spell_check = LANGUAGE_CODES to select the document language, since spellcheck as one word is deemed a spelling mistake by hunspell with en-US. (It still accepts the old version though to keep backwards compatibility)

yitzchak commented 7 years ago

TeX magic comments should not be checked by default since the scope comment.line.percentage.directive.texshop.tex is excluded. What language pack for LaTeX support are you using?

raphinesse commented 7 years ago

I use language-latex and my magic comments only have .comment.line.percentage.tex.

yitzchak commented 7 years ago

The pattern in language-latex requires the magic pattern to be all uppercase like %!TEX spellcheck = en-US.

As an aside, language-latex has not been maintained for over a year. I suggest using the fork language-tex which is being actively maintained. I just submitted a PR to fix the casing issue in the magic patterns at yudai-nkt/language-tex#12.

raphinesse commented 7 years ago

Thanks for the advice. I'll give it a try.

yitzchak commented 7 years ago

No problem. I'll leave the PR open until we see what happens with the language-tex PR.

Thanks again!

yitzchak commented 7 years ago

yudai-nkt/language-tex#12 just got merged so I am closing.

raphinesse commented 7 years ago

Alright, it works for me. However, one might still consider to incorporate this change, because most people that do not know better will probably install language-latex and experience the same odd behavior like me.

IMHO, the only reason not to change it, would be if the magic spell check comment already was a well known one. Is it? Do other programs parse it in the original format used by you?

yitzchak commented 7 years ago

I agree that the name of spellcheck is quite awful, but unfortunately this was established by TeXworks so it is probably a bit standardized. I probably would have chosen something like %!TeX languages = en-US.

raphinesse commented 7 years ago

I see, but that is a good reason to keep it as is.