custom-file is now set to your private config.el, because users may want
to be able to see what Customize is storing (and where) front and
center. Storing it away in ~/.emacs.d/.local makes it harder to notice.
Also, have enable-command (and disable-command) save their data to
custom-file instead of ~/.emacs.d (see #3379).
Fixes#3379
If you have a private module with the same name as a built-in module,
doom-module-load-path returns two entries for that module, causing our
autoloads scanner to scan it twice.
- Update comments & docstrings
- Remove unnecessary compile-time evaluation (we're not using any of
that config at compile time within that file anyway).
The coming CLI rewrite makes bin/doom atomic, but also "freezes" more of
your config in between 'doom sync's and 'doom upgrade's. This is
necessary to implement a robust rollback system. However, that also
means that `doom!` shouldn't do anything when read in an interactive
session (and should only be read when running `doom sync`).
Indirectly fixes#2612
Doom now looks for cli.el files in your private directory or modules,
giving them an opportunity to customize the CLI (add commands or
reconfigure existing ones) to suit their purposes.
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes#2802, #2737, #2386
The big highlights are:
- Fix#2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix#2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix#2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
Many packages recommend setting up their packages with something like:
(use-package PACKAGE
:ensure t
...)
New users will frequently copy these into their config, then experience
long startup times or a cryptic error about the package failing to
install.
This is because `:ensure t`, by default, uses package.el (Emacs'
built-in package manager) to check for and install packages, but Doom
doesn't use package.el, it uses straight.el. So we disable `:ensure`.
On the other hand, if the user has loaded `package` by hand, then we
should assume that they know what they're doing, and restore the old
behavior.
e.g. If you had a ~/.doom.d/modules/tools/lsp/autoload.el that defined
an lsp! autodef, it would be indexed and included in
~/.emacs.d/.local/autoloads.el *before* the lsp! autodef from the
original ~/.emacs.d/modules/tools/lsp/autoload.el.
This update may potentially break your usage of add-hook! if you pass
the :local or :append properties to it. This is how they used to work:
(add-hook! :append 'some-mode-hook #'do-something)
Thsoe properties must now follow the hooks, e.g.
(add-hook! 'some-mode-hook :append #'do-something)
Other changes:
- Various add-hook calls have been renamed to add-hook! because I
incorrectly assumed `defun` always returned its definition's symbol,
when in fact, its return value is "undefined" (so sayeth the
documentation). This should fix#1597.
- This update adds the ability to add multiple functions to hooks
without a list:
(add-hook! 'some-mode-hook
#'do-something
#'do-something-else)
- The indentation logic has been changed so that consecutive function
symbols at indented at the same level as the first argument, but forms
are indent like a defun.
(add-hook! 'some-mode-hook
#'do-something
#'do-something-else)
(add-hook! 'some-mode-hook
(message "Hello"))