Commit graph

71 commits

Author SHA1 Message Date
Henrik Lissner
9d1513af46
bump: :core
bbatsov/projectile@0243ad7dc9 -> bbatsov/projectile@f3468e8d20
domtronn/all-the-icons.el@2c963ebb75 -> domtronn/all-the-icons.el@65c496d3d1
jscheid/dtrt-indent@926fc4260c -> jscheid/dtrt-indent@66fc30af02
raxod502/straight.el@653b04a64f -> raxod502/straight.el@e2de88ea0e
2022-03-30 17:49:35 +02:00
Henrik Lissner
cc3be7cb44 refactor: simplify native-comp detection
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.
2021-11-22 16:01:02 +01:00
Henrik Lissner
abc16ef68c refactor(cli): make all searches case-sensitive
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.
2021-08-05 12:53:20 -04:00
Henrik Lissner
3ba364ae10 Minor refactoring across the board 2021-05-23 22:09:07 -04:00
Henrik Lissner
a8e57438dc Refactor doom-{path,file,dir,glob}
Breaking change: doom-glob would formerly return a string (if only one
match) or a list. Now it always returns a list.
2021-05-23 21:49:02 -04:00
Henrik Lissner
6ad4f0698e Fix #4995: adapt to more renamed comp-* symbols
Two more variables were renamed upstream.
2021-05-11 19:03:18 -04:00
Henrik Lissner
0df791469d Resolve symlinks in autoloads files
For marginally faster package load times.
2021-02-11 23:00:49 -05:00
Henrik Lissner
5d0f781062 Add doom-autoloads-excluded-files variable
So specific/problematic files can be omitted from autoloads.
2021-02-11 23:00:11 -05:00
Henrik Lissner
1f3530da6f
Remove gh from excluded packages for autoloads
Fixed upstream.
2020-12-23 15:34:15 -05:00
Henrik Lissner
8c397902bc
Fix #4432: comp-deferred-compilation-{black,deny}-list 2020-12-14 16:48:14 -05:00
Henrik Lissner
dbeaa8e238
Remove emacs-version check in autoloads file
Now that the autoload file's path is namespaced by version, this check
is no longer necessary.
2020-10-29 02:36:59 -04:00
Andrew Whatson
30140021de Export comp-deferred-compilation-black-list via autoloads
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.
2020-10-09 09:34:23 +10:00
Henrik Lissner
e632871a11
core-cli: backport more refactors from rewrite
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
2020-08-24 23:00:32 -04:00
Henrik Lissner
ca0dbc798d
Use shorter seq.el alternatives 2020-05-26 04:18:20 -04:00
Henrik Lissner
22c7eac897
Add doom-autoloads-files option
So users can scan additional files for autoloads during 'doom sync'.
2020-05-26 04:16:42 -04:00
Henrik Lissner
f4e6d36574
Move 'restart Emacs to see changes' message to 'doom sync'
It isn't the autoloads generator's responsibility to do this. The
"changes" referred to consist of more than just the regenerated
autoloads file.
2020-05-26 04:09:11 -04:00
Henrik Lissner
e6c88e4384
Refactor autoloads generator & reduce to one generated file
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.
2020-05-25 15:55:29 -04:00
Henrik Lissner
3a38fc633c
Change doom-{interactive,debug}-mode suffix to -p
Because these are not really modes.

Also makes `doom-debug-mode` an actual (global) minor mode.
2020-05-25 03:43:40 -04:00
Henrik Lissner
2c70b75c6c
Warn user to sync+rebuild on emacs' major version change
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.
2020-05-03 16:31:06 -04:00
Henrik Lissner
d3c2e4829b
Disable byte-compile-dynamic for autoloads files
Its deprecated and more trouble than its worth.
2020-04-17 15:47:05 -04:00
Henrik Lissner
f7445a10db
General refactor & reformatting across the board 2020-02-18 22:56:47 -05:00
Henrik Lissner
53d799f377
Reduce file init work when reading autoloads
Should suppress Emacs trying to read file-local variables and/or
attempts to open TAGS files for the current project.
2020-01-30 19:39:36 -05:00
Henrik Lissner
c3734603f5
Don't strip out vars from doom module autoloads
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.
2020-01-24 18:16:11 -05:00
Henrik Lissner
9eb3a74a57
Save interpreter-mode-alist to autoloads 2020-01-14 02:59:16 -05:00
Henrik Lissner
cf04a44ca7
Refactor comment/string check in autoloads generator 2020-01-04 17:13:05 -05:00
Henrik Lissner
11676b0153
Fix #2299: void-function sp-point-in-string during 'doom refresh'
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.
2020-01-03 05:22:10 -05:00
Henrik Lissner
4f676bd218
Refactor autoload generator bootstrappers 2020-01-01 13:31:40 -05:00
Henrik Lissner
4a53f0818d
Don't insert autoloads literally #2281
It causes encoding issues.
2020-01-01 03:02:05 -05:00
Henrik Lissner
7c968a8b11
Fix #2278: autoload gen skipping disabled autodefs
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.
2019-12-30 23:19:56 -05:00
Henrik Lissner
0b1ab39a00
Refactor doom-cli--generate-autoloads 2019-12-30 17:06:49 -05:00
Henrik Lissner
497a6a206e
Fix 'wrong-number-of-arguments autoload 9' error in autoloads
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
2019-12-30 15:52:38 -05:00
Henrik Lissner
908bd4b945
Remove FORCE-P argument for doom-cli-reload-autoloads
We weren't using them anyway.
2019-12-30 06:44:16 -05:00
Henrik Lissner
f8ff50565e
Refactor autoload generator
- Halves LOC
- Adopts functional paradigm where possible.
- Reduces the filesize of autoloads files by ~10-20%
- Speeds up autoloads generation by ~20%
2019-12-29 22:20:48 -05:00
Henrik Lissner
d232ba241f
Remove 'doom autoloads'
It's redundant with doom refresh
2019-12-05 14:54:49 -05:00
Henrik Lissner
9d9b6e514c
Refactor autoloads generater 2019-11-23 01:21:24 -05:00
Henrik Lissner
88eb9d1d61
Don't bind noninteractive while building autoloads
See raxod502/straight.el#431
2019-11-22 13:52:07 -05:00
Henrik Lissner
873fc5c0db
Rewrite core-cli
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
2019-11-08 16:02:06 -05:00
Henrik Lissner
297728bf74
Generalize doom-file-cookie-p
And move it to doom-file-cookie-p for anyone to use.
2019-10-04 22:42:53 -04:00
Henrik Lissner
d297dc6934
Minor refactor & comment revision across the board 2019-10-03 23:33:59 -04:00
Henrik Lissner
45240699e0
Remove doom-elpa-dir variable
And just use package-user-dir. No need for two variable when one will
do.
2019-09-26 14:26:47 -04:00
Henrik Lissner
ec81fc30a4
Minor correction to comment 2019-09-08 20:56:50 -04:00
Henrik Lissner
a44e9153d3
Fix #1764: 'doom autoload' generating broken autoloads.pkg.el
Due to missing straight state that is properly initialized for 'doom
refresh' (by doom-packages-install), but not for 'doom autoloads'.
2019-09-08 20:52:30 -04:00
Henrik Lissner
b808c4e1ab
Reload autoloads files in noninteractive sessions
After it's been regenerated, so that any hacks (*cough*org/magit*cough*)
are in scope.
2019-08-07 16:55:04 -04:00
Henrik Lissner
4dc42de9e3
def-command! -> defcli!
And def-command-group! -> defcligroup!, to match our new convention for
naming definer macros.
2019-07-28 02:32:25 +02:00
Henrik Lissner
8dab8eefca
Prevent load-file-name/#$ replacements in strings & comments 2019-07-27 22:57:32 +02:00
Henrik Lissner
21a27b52d8
Refactor autoloads generation
- Correctly replace references to load-file-name and $# in autoloads.
- Don't load resulting autoloads file twice
- Read package autoloads literally (a little faster)
2019-07-27 16:59:10 +02:00
Henrik Lissner
6fcaa80355
Improve autoloads mtime scanning on packages
Scan source files in build directory rather than repos, which are better
indicators of a stale autoloads file.
2019-07-26 20:17:30 +02:00
Henrik Lissner
c2ae6f30a5
Don't compress auto-mode-alist
Modules may readd their entries afterwards, anyway.
2019-07-26 15:33:32 +02:00
Henrik Lissner
905ba1d23c
Refactor autoloads byte-compilation
- 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.
2019-07-26 03:12:06 +02:00
Henrik Lissner
ba990a6c9d
Build package autoloads in install order #374
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
2019-07-23 21:54:50 +02:00