diff options
Diffstat (limited to 'lisp/use-package')
| -rw-r--r-- | lisp/use-package/use-package-core.el | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el index 33b0e677cff..83630b80785 100644 --- a/lisp/use-package/use-package-core.el +++ b/lisp/use-package/use-package-core.el | |||
| @@ -42,7 +42,6 @@ | |||
| 42 | (require 'bytecomp) | 42 | (require 'bytecomp) |
| 43 | (require 'cl-lib) | 43 | (require 'cl-lib) |
| 44 | (require 'tabulated-list) | 44 | (require 'tabulated-list) |
| 45 | (require 'subr-x) | ||
| 46 | 45 | ||
| 47 | (eval-when-compile | 46 | (eval-when-compile |
| 48 | (require 'cl) | 47 | (require 'cl) |
| @@ -967,27 +966,27 @@ If RECURSED is non-nil, recurse into sublists." | |||
| 967 | (setq use-package-statistics (make-hash-table))) | 966 | (setq use-package-statistics (make-hash-table))) |
| 968 | 967 | ||
| 969 | (defun use-package-statistics-status (package) | 968 | (defun use-package-statistics-status (package) |
| 970 | "Return loading configuration status of PACKAGE statistics." | 969 | "Return loading configuration status of PACKAGE." |
| 971 | (cond ((gethash :config package) "Configured") | 970 | (cond ((gethash :config statistics) "Configured") |
| 972 | ((gethash :init package) "Initialized") | 971 | ((gethash :init statistics) "Initialized") |
| 973 | ((gethash :preface package) "Prefaced") | 972 | ((gethash :preface statistics) "Prefaced") |
| 974 | ((gethash :use-package package) "Declared"))) | 973 | ((gethash :use-package statistics) "Declared"))) |
| 975 | 974 | ||
| 976 | (defun use-package-statistics-last-event (package) | 975 | (defun use-package-statistics-last-event (package) |
| 977 | "Return the date when PACKAGE's status last changed. | 976 | "Return the date when package's status last changed. |
| 978 | The date is returned as a string." | 977 | The date is returned as a string." |
| 979 | (format-time-string "%Y-%m-%d %a %H:%M" | 978 | (format-time-string "%Y-%m-%d %a %H:%M" |
| 980 | (or (gethash :config package) | 979 | (or (gethash :config statistics) |
| 981 | (gethash :init package) | 980 | (gethash :init statistics) |
| 982 | (gethash :preface package) | 981 | (gethash :preface statistics) |
| 983 | (gethash :use-package package)))) | 982 | (gethash :use-package statistics)))) |
| 984 | 983 | ||
| 985 | (defun use-package-statistics-time (package) | 984 | (defun use-package-statistics-time (package) |
| 986 | "Return the time is took for PACKAGE to load." | 985 | "Return the time is took for package to load." |
| 987 | (+ (float-time (gethash :config-secs package 0)) | 986 | (+ (float-time (gethash :config-secs statistics 0)) |
| 988 | (float-time (gethash :init-secs package 0)) | 987 | (float-time (gethash :init-secs statistics 0)) |
| 989 | (float-time (gethash :preface-secs package 0)) | 988 | (float-time (gethash :preface-secs statistics 0)) |
| 990 | (float-time (gethash :use-package-secs package 0)))) | 989 | (float-time (gethash :use-package-secs statistics 0)))) |
| 991 | 990 | ||
| 992 | (defun use-package-statistics-convert (package) | 991 | (defun use-package-statistics-convert (package) |
| 993 | "Return information about PACKAGE. | 992 | "Return information about PACKAGE. |
| @@ -999,9 +998,9 @@ The information is formatted in a way suitable for | |||
| 999 | package | 998 | package |
| 1000 | (vector | 999 | (vector |
| 1001 | (symbol-name package) | 1000 | (symbol-name package) |
| 1002 | (use-package-statistics-status statistics) | 1001 | (use-package-statistics-status package) |
| 1003 | (use-package-statistics-last-event statistics) | 1002 | (use-package-statistics-last-event package) |
| 1004 | (format "%.2f" (use-package-statistics-time statistics)))))) | 1003 | (format "%.2f" (use-package-statistics-time package)))))) |
| 1005 | 1004 | ||
| 1006 | (defun use-package-report () | 1005 | (defun use-package-report () |
| 1007 | "Show current statistics gathered about use-package declarations. | 1006 | "Show current statistics gathered about use-package declarations. |