Emacs 29 introduces a new command: restart-emacs, which clashes with the
more featureful restart-emacs package that Doom installs to manage the
session. Fortunately, the built-in one is defines in files.el, which is
eagerly loaded at startup, so as long as the third-party one is
loaded (at some point), it shouldn't be a problem.
Fix: #6492
A little more time and space gained by cutting out seq entirely and
pre-generating the argument lookup table. At least, in uncompiled use
cases.
The original implementation used regexp to lookup arguments, which
was (relatively) expensive. By comparison, using `assq` is *much*
faster, especially for datasets this small; and more so when I get
around to byte-compiling Doom's core (assq has its own byte-compiler
opcode).
- Reduces allocations by avoiding copies produced by reverse and seq,
and by avoiding a closure.
- Reduces runtime by avoiding the overhead of seq's generics.
BREAKING CHANGE: This renames the fn! macro to lambda! and fn!! to fn!.
I hadn't put much thought into their names when they were added, but now
that they're seeing more use, I've reconsidered.
The reasoning is (and I'll refer to them by their new names):
- If you're using fn!, you care more about the syntax's brevity, than if
you were using lambda!, so I wanted fn! to have the (even if slightly)
shorter name.
- lambda! decorates native lambda (with cl-function). Its old name
did not suggest that connection like other !-macros in Doom's library
do.
- Their old names implied the two macros were somehow related or that
one decorated the other. They aren't and don't.
'doom help' is aliased to the pseudo command ':help'. (doom-cli-find
'("doom" "help")) would return a list of all CLIs that are pertinent to
'doom help's execution, but it resolves aliases, making it unclear to
recipients of this list what the initial command was.
This requires callers resolve the CLIs themselves, but at least now the
user has the choice.
So the doctor doesn't complain about pseudo packages, like revealjs,
which is not actually an Emacs package, we're just using straight.el to
install it for org-re-reveal.
Before:
$ doom ci hook commit-msg test
Error: "doom ci" expected 0 arguments, but got 1
Usage: doom ci COMMAND [ARGS...]
See 'doom h[elp] ci' or 'doom ci {-?,--help}' for documentation.
After:
$ doom ci hook commit-msg test
Error: ":before doom ci" expected 0 arguments, but got 1
Usage: doom ci hook commit-msg FILE
See 'doom h[elp] ci hook commit-msg' or 'doom ci hook commit-msg {-?,--help}' for documentation.
- :before ci will try to load $REPOROOT/ci.el or $DOOMDIR/ci.el. It
finds $REPOROOT by calling `git`, but doesn't handle errors. Now it
does.
- Because &rest was in :before ci's argspec, :before ci * subcommands
would be inaccessible (not that any exist atm, though).
- Let the user know when it finds the project's ci.el.
To understand what's going on here, understand this: this is a regular
CLI command:
(defcli! (doom sync) () ...)
And this is a pseudo command:
(defcli! (:before doom sync) () ...)
If a pseudo command is aliased to another pseudo command:
(defcli! (:before doom (foo bar baz)) ...)
In which case, ':before doom bar' and ':before doom baz' are aliases for
':before doom foo', there was a bug that cut out the keyword, so in
actuality, ':before doom {bar,baz}' were aliased to 'doom bar'.
This fixes that, and the peculiar issue of 'doom purge' executing 'doom
build' due to this, living in core/cli/packages.el:
(defcli! (:before (build b purge p)) (&context context)
(require 'comp nil t)
(doom-initialize-core-packages))
Ref: https://github.com/doomemacs/doomemacs/issues/4273#issuecomment-1159610824
If you type an unrecognized command, you get an "Error: unrecognized
command X" error, then a list of similar commands, followed by a
recommendation to check out 'doom help Y' or 'doom --help Y', where Y is
the nearest recognized parent command. E.g. 'doom ci blah' is an unknown
command, but 'doom ci' is known, therefore Y = 'doom ci'.
This fix ensures that Y is properly resolved.
Amend: 6c0b7e1530
Before:
$ doom help help
Usage: COMMAND [ARGS...]
TODO
TODO
After:
Usage: doom help [-g|--no-global] [--manpage] [--commands]
[--synopsis|--subcommands|--similar|--envvars|--postamble] [--]
COMMAND [ARGS...]
Show documentation for a Doom CLI command.
OPTIONS:
-g, --no-global
Hide global options.
--manpage
Generate in manpage format.
--commands
List all known commands.
--synopsis, --subcommands, --similar, --envvars, --postamble
Show only the specified sections..
Amend: 6c0b7e1530
Some packages (primarily vterm, evil-collection, and with-editor) end up
hanging their native compilation process. In vterm's case it's because
it invisibly prompts to compile its module then waits forever for user
input that'll never come. I haven't figured out why it happens for the
others though.
In any case, since the workaround is to simply kill these processes and
carry on, I added this timeout mechanism to do it for you (timing out
after 30s of no movement). A more elegant solution will have to wait
until the rewrite of our package manager.
Fix: #5592
This fixes an issue where, on some systems, `tput cols lines` does not
produce "N\nM" (where N = number of columns in the terminal and M =
number of lines), and instead produces "N\n", causing parsing errors.
- An improper autoload was preventing 'doom clean' from being
recognized.
- 'doom compile' hadn't been updated to reflect changes introduced
recently in 1402db5.
Amend: 6c0b7e1530
Ref: 1402db5129
To 'doom sync', 'doom upgrade', and 'doom build'. So users can decide
whether they want Doom 100%'ing their CPUs.
After 3.0, many of these commands will be merged, so a little code
duplication is fine for now.
When I added call! to the DSL, I forgot to update doom-cli-call calls.
This should quell these errors when running 'doom upgrade':
x There was an unexpected runtime error
Message: Wrong number of arguments
Details: (((cl-struct-doom-cli-context-tags cl-struct-doom-cli-option-...
Backtrace:
(doom-cli-call ("doom" "sync" "-u"))
(cond (packages\? (doom-cli-call sync-cmd) (doom-print (doom-print-...
Amend: 6c0b7e1530