doom/reload quotes `doom-bin`, but if doom-bin uses a tilde instead of
an absolute path, the quoting means it won't be expanded to $HOME,
causing "no such file or directory" errors when trying to execute it.
Fix: #6603
A list of arguments to omit can now be passed to (exit! :restart). For
example, `(exit! :restart "-c" :omit "--foo=" "--bar" "--baz=2")` will
restart the current script with a new switch (-c) and three switches
removed (--foo + one argument, --bar, --baz + two arguments).
- Fixes Doom's former inability to (trivially) juggle multiple profiles
based on the same EMACSDIR (see #6593).
- Adds '--profile NAME' switch to bin/doom (also recognized
$DOOMPROFILE).
- Adds new doom-profile* variables. These will eventually replace
doom-{local,etc,cache}-dir and doom-{autoloads,env}-file.
This is intentionally messy to ensure backwards compatibility for a
little while longer. This will be fixed over the next couple weeks.
Ref: #6593
string-match-p throws an error if given an invalid regexp, which is what
we *should* be testing for, not its return value (which should be
ignored), but this wasn't the case before this commit.
Fix: #6534
Global options were omitted in help output for subcommands before this
fix. This caused #6533, where the user was unable to find the correct
option to suppress prompts because 'doom upgrade --help' would not show
--force/-!, but 'doom --help' would. Still, it's unreasonable to expect
the user to know this beforehand.
Ref: #6533
--pager incorrectly expected a boolean argument, when it should accept
any arbitrary pager command (set to a blank string to disable the
pager).
Ref: #6526
Doom changes user-emacs-directory (see 46844b5 for explanation), so
doom-emacs-dir should be used to refer to your $EMACSDIR instead.
Fix: #6530
Ref: 46844b55de
ansi-color-compilation-filter wasn't introduced until Emacs 28, so this
removal was too hasty, but should be reconsidered when we drop 27.x
support.
Fix: #6515
Revert: 2f7171bf8a
doom-debug-p and doom-interactive-p have always been intentionally
redundant, because changing the variables they replaced had other
side-effects, which made writing tests for them difficult. Since our
new (yet unpublished) tests lean heavily toward integration testing more
than unit testing, this becomes an implementation detail.
And doom-init-p's only use was refactor out at some point in the past,
so it's no longer used.
Also done to reduce Doom's footprint, in general.
- Add comments to doom-cli-context-parse.
- Simplify/inline code here and there.
- Remove sacrifice to appease byte-compiler.
Thanks to a346928 there's no need to appease the byte-compiler with this
eval-when-compile hackery.
Ref: a34692826f18
This regression was introduced in 6c0b7e1, preventing the debugger from
printing straight.el's process log when a straight.el error occurs.
Instead, it would print a less-than-helpful backtrace.
Amend: 6c0b7e1530
I've removed these CLI properties because they were either
unused (:deprecated and :since) or poorly implemented (:stub and
:obsolete). And I'd rather have fewer magical properties, and instead
delegate these roles to the defobsolete! and (new) defstub! macros.
Also, in the future, the help API will ascertain :since dynamically, so
it won't be very useful.
In summary:
- Use defstub! instead of :stub
- Use defobsolete! instead of :obsolete or :deprecated
- This removes the doom-cli-deprecated-error type (it's not really an
error to begin with).
- Removes :stub, :obsolete, :deprecated, and :since
doom-cli-context-path stores the path taken to get to the current
command. For example, given:
(defcli! (doom boop) () ...)
(defcli! (doom baz) () (call! '(boop)))
(defalias! (doom bar) (doom baz))
(defalias! (doom foo) (doom bar))
(run! "doom" "foo")
Then the doom-cli-context-path by 'doom boop' will be:
Before this commit: ((doom baz))
After this commit: ((doom baz) (doom bar) (doom foo))
I use a shortcut like this to autoload multiple (different) CLIs living
in the same file:
(defautoload! ((foo bar baz)) "file")
However, this creates premature aliases between autoloaded CLIs. When
'baz' is invoked, instead of loading "file", it resolves to 'foo'
first *then* loads it, causing 'foo' to be executed instead of 'baz'.
This commit fixes that.
Also, minor refactor: I removed the plist argument from a
doom-cli-command-normalize call because it wasn't needed or useful to
the consumer of its return value.
Amend: d226946f59
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.