Skip to content

Commit

Permalink
[dbg] print load-path and load-history
Browse files Browse the repository at this point in the history
  • Loading branch information
pkryger committed Dec 6, 2024
1 parent 876799a commit 9ebbcaf
Showing 1 changed file with 200 additions and 0 deletions.
200 changes: 200 additions & 0 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,22 @@ melpa-stable.")
(message "Loading tapped before-init file: %s" tapped-file)
(load (file-name-sans-extension tapped-file)))

(require 'cl-lib)
(defvar dev/last-load-history nil)
(defvar dev/last-load-path nil)
(message "*** new load-history: %s"
(mapcar #'file-truename
(cl-remove-if-not #'stringp
(mapcar #'car
(cl-subseq load-history
0 (cl-position dev/last-load-history
load-history))))))
(setq dev/last-load-history (car load-history))
(message "*** new load-path: %s" (cl-subseq load-path
0 (cl-position dev/last-load-path
load-path)))
(setq dev/last-load-path (car load-path))

(eval-and-compile
(load (file-name-concat (locate-user-emacs-file "modules") "init-require")))

Expand All @@ -156,9 +172,35 @@ melpa-stable.")
;; Use M-x `package-list-package' to load and display the list of packages,
;; then press I to mark for installation and X to execute (it's like `dired').

(message "*** new load-history: %s"
(mapcar #'file-truename
(cl-remove-if-not #'stringp
(mapcar #'car
(cl-subseq load-history
0 (cl-position dev/last-load-history
load-history))))))
(setq dev/last-load-history (car load-history))
(message "*** new load-path: %s" (cl-subseq load-path
0 (cl-position dev/last-load-path
load-path)))
(setq dev/last-load-path (car load-path))

;; Initialize the package system
(require 'package)

(message "*** new load-history: %s"
(mapcar #'file-truename
(cl-remove-if-not #'stringp
(mapcar #'car
(cl-subseq load-history
0 (cl-position dev/last-load-history
load-history))))))
(setq dev/last-load-history (car load-history))
(message "*** new load-path: %s" (cl-subseq load-path
0 (cl-position dev/last-load-path
load-path)))
(setq dev/last-load-path (car load-path))

(add-to-list 'package-archives
(cons "melpa" exordium-melpa-package-repo) t)

Expand All @@ -183,11 +225,51 @@ melpa-stable.")
(package-refresh-contents)
(package-install 'use-package))

(message "*** new load-history: %s"
(mapcar #'file-truename
(cl-remove-if-not #'stringp
(mapcar #'car
(cl-subseq load-history
0 (cl-position dev/last-load-history
load-history))))))
(setq dev/last-load-history (car load-history))
(message "*** new load-path: %s" (cl-subseq load-path
0 (cl-position dev/last-load-path
load-path)))
(setq dev/last-load-path (car load-path))


;; This is only needed once, near the top of the file
(require 'use-package)

(message "*** new load-history: %s"
(mapcar #'file-truename
(cl-remove-if-not #'stringp
(mapcar #'car
(cl-subseq load-history
0 (cl-position dev/last-load-history
load-history))))))
(setq dev/last-load-history (car load-history))
(message "*** new load-path: %s" (cl-subseq load-path
0 (cl-position dev/last-load-path
load-path)))
(setq dev/last-load-path (car load-path))

(exordium-require 'init-force-elpa)

(message "*** new load-history: %s"
(mapcar #'file-truename
(cl-remove-if-not #'stringp
(mapcar #'car
(cl-subseq load-history
0 (cl-position dev/last-load-history
load-history))))))
(setq dev/last-load-history (car load-history))
(message "*** new load-path: %s" (cl-subseq load-path
0 (cl-position dev/last-load-path
load-path)))
(setq dev/last-load-path (car load-path))

;; Pin user extra packages early, in case they are dependencies of some other
;; packages that are installed early.
(dolist (pkg exordium-extra-pinned)
Expand All @@ -199,26 +281,91 @@ melpa-stable.")
(use-package-always-ensure t)
(use-package-compute-statistics t))

(message "*** new load-history: %s"
(mapcar #'file-truename
(cl-remove-if-not #'stringp
(mapcar #'car
(cl-subseq load-history
0 (cl-position dev/last-load-history
load-history))))))
(setq dev/last-load-history (car load-history))
(message "*** new load-path: %s" (cl-subseq load-path
0 (cl-position dev/last-load-path
load-path)))
(setq dev/last-load-path (car load-path))

;; Some packages (i.e., magit, forge) require relatively new package `seq'.
;; Unfortunately, `package' is unable to bump the built-in `seq'. Ensure it is
;; installed in the newest available version.
(use-package seq
:defer t
:exordium-force-elpa gnu)

(message "*** new load-history: %s"
(mapcar #'file-truename
(cl-remove-if-not #'stringp
(mapcar #'car
(cl-subseq load-history
0 (cl-position dev/last-load-history
load-history))))))
(setq dev/last-load-history (car load-history))
(message "*** new load-path: %s" (cl-subseq load-path
0 (cl-position dev/last-load-path
load-path)))
(setq dev/last-load-path (car load-path))

;; `org' may be upgraded from ELPA (for example, as a part of a first start)
;; and some packages depend on it. To prevent loading a built in version by
;; such packages make sure `org' has been upgraded early.
(use-package org
:defer t
:exordium-force-elpa gnu)

(message "*** new load-history: %s"
(mapcar #'file-truename
(cl-remove-if-not #'stringp
(mapcar #'car
(cl-subseq load-history
0 (cl-position dev/last-load-history
load-history))))))
(setq dev/last-load-history (car load-history))
(message "*** new load-path: %s" (cl-subseq load-path
0 (cl-position dev/last-load-path
load-path)))
(setq dev/last-load-path (car load-path))

(use-package diminish
:exordium-force-elpa gnu)

(message "*** new load-history: %s"
(mapcar #'file-truename
(cl-remove-if-not #'stringp
(mapcar #'car
(cl-subseq load-history
0 (cl-position dev/last-load-history
load-history))))))
(setq dev/last-load-history (car load-history))
(message "*** new load-path: %s" (cl-subseq load-path
0 (cl-position dev/last-load-path
load-path)))
(setq dev/last-load-path (car load-path))

(use-package bind-key
:exordium-force-elpa gnu)

(message "*** new load-history: %s"
(mapcar #'file-truename
(cl-remove-if-not #'stringp
(mapcar #'car
(cl-subseq load-history
0 (cl-position dev/last-load-history
load-history))))))
(setq dev/last-load-history (car load-history))
(message "*** new load-path: %s" (cl-subseq load-path
0 (cl-position dev/last-load-path
load-path)))
(setq dev/last-load-path (car load-path))

(dolist (pkg exordium-extra-pinned)
(unless (package-installed-p pkg)
(package-install pkg)))
Expand Down Expand Up @@ -356,12 +503,39 @@ after it's been byte compiled."
(async-bytecomp-package-mode))


(message "*** new load-history: %s"
(mapcar #'file-truename
(cl-remove-if-not #'stringp
(mapcar #'car
(cl-subseq load-history
0 (cl-position dev/last-load-history
load-history))))))
(setq dev/last-load-history (car load-history))
(message "*** new load-path: %s" (cl-subseq load-path
0 (cl-position dev/last-load-path
load-path)))
(setq dev/last-load-path (car load-path))


;;; Load Modules

(exordium-require 'init-prefs) ; Defines variables that prefs.el can override
(exordium-require 'init-lib) ; Utility functions - load this first
(exordium-require 'init-environment) ; environment variables

(message "*** new load-history: %s"
(mapcar #'file-truename
(cl-remove-if-not #'stringp
(mapcar #'car
(cl-subseq load-history
0 (cl-position dev/last-load-history
load-history))))))
(setq dev/last-load-history (car load-history))
(message "*** new load-path: %s" (cl-subseq load-path
0 (cl-position dev/last-load-path
load-path)))
(setq dev/last-load-path (car load-path))


(dolist (tapped-file exordium-tapped-prefs-files)
(message "Loading tapped prefs file: %s" tapped-file)
Expand All @@ -377,6 +551,19 @@ after it's been byte compiled."
(when exordium-theme
(exordium-require 'init-themes))

(message "*** new load-history: %s"
(mapcar #'file-truename
(cl-remove-if-not #'stringp
(mapcar #'car
(cl-subseq load-history
0 (cl-position dev/last-load-history
load-history))))))
(setq dev/last-load-history (car load-history))
(message "*** new load-path: %s" (cl-subseq load-path
0 (cl-position dev/last-load-path
load-path)))
(setq dev/last-load-path (car load-path))

;; Look and feel
(exordium-require 'init-look-and-feel) ; fonts, UI, keybindings, saving files etc.
(exordium-require 'init-font-lock) ; enables/disables font-lock globally.
Expand All @@ -385,6 +572,19 @@ after it's been byte compiled."
(exordium-require 'init-smooth-scroll)
(smooth-scroll-mode 1)) ; smooth scroll

(message "*** new load-history: %s"
(mapcar #'file-truename
(cl-remove-if-not #'stringp
(mapcar #'car
(cl-subseq load-history
0 (cl-position dev/last-load-history
load-history))))))
(setq dev/last-load-history (car load-history))
(message "*** new load-path: %s" (cl-subseq load-path
0 (cl-position dev/last-load-path
load-path)))
(setq dev/last-load-path (car load-path))

(update-progress-bar)

;; Usability
Expand Down

0 comments on commit 9ebbcaf

Please sign in to comment.