From 7eb4a0f7b84389a3c02570ca7daaf35b3a11daa9 Mon Sep 17 00:00:00 2001 From: Jen-Chieh Shen Date: Tue, 14 Mar 2023 18:55:18 -0700 Subject: [PATCH] feat(clean): Improve messages while task cleaning all (#165) --- CHANGELOG.md | 1 + lisp/clean/all.el | 32 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd85ada9..c51746bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how * Allow few commands' execution without any Eask-file (#159) * Add command `cat` (#160) * Improve messages while processing package transaction (#164) +* Improve messages while task cleaning all (#165) ## 0.8.x > Released Mar 08, 2023 diff --git a/lisp/clean/all.el b/lisp/clean/all.el index 5bedfdf8..fc144158 100644 --- a/lisp/clean/all.el +++ b/lisp/clean/all.el @@ -17,8 +17,8 @@ (defvar eask-no-cleaning-operation-p nil "Set to non-nil if there is no cleaning operation done.") -(defvar eask--clean-tasks-total 0 - "Total clean tasks.") +(defvar eask--clean-tasks-count 0 + "Count cleaning task.") (defvar eask--clean-tasks-cleaned 0 "Total cleaned tasks") @@ -27,33 +27,33 @@ "Print clean up TITLE and execute BODY." (declare (indent 1)) `(let (eask-no-cleaning-operation-p) + (cl-incf eask--clean-tasks-count) (eask-with-progress - (format "%s... " ,title) + (concat " - [" (eask-2str eask--clean-tasks-count) "/6] " + (format "%s... " ,title)) (eask-with-verbosity 'debug ,@body) - (progn - (cl-incf eask--clean-tasks-total) - (if eask-no-cleaning-operation-p - "skipped ✗" - (cl-incf eask--clean-tasks-cleaned) - "done ✓"))))) + (if eask-no-cleaning-operation-p + "skipped ✗" + (cl-incf eask--clean-tasks-cleaned) + "done ✓")))) (eask-start - (eask--clean-section "Cleaning workspace" + (eask--clean-section (format "Cleaning %s" (ansi-green "workspace")) (eask-call "clean/workspace")) - (eask--clean-section "Cleaning byte-compile files" + (eask--clean-section (format "Cleaning %s files" (ansi-green "byte-compile (.elc)")) (eask-call "clean/elc")) - (eask--clean-section "Cleaning dist" + (eask--clean-section (format "Cleaning %s" (ansi-green "dist")) (eask-call "clean/dist")) - (eask--clean-section "Cleaning autoloads file" + (eask--clean-section (format "Cleaning %s file" (ansi-green "autoloads")) (eask-call "clean/autoloads")) - (eask--clean-section "Cleaning pkg-file" + (eask--clean-section (format "Cleaning %s" (ansi-green "pkg-file")) (eask-call "clean/pkg-file")) - (eask--clean-section "Cleaning log files" + (eask--clean-section (format "Cleaning %s files" (ansi-green "log")) (eask-call "clean/log-file")) (eask-msg "") (eask-info "(Total of %s task%s cleaned, %s skipped)" eask--clean-tasks-cleaned (eask--sinr eask--clean-tasks-cleaned "" "s") - (- eask--clean-tasks-total eask--clean-tasks-cleaned))) + (- eask--clean-tasks-count eask--clean-tasks-cleaned))) ;;; clean/all.el ends here