Refactor.

This commit is contained in:
Vincent Zhang 2019-02-18 01:44:16 +08:00
parent 57f1a98e58
commit 11481cc647

View file

@ -766,19 +766,20 @@ mouse-2: Show help for minor mode"
(some-waiting "Running..." "") (some-waiting "Running..." "")
((null known) (doom-modeline-checker-text "-" 'font-lock-doc-face)) ((null known) (doom-modeline-checker-text "-" 'font-lock-doc-face))
(all-disabled (doom-modeline-checker-text "-" 'doom-modeline-urgent)) (all-disabled (doom-modeline-checker-text "-" 'doom-modeline-urgent))
(t (when (> (+ .error .warning .note) 0) (t (let ((num (+ .error .warning .note)))
(if doom-modeline-checker-simple-format (when (> num 0)
(doom-modeline-checker-text (number-to-string (+ .error .warning .note)) (if doom-modeline-checker-simple-format
(cond ((> .error 0) 'doom-modeline-urgent) (doom-modeline-checker-text (number-to-string num)
((> .warning 0) 'doom-modeline-warning) (cond ((> .error 0) 'doom-modeline-urgent)
(t 'doom-modeline-info))) ((> .warning 0) 'doom-modeline-warning)
(format "%s/%s/%s" (t 'doom-modeline-info)))
(doom-modeline-checker-text (number-to-string .error) (format "%s/%s/%s"
'doom-modeline-urgent) (doom-modeline-checker-text (number-to-string .error)
(doom-modeline-checker-text (number-to-string .warning) 'doom-modeline-urgent)
'doom-modeline-warning) (doom-modeline-checker-text (number-to-string .warning)
(doom-modeline-checker-text (number-to-string .note) 'doom-modeline-warning)
'doom-modeline-info)))))))) (doom-modeline-checker-text (number-to-string .note)
'doom-modeline-info)))))))))
(propertize (propertize
text text
'help-echo (cond 'help-echo (cond