emacs-languagetool / flymake-languagetool

Flymake support for LanguageTool
GNU General Public License v3.0
33 stars 11 forks source link

fix(flymake-languagetool.el): Address compile warnings #10

Closed jcs090218 closed 2 years ago

jcs090218 commented 2 years ago

I think there is a warning in the compile log:

In flymake-languagetool--ov-at-point:
flymake-languagetool.el:290:17:Warning: assignment to free variable
    ‘flymake-languagetool-current-cand’

In flymake-languagetool--suggestions:
flymake-languagetool.el:295:13:Warning: reference to free variable
    ‘flymake-languagetool-current-cand’

In flymake-languagetool--clean-overlay:
flymake-languagetool.el:305:18:Warning: reference to free variable
    ‘flymake-languagetool-current-cand’
flymake-languagetool.el:306:9:Warning: assignment to free variable
    ‘flymake-languagetool-current-cand’

In flymake-languagetool-correct-at-point:
flymake-languagetool.el:346:22:Warning: assignment to free variable
    ‘flymake-languagetool-current-cand’
flymake-languagetool.el:357:15:Warning: reference to free variable
    ‘flymake-languagetool-current-cand’
jcs090218 commented 2 years ago

I noticed flymake-languagetool--disabled-rules and flymake-languagetool--spelling-rules variables are now opened to public. Maybe we should rename it to single dash - instead of two? (single dash for public vars, two for private vars)

Might want to use defcustom instead of defvar for flymake-languagetool--spelling-rules variable as well.

cc @tpeacock19

jcs090218 commented 2 years ago

I agree with the defcustoms and public naming conventions. Do you want to make that change and we can merge this PR, or should I create a separate?

You can merge this PR, or create another PR to overwrite this one. Either ways would work! :)

tpeacock19 commented 2 years ago

Also, have you had a chance to try the corrections? if you have any suggestions or feedback, I would appreciate. I would love to have a standard flymake correction interface/package. But, I imagine there are not too many that provide corrections/suggestions.

jcs090218 commented 2 years ago

I think this is a cool idea! 😁 I haven't tried it yet but LGTM by looking at the code.