abingham / flycheck-vale

Flycheck integration for the vale natural language linter
MIT License
64 stars 16 forks source link

Enable in Org mode #11

Closed manuel-uberti closed 5 years ago

manuel-uberti commented 5 years ago

Hi,

thanks for this package. I am using latest version from MELPA, configured like this:

(use-package flycheck-vale              ; Flycheck setup for Vale
  :ensure t
  :after flycheck
  :hook (flycheck-mode . flycheck-vale-setup)
  :config (validate-setq flycheck-vale-modes
                         '(text-mode org-mode markdown-mode rst-mode)))

However, in a Org file if I issue flycheck-verify-setup I get:

Syntax checkers for buffer 22-rollerland.org in org-mode:

There are no syntax checkers for this buffer!

Flycheck Mode is enabled. Use C-u C-c ! x to enable disabled checkers.

--------------------

Flycheck version: 32snapshot (package: 20180907.1319)
Emacs version:    27.0.50
System:           x86_64-debian-linux-gnu
Window system:    x

Everything is working fine in Markdown files. Also, running vale from the command line on that same Org file results in this:

22-rollerland.org
 7:73   warning  Consider removing 'Possibly'    vale.Hedging        
 8:10   error    'this day and age' is a         proselint.Cliches   
                 cliche.                                             
 19:64  error    Remove 'very'.                  proselint.Very      
 19:64  warning  Consider removing 'very'        vale.Editorializing 
 47:69  warning  Consider removing 'very'        vale.Editorializing 
 47:69  error    Remove 'very'.                  proselint.Very      
 64:62  warning  Consider removing 'probably'    vale.Hedging        
abingham commented 5 years ago

Like you, I though that modifying flycheck-vale-modes would enable flycheck for the new modes. Unfortunately, it looks like flycheck only looks at that list when the checker is initially defined, not afterward. I think the correct thing to do is to call (flycheck-add-mode 'vale 'org-mode) to add org-mode to the list of modes for flycheck-vale. This seems to work for me, so it should get you going in the short term.

Longer term, I'm going to update flycheck-vale-modes to include org-mode, and I'm going to make it a const.

If this all works for you, please close this issue. Thanks for reporting it!

manuel-uberti commented 5 years ago

Thanks for the suggestion, @abingham, it works now.

abingham commented 5 years ago

Excellent. Commit 131dacdf55e2b469d64543e4ae373aa93ec40a4f adds org-mode to the default list.

manuel-uberti commented 5 years ago

Oh, awesome. Thanks again.