Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix package count when using package.el and straight.el simultaneously #233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions dashboard-widgets.el
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,14 @@ Example:
:group 'dashboard)

(defcustom dashboard-init-info
;; Check if package.el was loaded and if package loading was enabled
(let ((time (emacs-init-time)))
(cond ((bound-and-true-p package-alist)
(format "%d packages loaded in %s" (length package-activated-list) time))
((and (boundp 'straight--profile-cache)
(hash-table-p straight--profile-cache))
(format "%d packages loaded in %s" (hash-table-size straight--profile-cache) time))
(t (format "Emacs started in %s" time))))
(let ((package-count 0) (time (emacs-init-time)))
(when (boundp 'straight--profile-cache)
(setq package-count (hash-table-size straight--profile-cache)))
(when (bound-and-true-p package-alist)
(setq package-count (+ (length package-activated-list) package-count)))
(if (null (zerop package-count))
(format "%d packages loaded in %s" package-count time)
(format "Emacs started in %s" time)))
"Init info with packages loaded and init time."
:type 'boolean
:group 'dashboard)
Expand Down