diff options
author | John Wiegley <johnw@newartisans.com> | 2018-03-11 21:34:23 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-11 21:34:23 -0700 |
commit | b1429951b19b15ae7b6d316805398ed8ffd52fd3 (patch) | |
tree | 9962e6536d4205aa2dfbaec07c69d35d06851d77 /lisp/use-package/use-package-core.el | |
parent | 4cc7f9127058bc5847543e9f741824920f4eda74 (diff) | |
parent | b28efb484712a9c773ded037523b28a1ba688632 (diff) | |
download | emacs-b1429951b19b15ae7b6d316805398ed8ffd52fd3.tar.gz emacs-b1429951b19b15ae7b6d316805398ed8ffd52fd3.tar.bz2 emacs-b1429951b19b15ae7b6d316805398ed8ffd52fd3.zip |
Merge pull request from DamienCassou/fix-report
Fix report
GitHub-reference: https://github.com/jwiegley/use-package/issues/645
Diffstat (limited to 'lisp/use-package/use-package-core.el')
-rw-r--r-- | lisp/use-package/use-package-core.el | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el index 83630b80785..33b0e677cff 100644 --- a/lisp/use-package/use-package-core.el +++ b/lisp/use-package/use-package-core.el @@ -42,6 +42,7 @@ (require 'bytecomp) (require 'cl-lib) (require 'tabulated-list) +(require 'subr-x) (eval-when-compile (require 'cl) @@ -966,27 +967,27 @@ If RECURSED is non-nil, recurse into sublists." (setq use-package-statistics (make-hash-table))) (defun use-package-statistics-status (package) - "Return loading configuration status of PACKAGE." - (cond ((gethash :config statistics) "Configured") - ((gethash :init statistics) "Initialized") - ((gethash :preface statistics) "Prefaced") - ((gethash :use-package statistics) "Declared"))) + "Return loading configuration status of PACKAGE statistics." + (cond ((gethash :config package) "Configured") + ((gethash :init package) "Initialized") + ((gethash :preface package) "Prefaced") + ((gethash :use-package package) "Declared"))) (defun use-package-statistics-last-event (package) - "Return the date when package's status last changed. + "Return the date when PACKAGE's status last changed. The date is returned as a string." (format-time-string "%Y-%m-%d %a %H:%M" - (or (gethash :config statistics) - (gethash :init statistics) - (gethash :preface statistics) - (gethash :use-package statistics)))) + (or (gethash :config package) + (gethash :init package) + (gethash :preface package) + (gethash :use-package package)))) (defun use-package-statistics-time (package) - "Return the time is took for package to load." - (+ (float-time (gethash :config-secs statistics 0)) - (float-time (gethash :init-secs statistics 0)) - (float-time (gethash :preface-secs statistics 0)) - (float-time (gethash :use-package-secs statistics 0)))) + "Return the time is took for PACKAGE to load." + (+ (float-time (gethash :config-secs package 0)) + (float-time (gethash :init-secs package 0)) + (float-time (gethash :preface-secs package 0)) + (float-time (gethash :use-package-secs package 0)))) (defun use-package-statistics-convert (package) "Return information about PACKAGE. @@ -998,9 +999,9 @@ The information is formatted in a way suitable for package (vector (symbol-name package) - (use-package-statistics-status package) - (use-package-statistics-last-event package) - (format "%.2f" (use-package-statistics-time package)))))) + (use-package-statistics-status statistics) + (use-package-statistics-last-event statistics) + (format "%.2f" (use-package-statistics-time statistics)))))) (defun use-package-report () "Show current statistics gathered about use-package declarations. |