Giter Club home page Giter Club logo

Comments (7)

cpitclaudel avatar cpitclaudel commented on June 13, 2024

Thanks for the detailed report 😍
The warning is computed by the Emacs bytecode compiler, not by Flycheck itself. You can use M-x flycheck-compile to see exactly how it is invoked.

from flycheck.

ktetzlaff avatar ktetzlaff commented on June 13, 2024

The warning is computed by the Emacs bytecode compiler, not by Flycheck itself.

Thanks for the quick reply! Any idea how to avoid the warning?

from flycheck.

bbatsov avatar bbatsov commented on June 13, 2024

@ktetzlaff You can use declare-function for this. See https://www.gnu.org/software/emacs/manual/html_node/elisp/Declaring-Functions.html

from flycheck.

ktetzlaff avatar ktetzlaff commented on June 13, 2024

You can use declare-function for this. ...

@bbatsov Yes, that works. However, I would need to add declare-function to a lot of files. Is it somehow possible to declare a function globally? I.e. make a user defined function work like a built-in/preloaded function?

Or trick flycheck into ignoring the warning for a specific function?

from flycheck.

cpitclaudel avatar cpitclaudel commented on June 13, 2024

See flycheck-emacs-lisp-load-path maybe?

from flycheck.

ktetzlaff avatar ktetzlaff commented on June 13, 2024

See flycheck-emacs-lisp-load-path maybe?

@cpitclaudel I have flycheck-emacs-lisp-load-path set to inherit and the flycheck-compile output shows that the directory containing the test files gets added (--directory /home/kail/tmp). So: No - unfortunately that doesn't help.

from flycheck.

daedsidog avatar daedsidog commented on June 13, 2024

I have the same issue, just with the function ‘...' might not be defined at runtime. I have code such as this:

(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 the function ‘web-mode-language-at-pos’ might not be defined at runtime. even though if I use (require 'web-mode) it works just fine.

If I expand the use-package macro, I get:

(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 require part is under a conditional, which is why the byte compiler may have trouble recognizing this.

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.

from flycheck.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.