setenv treats the TZ (and only TZ) envvar especially, so we have to too,
since I'm intentionally avoiding iteratively setenv'ing envvars to avoid
the unnecessary extra work it does.
Fix: #5760
While lists are technically cons cells, cons cells don't have all the
properties of lists, so doom-enlist shouldn't treat it as one.
Before:
(doom-enlist '(a . b)) #=> (a . b)
After:
(doom-enlist '(a . b)) #=> ((a . b))
Before this fix:
(fn! (x &key y z))
;; implies
(fn! (&key x &allow-other-keys)).
But
(fn! (x (&key y) &key z))
;; would not imply
(fn! (x (&key y &allow-other-keys) &key z &allow-other-keys)).
The semantics of add-hook's APPEND argument changed in 27.1: it was
replaced with DEPTH, which controls its exact order of the hook (and is
respected every time a function is added to a hook, throughout its
lifetime).
Includes a general refactor for add-hook! too.
This adds support for two new definition types to the left! convenience
macro: defun* and defadvice.
First, defun* is for defining recursive, local functions (uses
cl-labels under the hood). e.g.
(letf! (defun* triangle (number)
(cond ((<= number 0) 0)
((= number 1) 1)
((> number 1)
(+ number (triangle (1- number))))))
...)
Second, defadvice is for defining temporary advice (which has a global
effect; it can later be improved to limit scope by redefining things
with cl-letf). e.g.
(letf! (defadvice my-fixed-triangle (fn number)
:around #'triangle
(funcall fn (1+ number)))
...)
Prior to this, (after! (a b) ...) would expand to
(after! b
(after! a
...))
After this, it expands to
(after! a
(after! b
...))
This fixes load order issues with packages whose deferred configs are
nested, such as org and ob-ditaa.
Ref https://www.reddit.com/r/emacs/comments/pp3sye/hd311nz
Emacs 27.x has been the stable version of Emacs for nearly a year, and
introduces a litany of bugfixes, performance, and quality-of-life
improvements that significantly reduce Doom's maintenance burden (like
XDG support, early-init.el, image manipulation without imagemagick, a
native JSON library, harfbuzz support, pdumper, and others).
With so many big changes on Doom's horizon, I like having one less (big)
thing to worry about.
Also reverts bb677cf7a (#5232) as it is no longer needed.
Straight (on its develop branch) byte compiles packages in a child
process, isolated from the current session. This is a sensible approach
and I applaud it, but there's a problem:
Some packages don't load their compile-time dependencies at
compile-time, causing errors *at* compile-time. They unwittingly rely on
the fact that package.el compiles them in the same session as their
dependencies, which indirectly loads their macros for them. I can't
depend on package authors to do the right thing, but I can force
straight to revert to the old approach.
This is a temporary fix. These should be removed once packages have
updated to accommodate the changes to the
define-obsolete-{variable,function,face}-alias macros.
Currently, `add-load-path!` doesn’t check for duplicates in `load-path`, because `cl-pushnew` tests for equality with `eql`. This changes the predicate to `string=`, fixing the bug.
This should at least report what function invoked the error.
doom-first-input-hook was especially problematic because it runs on
pre-command-hook, which Emacs is very protective of. It will smother
errors that arise from it and auto-remove the offending hook. This
self-correction is nice for avoiding a broken Emacs, but it makes it
tough to debug those issues.
Some plugins (like envrc-mode) make process-environment, exec-path and
shell-file-name buffer-local. Running `M-x doom/reload` or
`doom-load-envvars-file` should affect their global values, and not
their buffer local ones.
It's kind of silly that our command lambda macros (λ! and λ!!) need a
snippet, special key sequence or copy-paste to insert, so in the spirit
of fn! -- and to make sure they take up less space than `lambda!` --
I've added `cmd!` and `cmd!!` aliases. `lambda!` and `lambda!!` are now
deprecated. λ! and λ!! will remain.
I've also added `cmds!` as a convenience wrapper around
general-predicate-dispatch.
We no longer need two separate autoloads files, so I merged them and
optimized its generation logic.
Other changes
- Doom will refuse to start up (with a helpful error) if it's in an
incomplete state. This should hopefully reduce the number of bug
reports from folks that have done something weird, e.g.
1. You've changed Emacs versions without running 'doom sync -b'.
2. You've updated Doom outside of `doom upgrade` and didn't run `doom
sync -u`.
3. You've forgotten to run 'doom sync' in the first place!
4. If a previous 'doom ...' command was aborted midway without running
'doom sync' afterwards.
- 'doom sync' will emit reminders that you need to reload/restart Emacs
- Autoloads API now uses the `doom-autoloads-` prefix, intead of
'doom-cli-autoloads-', as will be the new convention in the coming
rewrite.
- Errors from within the package autoloads should be easier to invoke
the debugger on.
- `doom-modules` is now stored in your autoloads file. Your module list
will soon be frozen between calls to 'doom sync' to allow for our new,
atomic CLI I'm working on. This will also means the `doom!` block
won't cost anything in interactive sessions.