Reduce cases where native-comp procedures were executed in
non-native-comp contexts (somehow).
Also:
- Adds a NATIVECOMP constant for statically detecting the feature.
- Remove native-comp-* -> comp-* aliases (Emacs HEAD has long since
moved on from these).
- Add 'no-native-compile: t' to autoloads file.
This is more predictable, and is safe as a global default in CLI
sessions (but not in interactive ones). This indirectly fixes case
insensitivity in our commit linter rules.
The latest straight.el adds `:no-native-compile` packages to the
compilation blacklist. We export the build-time blacklist via autoloads
so that it works as expected to prevent native compilation at runtime.
Still a long way to go, but this introduces a few niceties for
debugging CLI failures:
+ The (extended) output of the last bin/doom command is now logged to
~/.emacs.d/.local/doom.log
+ If an error occurs, short backtraces are displayed whether or not you
have debug mode on. The full backtrace is written to
~/.emacs.d/.local/doom.error.log.
+ bin/doom now aborts with a warning if:
- The script itself or its parent directory is a symlink. It's fine if
~/.emacs.d is symlinked though.
- Running bin/doom as root when your DOOMDIR isn't in /root/.
- If you're sporting Emacs 26.1 (now handled in the elisp side rather
than the /bin/sh shebang preamble).
+ If a 'doom sync' was aborted prematurely, you'll be warned that Doom
was left in an inconsistent state and that you must run `doom sync`
again.
May address #3746
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.
Byte-code is not generally compatible across major releases of Emacs,
and packages may have changed in that time. Best throw a more helpful
error than leave users to deal with the obscure errors that this can
cause.
Doom's autoloads generator will strip out forms that modify variables in
doom-autoload-cached-vars (load-path, auto-mode-alist, etc). These are
undesireable in package autoloads, but may be desireable in Doom module
autoloads.
Due to use of third-party code before it is installed. Since we can be
sure that elisp has a sane syntax-table we do not need sophisticated
comment/string detection.
If a ;;;###if module cookie returned nil for a file, it should still
allow autodefs to be scraped from it, which wasn't happening before this
fix.
An autodef's guarantee is that it will always be defined, whether or not
the containing module is enabled.
This error was caused by over-aggressive replacement of load-file-name
in autoloads files.
Instances of "load-file-name" would be replaced with a quoted file-path,
even in strings and comments, which would break surrounding strings and
docstrings.
Mentioned in hlissner/doom-emacs@f8ff505
- Halves LOC
- Adopts functional paradigm where possible.
- Reduces the filesize of autoloads files by ~10-20%
- Speeds up autoloads generation by ~20%
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
- Correctly replace references to load-file-name and $# in autoloads.
- Don't load resulting autoloads file twice
- Read package autoloads literally (a little faster)
- Let-bind byte-compile-* vars instead of using file-local vars.
- Fix duplicate bullet point in "Copied backup..." message.
- Only display refresh message if cli command was successful.
Before this update, the autoloads files were collected in
lexicographical order (by traversing straight's build directory). By
using straight--build-cache's keys (which are entered in the order they
were registered) we avoid issues like