New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flycheck reports 'the function ... is not known to be defined' for autoloaded elisp function. Why? #2063
Comments
Thanks for the detailed report 😍 |
Thanks for the quick reply! Any idea how to avoid the warning? |
@ktetzlaff You can use |
@bbatsov Yes, that works. However, I would need to add Or trick flycheck into ignoring the warning for a specific function? |
See |
@cpitclaudel I have |
I have the same issue, just with (use-package web-mode
:mode ("\\.vue\\'" . web-mode)
:config
(customize-set-variable 'web-mode-markup-indent-offset 2)
(customize-set-variable 'web-mode-css-indent-offset 2)
(customize-set-variable 'web-mode-code-indent-offset 2))
(defun my/twee-mode-language-at-pos ()
"Determine language at point, defaulting to web-mode if not Twee code."
(if (save-excursion
(beginning-of-line)
(looking-at "^\s*<<"))
"twee"
(web-mode-language-at-pos))) I get If I expand the (progn
(defvar use-package--warning43
(function
(lambda
(keyword err)
(let
((msg
(format "%s/%s: %s" 'web-mode keyword
(error-message-string err))))
(display-warning 'use-package msg :error)))))
(condition-case-unless-debug err
(progn
(unless
(fboundp 'web-mode)
(autoload
(function web-mode)
"web-mode" nil t))
(eval-after-load 'web-mode
'(condition-case-unless-debug err
(progn
(customize-set-variable 'web-mode-markup-indent-offset 2)
(customize-set-variable 'web-mode-css-indent-offset 2)
(customize-set-variable 'web-mode-code-indent-offset 2)
t)
(error
(funcall use-package--warning43 :config err))))
(add-to-list 'auto-mode-alist
'("\\.vue\\'" . web-mode)))
(error
(funcall use-package--warning43 :catch err)))) Seems like the Anyways, this isn't really a Flycheck bug. The byte compiler also complains. I just wish there was a way to get rid of these. |
Checklist
Problem description
Flycheck reports
the function ... is not known to be defined
for user defined, autoloaded elisp function. How do I get rid of this error?Steps to reproduce
test-flycheck-fn.el:
test-flycheck-autoloads.el:
test-flycheck.el:
emacs -Q --load "<testdir>/test-flycheck.el"
test-flycheck.el:15:2: Warning: the function ‘my-autoloaded-function’ is not known to be defined.
Expected behavior
No flycheck warning in step 3.
Screenshots
Screenshot showing the flycheck warning:
System configuration
Emacs configuration:
Additional notes
complete
flycheck-compile
output:The text was updated successfully, but these errors were encountered: