3

I am starting to use flycheck. I am using use-package and the form for flycheck looks like this:

(use-package flycheck :ensure t :config (setq flycheck-highlighting-mode 'lines) (global-flycheck-mode t)) 

When i am edting some emacs lisp file i get this information from flycheck:

Syntax checkers for buffer init.el in emacs-lisp-mode:

First checker to run:

emacs-lisp-checkdoc

- may enable: yes - executable: Found at /usr/local/bin/emacs 

Checkers that are compatible with this mode, but will not run until properly configured:

emacs-lisp

- may enable: yes - may run: nil - executable: Found at /usr/local/bin/emacs - next checkers: emacs-lisp-checkdoc 

Flycheck Mode is enabled. Use C-u C-c ! x to enable disabled checkers.


Flycheck version: 20240726.456 Emacs version: 30.1 System:
x86_64-pc-linux-gnu Window system: x

/usr/local/bin/emacs is the emacs i am running and I am really wondering why the the emacs-lisp syntax checker is "not properly configured". I have looked at the Message buffer and tried to find something related via "some search engine" and on emacs.stackexchange - with no luck.

EDIT1: I have als started "emacs -Q" added flycheck to the load-path and ran flycheck-verify-setup. I got the same result for the emacs-lisp checker "may run: nil"

If I run "C-u C-c ! x" as mentioned by flycheck-verify-setup I get the response "No syntax checkers diabled in this buffer".

EDIT2: (flycheck--emacs-lisp-enabled-p) C-x C-e in some emacs-lisp-mode enabled buffer gives t.

5
  • That is strange. With my stock flycheck config, I did M-x flycheck-verify-setup and my emacs-lisp was set to may enable: yes, may run: t. What happens if you do C-u C-c ! x to enable the emacs-lisp checker? Commented Apr 2 at 1:22
  • @g-gundam please see updated question Commented Apr 3 at 7:10
  • It seems like a function called flycheck--emacs-lisp-enabled-p is responsible for the value printed after may run. Can you try putting (flycheck--emacs-lisp-enabled-p) in an elisp file and evaluating it. For me, it returns t but I wonder if it'll be nil for you. Commented Apr 4 at 7:01
  • thanks a lof for looking into this, @g-gundam. apparently this returns t for me, too. Commented Apr 4 at 11:43
  • 1
    @g-gundam, you encouraged me to look into flycheck.el and i have found that the emacs-lisp checker defines a predicate that prevents the checker from beeing run in buffers that are not ment to be byte-compiled and i was in fact in buffer for the "init.el" file, which is not ment to be byte compiled... i think i can close my question :-) Commented Apr 4 at 11:55

1 Answer 1

2

It turns out the emacs-lisp checker is defined by flycheck to not run in files that are not ment to be byte compiled (variable no-byte-compile) and as i was working in init.el (which has no-byte-compile set) the emacs-lisp checker was having "may run: nil".

So, to get more information about why flycheck reports "may run" or "may enable" with this or that value one has to check the definition of the according checker. Part of the definition are the values for ":enabled" (which determines if the checker will be enabled) and ":predicate" which determines if the chcker "may run" in a certain buffer.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.