From 42d5d8c36013d9b8c64a22edd69ca42a021ba77e Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Tue, 24 May 2016 20:07:45 -0700 Subject: [emacs] Change mode line for flycheck. Display a unicode symbol to represent the status of the tests. --- emacs.d/core/core-flycheck.el | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/emacs.d/core/core-flycheck.el b/emacs.d/core/core-flycheck.el index 7118f83..ab33887 100644 --- a/emacs.d/core/core-flycheck.el +++ b/emacs.d/core/core-flycheck.el @@ -12,6 +12,25 @@ (setq-default flycheck-disabled-checkers '(emacs-lisp-checkdoc))) :config (progn + (setq flycheck-mode-line + '(:eval + (pcase flycheck-last-status-change + (`not-checked nil) + (`no-checker (propertize " -" 'face 'warning)) + (`running "") + (`errored (propertize " ✘" 'face 'error)) + (`finished + (if flycheck-current-errors + (let* ((error-counts (flycheck-count-errors flycheck-current-errors)) + (no-errors (cdr (assq 'error error-counts))) + (no-warnings (cdr (assq 'warning error-counts))) + (flycheck-face (cond (no-errors 'error) + (no-warnings 'warning)))) + (propertize (format " [✗:%s/%s]" (or no-errors 0) (or no-warnings 0)) 'face flycheck-face)) + (propertize " [✓]" 'face 'success))) + (`interrupted " -") + (`suspicious '(propertize " ?" 'face 'warning))))) + (flycheck-define-checker source-check "A syntax checker for python source code in Source, using `check.pex'" :command ("check.pex" source) -- cgit 1.4.1