Commit Graph

29 Commits

Author SHA1 Message Date
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
3d10e984ec
Fix #3134: invalid lambda variable t on 'doom compile' 2020-05-15 17:56:29 -04:00
Henrik Lissner
0e851ace9b
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.

Fixes #2802, #2737, #2386

The big highlights are:

- Fix #2802: We now update recipe repos *before* updating/installing any
  new packages. No more "Could not find package X in recipe repositories".

- Fix #2737: An edge case where straight couldn't reach a pinned
  commit (particularly with agda).

- Doom is now smarter about what option it recommends when straight
  prompts you to make a choice.

- Introduces a new init path for Doom. The old way:
  - Launch in "minimal" CLI mode in non-interactive sessions
  - Launch a "full" interactive mode otherwise.
  The new way
  - Launch in "minimal" CLI mode *only* for bin/doom
  - Launch is a simple mode for non-interactive sessions that still need
    access to your interactive config (like async org export/babel).
  - Launch a "full" interactive mode otherwise.

  This should fix compatibility issues with plugins that use the
  async.el library or spawn child Emacs processes to fake
  parallelization (like org's async export and babel functionality).

- Your private init.el is now loaded more reliably when running any
  bin/doom command. This gives you an opportunity to configure its
  settings.

- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
  deferred activation of a number of packages. Users can remove these
  modes from these hooks; altogether preventing them from loading,
  rather than waiting for them to load to then disable them,
  e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
  'doom-first-buffer #'smartparens-global-mode)

  Hooks added to doom-first-*-hook variables will be removed once they
  run.

  This should also indirectly fix #2386, by preventing interactive modes
  from running in non-interactive session.

- Added `doom/bump-*` commands to make bumping modules and packages
  easier, and `doom/bumpify-*` commands for converting package!
  statements into user/repo@sha1hash format for bump commits.

- straight.el is now commit-pinned, like all other packages. We also
  more reliably install straight.el by cloning it ourselves, rather than
  relying on its bootstrap.el.

  This should prevent infinite "straight has diverged from master"
  prompts whenever we change branches (though, you might have to put up
  with it one more after this update -- see #2937 for workaround).

All the other minor changes:

- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
  simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
  already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
  trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
  doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
  1. Child instances will no longer inherit the process environment of
     the host instance,
  2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-15 01:33:52 -04:00
Henrik Lissner
6d40f30a0a
Fix 'doom compile' error when compiling templates 2019-12-20 05:01:44 -05:00
Henrik Lissner
dc8b3dd57d
Slight reformatting of 'doom refresh' & 'doom compile' output 2019-12-08 00:57:10 -05:00
Henrik Lissner
803da8b3b9
Fix #2104: prevent double-package-init on 'doom refresh'
'Could not find package emacsmirror-mirror in recipe repositories'
error, which shouldn't happen since emacsmirror-mirror is a recipe repo.
2019-11-23 01:21:25 -05:00
Henrik Lissner
ee2c1e384c
Fix void-variable doom-module-dirs error from 'doom clean' 2019-11-08 16:19:29 -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
65d3406e27
Fix various errors during 'doom compile' 2019-09-03 00:38:04 -04:00
Henrik Lissner
4b736bef68
Introduce doom-interactive-mode
As soft inverse alias for noninteractive; this makes it easier to unit
test functionality that depends on the session type.
2019-09-03 00:37:30 -04:00
Henrik Lissner
8ac1e1a781
Refactor doom init process
- Refactors doom-initialize
- Moves doom-initialize-modules call to init.el, to more easily isolate
  it during unit testing.
2019-08-27 00:05:12 -04:00
Henrik Lissner
465122320d
Byte-compile Doom in the correct order
That is, modules should be byte-compiled in the order they're in in your
doom! block.
2019-08-23 20:30:39 -04:00
Henrik Lissner
b29a7ba8fe
Fix 'doom compile'
Fixes `void-function define-key!` error.
2019-08-15 01:33:40 -04:00
Henrik Lissner
624c5e1a71
Complain about unknown targets in 'doom compile' #1657 2019-08-09 22:23:37 -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
93f7520c79
Refactor Doom core init process (again)
- Eager-load all core autoloaded libraries if autoloads file isn't
  present.
- Renames functions to be more descriptive of their true purpose:
  - doom-initialize-autoloads -> doom-load-autoloads-file
  - doom-load-env-vars -> doom-load-envvars-file
- Use doom-module-p instead of featurep! for backend use (the latter is
  mainly syntax sugar for module use, and evaluates at compile/expansion
  time, which may cause hash-table-p errors early in the startup
  process).
- Reorder plist library to prevent load order race condition with the
  functions using the macros that haven't been defined yet.
2019-07-22 23:22:54 +02:00
Henrik Lissner
060ede0e2e
General, minor reformatting across the board
And an offering of blood to our great lord Byte Compiler-sama.
2019-07-22 02:37:45 +02:00
Henrik Lissner
b90dede1ab
💥 Replace package.el/quelpa with straight #374
There are a few kinks to iron out, but for the most part it's done. Doom
Emacs, powered by straight. Goodbye gnutls and elpa/quelpa issues.

This update doesn't come with rollback or lockfile support yet, but I
will eventually include one with Doom, and packages will be (by default,
anyway) updated in sync with Doom.

Relevant threads: #1577 #1566 #1473
2019-07-22 02:30:40 +02:00
Henrik Lissner
9a02bd8ac8
Minor refactors across the board
- when-let* -> when-let
- Fix projectile-locate-dominating-file for connected remote files
2019-06-26 14:31:06 +02:00
Henrik Lissner
5e9c020c21
doom-files-in: replace NOSORT w/ SORT; change default MATCH
- SORT defaults to t
- MATCH's new default regexp excludes files that start with underscore.
2019-06-16 19:16:23 +02:00
Henrik Lissner
2b7c215aee
Refactor byte-compile dispatchers
And don't implicitly compile ~/.emacs.d/init.el unless :core (or no
args) are passed.
2019-04-06 00:11:32 -04:00
Henrik Lissner
5be0e2be4a
Omit private module on doom compile
The private module won't be byte-compiled implicitly anymore, as it can
cause unexpected problems with stale code and config portability.

doom compile          -> only compiles ~/.emacs.d
doom compile :core    -> ~/.emacs.d/core
doom compile :plugins -> ~/.emacs.d/.local/packages/elpa
doom compile :private -> ~/.doom.d
2019-04-05 03:19:38 -04:00
Henrik Lissner
b5552eed39
Improve predicate fn for byte-compile targets
Will now avoid dotfiles and unit test files.
2018-12-06 17:45:53 -05:00
Henrik Lissner
15991b5639 Refactor quiet! to be less destructive
It's possible for the debugger to be invoked from inside code wrapped in
a (quiet! ...) call. The debugger pauses Emacs in a broken state where
the functions locally rebound by quiet! (e.g. message, load-file,
write-region, etc) are never returned to their original definitions.

This attempts to reduce that probabilityby changing how quiet! silences
code. Rather than silencing them completely, they will be logged
to *Messages* but not displayed in the echo area.

Also, quiet! is now used less, where it isn't strictly needed (or where
inhibit-message is sufficient).
2018-09-28 21:13:27 -04:00
Henrik Lissner
bd39ff3526
Minor reformatting 2018-09-13 19:15:16 -04:00
Edwin Török
575c3cccd9 make compile: exit with non-zero code on error
This would allow the CI to fail to compilation errors.
2018-09-12 22:55:13 +01:00
Henrik Lissner
41743869af Fix -y option for bin/doom compile #875 2018-09-09 16:44:17 -04:00
Henrik Lissner
77d2d84e14
Refactor core-cli
Moved to separate files for better organization.
2018-09-09 09:58:20 -04:00