vfclists · 2022-09-04 14:07
Flycheck-mode highlights and errors or warnings in a file, can it be made to run on a file and display all the possible problems in a buffer?
I'm having a bit of tough time in Emacs Lisp, in that I don't see the errors in my code until I run it, ie the lack of compile time checks.
I just realized that some function calls in some of my code are totally wrong and only failed to notice them because they are lightly used and the code paths were never exercised.
Are there some techniques to get better compile time checking in Emacs Lisp? I know Common Lisp has some superior tools or techniques for that, but I need Emacs's best.
franburstall · 2022-09-04 15:21
>can it be made to run on a file and display all the possible problems in a buffer?
Yes! From the buffer containing yr code, do `M-x flycheck-mode` and then `flycheck-list-errors`.
MonsieurPi · 2022-09-04 19:57
If you use the doom modeline package you can even display the counter for the current file in the modeline: [https://seagle0128.github.io/doom-modeline/#feature](https://seagle0128.github.io/doom-modeline/#feature)
A simple setup (with use-package):
(use-package flycheck
:ensure t
:hook (prog-mode . flycheck-mode))
(use-package doom-modeline
:ensure t
:custom
;; Whether display the minions minor mode
(doom-modeline-minor-modes t)
:config
(doom-modeline-def-modeline 'my-simple-line
'(bar matches buffer-info remote-host buffer-position parrot selection-info)
'(misc-info minor-modes input-method buffer-encoding major-mode process vcs checker))
;; Add to `doom-modeline-mode-hook` or other hooks
(defun setup-custom-doom-modeline ()
(doom-modeline-set-modeline 'my-simple-line 'default))
(add-hook 'doom-modeline-mode-hook 'setup-custom-doom-modeline)