Skip to content

Commit

Permalink
[fu] init-require (bound-and-true-p use-package-compute-statistics)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkryger committed Nov 14, 2024
1 parent fbfe202 commit cd82eec
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions modules/init-require.el
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ that is passed to `defvar' (which see).
Please see Commentary in init-require.el for more details."
(append
`(progn
,@(when use-package-compute-statistics
,@(when (bound-and-true-p use-package-compute-statistics)
`((use-package-statistics-gather :use-package ,feature nil))))
(when (bound-and-true-p byte-compile-current-file)
;; Like in `use-package-normalize-keywords' for byte-compiling,
Expand Down Expand Up @@ -179,15 +179,15 @@ Please see Commentary in init-require.el for more details."
(error "Wrong type argument: symbolp, %S" var)))
(plist-get declarations :defines)))))
`((eval-and-compile
,@(when use-package-compute-statistics
,@(when (bound-and-true-p use-package-compute-statistics)
`((use-package-statistics-gather :preface ,feature nil)))
(let ((package-archives exordium--require-package-archives))
(with-demoted-errors
,(format "(exordium-require) Cannot load %s: %%S" feature)
(unless (featurep ,feature)
(exordium--require-load ,feature ,location t))))
,@declare-forms
,@(when use-package-compute-statistics
,@(when (bound-and-true-p use-package-compute-statistics)
`((use-package-statistics-gather :preface ,feature t)))))))
;; Like in `require' handle errors and ensure everything is loaded while
;; eval.
Expand All @@ -196,7 +196,7 @@ Please see Commentary in init-require.el for more details."
(stringp ,location)))
(if (featurep ,feature)
,feature
,@(when use-package-compute-statistics
,@(when (bound-and-true-p use-package-compute-statistics)
`((use-package-statistics-gather :config ,feature nil)))
(unwind-protect
(if (< 3 (cl-count ,feature exordium--require-nesting-list))
Expand All @@ -214,12 +214,12 @@ Please see Commentary in init-require.el for more details."
,feature))))
(when (eq ,feature (car exordium--require-nesting-list))
(pop exordium--require-nesting-list)))
,@(when use-package-compute-statistics
,@(when (bound-and-true-p use-package-compute-statistics)
`((use-package-statistics-gather :config ,feature t))))
(if (symbolp ,feature)
(error "Wrong type argument: symbolp, %S" ,feature)
(error "Wrong type argument: stringp, %S" ,location)))
,@(when use-package-compute-statistics
,@(when (bound-and-true-p use-package-compute-statistics)
`((use-package-statistics-gather :use-package ,feature t))))))

(provide 'init-require)
Expand Down

0 comments on commit cd82eec

Please sign in to comment.