help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Flycheck reports are never satisfying!?


From: Sebastien Vauban
Subject: Flycheck reports are never satisfying!?
Date: Thu, 28 Aug 2014 14:05:14 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.93 (windows-nt)

Hello,

Trying to use, since short, Flycheck on all my prog modes; hence, on my
Emacs configuration file as well.

Though, as you can see on http://screencast.com/t/gfzLGy2h6fH, it never
is satisfying: there are always reports of errors or warnings, while my
code is completely clean (IMO).

Two ECM follow, showing what happens for all packages which I load and
customize.

    Note that, here, I took an extract from Flycheck's configuration
    itself, but the problem is the same with every third party
    package...

1. With an explicit package require:

--8<---------------cut here---------------start------------->8---
;;; .emacs-minimal.el --- Test file

;;; Commentary:

;;; Code:

(add-to-list 'load-path "~/.emacs.d/elpa/flycheck-20140824.731/")

(require 'flycheck)

;; modern on-the-fly syntax checking
(when (try-require 'flycheck)

  ;; indicate errors and warnings via icons in the left fringe
  (setq flycheck-indication-mode 'left-fringe)

  ;; enable Flycheck mode in all buffers
  (add-hook 'after-init-hook 'global-flycheck-mode))

(provide '.emacs-minimal)

;;; .emacs-minimal.el ends here
--8<---------------cut here---------------end--------------->8---

Flycheck reports one ERROR:

--8<---------------cut here---------------start------------->8---
    9   1 error    Cannot open load file: no such file or directory, flycheck 
(emacs-lisp)
--8<---------------cut here---------------end--------------->8---

2. With an implicit package require (call to function `try-require'):

--8<---------------cut here---------------start------------->8---
;;; .emacs-minimal2.el --- Test file

;;; Commentary:

;;; Internal function:

(defun try-require (feature)
  "Attempt to load a FEATURE (or library).
Return true if the library given as argument is successfully loaded.  If
not, just print a message."
  (condition-case err
      (progn (if (stringp feature)
                 (load-library feature)
               (require feature)) t)
    (file-error (message "Missing package `%s'!" feature) nil)))

;;; Code:

(add-to-list 'load-path "~/.emacs.d/elpa/flycheck-20140824.731/")

;; modern on-the-fly syntax checking
(when (try-require 'flycheck)

  ;; indicate errors and warnings via icons in the left fringe
  (setq flycheck-indication-mode 'left-fringe)

  ;; enable Flycheck mode in all buffers
  (add-hook 'after-init-hook 'global-flycheck-mode))

(provide '.emacs-minimal2)

;;; .emacs-minimal2.el ends here
--8<---------------cut here---------------end--------------->8---

Flycheck reports one warning:

--8<---------------cut here---------------start------------->8---
   25   9 warning  assignment to free variable `flycheck-indication-mode' 
(emacs-lisp)
--8<---------------cut here---------------end--------------->8---

How am I supposed to do, if Flycheck reports things that shouldn't be
reported?

Best regards,
  Seb

-- 
Sebastien Vauban


reply via email to

[Prev in Thread] Current Thread [Next in Thread]