From 11481cc647342f26fd53cc99d63e4e86caf7c9fc Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Mon, 18 Feb 2019 01:44:16 +0800 Subject: [PATCH] Refactor. --- doom-modeline-segments.el | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/doom-modeline-segments.el b/doom-modeline-segments.el index 4b50f35..eaff014 100644 --- a/doom-modeline-segments.el +++ b/doom-modeline-segments.el @@ -766,19 +766,20 @@ mouse-2: Show help for minor mode" (some-waiting "Running..." "") ((null known) (doom-modeline-checker-text "-" 'font-lock-doc-face)) (all-disabled (doom-modeline-checker-text "-" 'doom-modeline-urgent)) - (t (when (> (+ .error .warning .note) 0) - (if doom-modeline-checker-simple-format - (doom-modeline-checker-text (number-to-string (+ .error .warning .note)) - (cond ((> .error 0) 'doom-modeline-urgent) - ((> .warning 0) 'doom-modeline-warning) - (t 'doom-modeline-info))) - (format "%s/%s/%s" - (doom-modeline-checker-text (number-to-string .error) - 'doom-modeline-urgent) - (doom-modeline-checker-text (number-to-string .warning) - 'doom-modeline-warning) - (doom-modeline-checker-text (number-to-string .note) - 'doom-modeline-info)))))))) + (t (let ((num (+ .error .warning .note))) + (when (> num 0) + (if doom-modeline-checker-simple-format + (doom-modeline-checker-text (number-to-string num) + (cond ((> .error 0) 'doom-modeline-urgent) + ((> .warning 0) 'doom-modeline-warning) + (t 'doom-modeline-info))) + (format "%s/%s/%s" + (doom-modeline-checker-text (number-to-string .error) + 'doom-modeline-urgent) + (doom-modeline-checker-text (number-to-string .warning) + 'doom-modeline-warning) + (doom-modeline-checker-text (number-to-string .note) + 'doom-modeline-info))))))))) (propertize text 'help-echo (cond