refactor(profiles): bootstrap script
- Swap out the funcall+alist lookup for a pcase (which is expanded to a cond, which is is faster and easier to read). - Wrap bootstrap file to $EMACSDIR/profiles/init.el, but byte-compile it to $EMACSDIR/profiles/init.X.el where X is emacs-major-version. - Make doom-profiles-save's second argument optional (defaults to doom-profiles-bootstrap-file). - Make doom-profiles-save throw a error if byte-compilation fails for some reason. - Rename the tempvars to include 'doom' in their name, so debuggers know where they originate.
This commit is contained in:
parent
09d24cd68a
commit
6dffa09c71
3 changed files with 89 additions and 87 deletions
|
@ -81,9 +81,9 @@
|
|||
;; $XDG_CONFIG_HOME/doom-profiles.el, and ~/.doom-profiles.el. All it
|
||||
;; needs is for `$DOOMPROFILE' to be set.
|
||||
(setenv "DOOMPROFILE" profile)
|
||||
(or (load (expand-file-name (format "profiles/init.%d" emacs-major-version)
|
||||
(or (load (expand-file-name (format "profiles/init.%d.elc" emacs-major-version)
|
||||
user-emacs-directory)
|
||||
'noerror (not init-file-debug) nil 'must-suffix)
|
||||
'noerror (not init-file-debug) 'nosuffix)
|
||||
(user-error "Profiles not initialized yet; run 'doom sync' first"))))
|
||||
|
||||
;; PERF: When `load'ing or `require'ing files, each permutation of
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue