3

I am using Flycheck using use-package like so:

(use-package flycheck
  :ensure t
  :init
  (global-flycheck-mode))

I followed https://randstructure.wordpress.com/2015/06/21/using-emacs-flycheck-with-perl-and-perlbrew/ and tried adding the

'(flycheck-perl-include-path
(quote
("/myhomedir/myprojectdir")))

and it does not work.

2 Answers 2

4
(use-package flycheck
  :ensure t
  :init (global-flycheck-mode)
  (setq flycheck-perl-include-path '("/home/your/path/lib" 
"/home/your/other/path/lib")))
2

You can also set include paths per project or directory. Add a directory local variable flycheck-perl-include-path with a list of directory strings. Or just create a .dir-locals.el file with

((cperl-mode
  (flycheck-perl-include-path . ("../lib/" "path/to/you/lib"))))
3
  • One, I think there is an extra set of outer parens that are not needed. Two, I am getting error: "Symbol’s function definition is void: flycheck-perl-include-path". Suggestions?
    – mpersico
    Aug 24, 2021 at 14:34
  • I think extra parens are needed. For e.g., if your directory has multiple languages, you need to set ((cperl-mode ...) (python-mode ...)) etc... I am not sure about the symbol's def void error.
    – rajashekar
    Aug 24, 2021 at 14:42
  • Ah, ok on the extra parens then. I'll have to investigate the other issue.
    – mpersico
    Aug 24, 2021 at 17:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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