Commit graph

5 commits

Author SHA1 Message Date
Henrik Lissner
f99cf0ccc8
feat(cli): introduce DOOMPROFILELOAD{FILE,PATH} envvars
- Adds $DOOMPROFILELOADFILE: Controls where to read and write the
  profile loader. Changing this may be helpful for users on nix/guix,
  who have deployed Doom to a read-only location. This sets
  `doom-profile-load-file`.
- Changed profile load file's default location (used to be
  $EMACSDIR/profiles/init.el, is now $EMACSDIR/profiles/load.el). The
  gitignore was updated to reflect this.
- Adds $DOOMPROFILELOADPATH: A colon-delimited list of profile config
  files and directories (semi-colon on Windows) which dictate what Doom
  reads in order to discover your profiles. Config files are required to
  have an *.el extension. This sets `doom-profile-load-path`.
- Changes the nomenclature around this loader script. I used to refer to
  it as the profile bootstrapper. I'll now refer to it as the profile
  load file, and I've renamed `doom-profiles-bootstrap-file` to
  `doom-profile-load-file` to reflect this.
- The variables `doom-profile-dirs` and `doom-profile-config-files` were
  merged into doom-profile-load-path.
- Both envvars have also been documented in `doom help` (and
  $DOOMPROFILE's has been updated).

Ref: #6794
2022-09-18 00:28:13 +02:00
Henrik Lissner
6dffa09c71
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.
2022-09-17 21:41:42 +02:00
Henrik Lissner
36a9637e79
fix(profiles): no bootstrap file for non-bootloaders
If Doom doesn't live in ~/.emacs.d or ~/.config/emacs, then it cannot
play the role of bootloader, so opt out of generating the profile
bootstrappper in this case.

That said, don't disable the profile system entirely; it can still be
useful for internal, noninteractive, and sandbox use.
2022-09-17 15:29:17 +02:00
Henrik Lissner
753b479ea6
feat(cli): add --reload switch to 'profiles sync'
So 'doom profiles sync' can be relied on to forcibly regenerate the
profile init by default.
2022-09-17 15:11:48 +02:00
Henrik Lissner
cc0e6a61c3
fix(cli): add lisp/cli/profiles.el
I forgot to add the definitions for the 'doom profile{s,}' commands in
b914830, which causes "unrecognized command 'profiles sync'" errors on
'doom {sync,upgrade}'.

My unparalleled brilliance is 4 parallel universes ahead of me, clearly.

Amend: b914830403
2022-09-16 02:26:00 +02:00