From 2a479988443c3264a2f67e643f2acf6055014c30 Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Sun, 11 Mar 2018 13:21:00 +0100 Subject: Add missing require This is used for `hash-table-keys`. Fix https://github.com/jwiegley/use-package/issues/644. --- lisp/use-package/use-package-core.el | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lisp/use-package') diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el index 83630b80785..2c27351d0bd 100644 --- a/lisp/use-package/use-package-core.el +++ b/lisp/use-package/use-package-core.el @@ -43,6 +43,12 @@ (require 'cl-lib) (require 'tabulated-list) +(if (and (eq emacs-major-version 24) (eq emacs-minor-version 3)) + (defsubst hash-table-keys (hash-table) + "Return a list of keys in HASH-TABLE." + (cl-loop for k being the hash-keys of hash-table collect k)) + (require 'subr-x)) + (eval-when-compile (require 'cl) (require 'regexp-opt)) -- cgit v1.2.3 From 69a561b86b4d781de5294964176509b112d7a7bd Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Sun, 11 Mar 2018 13:22:13 +0100 Subject: Fix compile-time warnings due to the statistics-reporting code The code worked because the file is using dynamic binding. --- lisp/use-package/use-package-core.el | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'lisp/use-package') diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el index 2c27351d0bd..bd18c972303 100644 --- a/lisp/use-package/use-package-core.el +++ b/lisp/use-package/use-package-core.el @@ -972,27 +972,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. @@ -1004,9 +1004,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. -- cgit v1.2.3