In my init.el file, I use the package general and the following line

(general-create-definer foo/leader-keys

and then later


I use the package flycheck to lint the code in the init-file and on that second line it gives me the warning

the function foo/leader-keys is not known to be defined

I would like to ask how to get rid of this warning, by either modifying the code in the init-file or customizing flycheck's linter, or some other reasonable way.


1 Answer 1


Okay, after some research, if using use-package when specifying the above settings it is possible to use the keywords :define, functions, and :commands. (More info here.) Quoting from use-package documentation

Another feature of use-package is that it always loads every file that it can when .emacs is being byte-compiled. This helps to silence spurious warnings about unknown variables and functions.

However, there are times when this is just not enough. For those times, use the :defines and :functions keywords to introduce dummy variable and function declarations solely for the sake of the byte-compiler.

  • This is essentially a link-only answer. Please explain/summarize what that "more info" says that answers the question.
    – Drew
    May 5, 2022 at 16:04

Your Answer

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

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