mhayashi1120 / Emacs-langtool

LanguageTool for Emacs
GNU General Public License v3.0
377 stars 31 forks source link

Implement langtool-check for development language comments #42

Open rememberYou opened 5 years ago

rememberYou commented 5 years ago

Recently, I've been using your package and one of the things that caught my attention. Currently this package is great if you want to check the grammar of a text. However, it can also be useful to check the grammar of any comment in any development language.

I was surprised to see that there is not yet a function that would allow langtool-check to run only in code comments. In fact, such a function would avoid adding various rules in langtool-disabled-rules in order to avoid errors related to the syntax of the programming language. In addition, these disabled rules are a disadvantage because you would like to activate them in most cases.

My idea is this: what do you think about implementing a function like flyspell-prog-mode that would enable langtool only in comments when langtool-check runs in a mode other than markdown-mode, org-mode, text-mode?

Thank you for your work.

redguardtoo commented 5 years ago

Check my pull request at https://github.com/mhayashi1120/Emacs-langtool/pull/43

It supports any major mode (e.g., org-mode, prog-mode).

rememberYou commented 5 years ago

Thank you for your pull request, this going to make my life easier ☺️

I hope that the merge won't take too much time to do.