7

I use flycheck with flycheck-elisp-checkdoc checker active and find them fairly useful.

Still, I find it irritating to be nagged about missing (provide), section headers (;;; Code, ...), package metadata and similar things while I am editing my ~/emacs/etc (that's ~/.emacs split into smaller pieces). Those files are short configuration snippets and adding those comments would only make them longer and less readable.

So, what is the best way to disable those warnings in this very place (but only there, the same reminders are very useful once I edit my true lisp modules...)?

I do not really mind whether it would mean disabling flycheck-elisp-checkdoc checker for flycheck in this very dir, or reconfiguring checkdoc in this ery place, or something in-between – although the latter case would also handle other ways of spawning checkdoc…

8

Set flycheck-disabled-checkers to (emacs-lisp-checkdoc) via file or directory variables, i.e. M-x add-file-local-variable RET flycheck-disabled-checkers RET (emacs-lisp-checkdoc) or add-dir-local-variable RET emacs-lisp-mode RET flycheck-disabled-checkers RET (emacs-lisp-checkdoc) respectively.

See Syntax checkers in the Flycheck manual for more information.

  • Thank you, it works. I knew about flycheck-disabled-checkers but forgot that it can be set via dir-locals. – Mekk Apr 22 '15 at 14:52
  • (still curious whether sth similar can be configured also for M-x checkdoc, but that's not that important) – Mekk Apr 22 '15 at 14:54
  • Turns out there is minor annoyance in this solution. Whenever I start emacs, I get warning Warning (emacs): Failed to load file /home/marcink/DEV_hg/emacs/etc/.dir-locals.el: (invalid-function (emacs-lisp-mode (flycheck-disabled-checkers emacs-lisp-checkdoc))) (flycheck is loaded by one of those etc files, but looks like .dir-locals is interpreted when they are processed). – Mekk Apr 25 '15 at 6:47
  • 1
    Of course I have such code, that's the point of using this dir... Ahh, you mean my code reads .dir-locals.el too? Will take a look – Mekk Apr 25 '15 at 12:03
  • 1
    Yes, good point, my loop iterated over any .el files in etc directory, so catched .dir-locals.el too. Thank you for hint. – Mekk Apr 28 '15 at 9:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.