Commit graph

161 commits

Author SHA1 Message Date
Henrik Lissner
06392a723f refactor: rename orig-fn arg in advice to fn
A minor tweak to our naming conventions for the first argument of an
:around advice.
2021-08-04 01:53:12 -04:00
Henrik Lissner
e2a11d24fd core: minor refactors and comment revisions 2021-05-06 18:36:32 -04:00
Henrik Lissner
ff64a9d106 Add doom-run-hooks
Produces more helpful (and harder-to-miss) error messages when a hook
emits an error. Also advises run-hook when doom-debug-mode is active, so
errors in hooks (generally, major mode hooks) don't quietly go
unnoticed.
2021-05-06 04:27:33 -04:00
ivanbrennan
2e15f6ad1b
Fix doom-module-mplist-map obsolete module warning 2021-04-17 10:03:51 -04:00
Henrik Lissner
60f74c7696 Resolve symlinks in module paths 2021-02-17 13:47:43 -05:00
Janfel
faefc9991c
Fix :unless in (doom!) 2021-01-29 23:07:03 +01:00
John Bampton
583f854298 Fix spelling 2021-01-18 02:16:45 +10:00
Henrik Lissner
07db84bfe2
Don't chase symlinks
This should make more exotic symlink config setups viable, but should
also speed up a few internal operations. There are too many possible
symlink configurations to support them all, however.
2020-12-11 15:50:02 -05:00
Henrik Lissner
23c36a2feb
Fix wrong-type-arg error on 'doom compile' 2020-10-14 01:38:01 -04: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
f4ec42ae5c
Move :tools macos to :os macos 2020-08-20 02:14:32 -04:00
Henrik Lissner
7081d833f6
Move :ui pretty-code to :ui ligatures
Includes a major refactor of the module.
2020-08-20 02:14:32 -04:00
Henrik Lissner
8bbac4bfb3
Minor refactors 2020-08-08 03:06:26 -04:00
Henrik Lissner
6e702a435a
Warn when :ensure t is used
When package.el isn't initialized.
2020-08-03 19:11:15 -04:00
Henrik Lissner
f3c9a0775e
Load custom-file #3485 2020-07-22 19:18:23 -04:00
Henrik Lissner
1d709e30be
custom-file = ~/.doom.d/config.el
custom-file is now set to your private config.el, because users may want
to be able to see what Customize is storing (and where) front and
center. Storing it away in ~/.emacs.d/.local makes it harder to notice.

Also, have enable-command (and disable-command) save their data to
custom-file instead of ~/.emacs.d (see #3379).

Fixes #3379
2020-06-13 16:21:43 -04:00
Henrik Lissner
9edd4f26f3
Only crawl autoloads from module once
If you have a private module with the same name as a built-in module,
doom-module-load-path returns two entries for that module, causing our
autoloads scanner to scan it twice.
2020-06-11 04:49:31 -04:00
Henrik Lissner
ea52dbc12e
Fix extra ) in doom-obsolete-modules
Left over from #3308
2020-06-05 15:22:32 -04:00
Marcus Ramberg
35ec72d080 Rename perl module to raku.
It doesn't actually contain any Perl config.
2020-06-05 21:01:23 +02:00
Henrik Lissner
02542a63d4
Refactor :load-path resolve-from-here advice 2020-06-01 21:07:22 -04:00
Henrik Lissner
6a85417e8e
Fix #3272: void-variable args regression 2020-06-01 21:02:36 -04:00
Henrik Lissner
0787eae274
Expand use-package :load-path relative to containing file 2020-06-01 18:23:27 -04:00
Henrik Lissner
d4d8c48265
Refactor core-modules
- Update comments & docstrings
- Remove unnecessary compile-time evaluation (we're not using any of
  that config at compile time within that file anyway).
2020-05-27 16:11:59 -04:00
Henrik Lissner
3253ca8435
Minor refactors & comment/message revision 2020-05-25 22:11:15 -04:00
Henrik Lissner
519a402f62
Freeze doom-modules in between 'doom sync'
The coming CLI rewrite makes bin/doom atomic, but also "freezes" more of
your config in between 'doom sync's and 'doom upgrade's. This is
necessary to implement a robust rollback system. However, that also
means that `doom!` shouldn't do anything when read in an interactive
session (and should only be read when running `doom sync`).

Indirectly fixes #2612
2020-05-25 21:51:35 -04:00
Henrik Lissner
2c2a4c5c8a
Don't load core modules if NO-CONFIG-P
Might address #2612
2020-05-25 21:01:09 -04:00
Henrik Lissner
3c24f15450
Fix void-variable doom-interactive-mode (part 3)
Third time's a charm!

...

I need sleep.
2020-05-25 16:15:23 -04:00
Henrik Lissner
53b7abde1e
Fix void-variable doom-interactive-mode (part 2)
Of the 10 part mini-series!
2020-05-25 16:14:27 -04:00
Henrik Lissner
d3e4d317b3
Fix void-variable doom-interactive-mode 2020-05-25 16:12:30 -04:00
Henrik Lissner
cc5f498586
Add magic cli.el in modules & refactor module init
Doom now looks for cli.el files in your private directory or modules,
giving them an opportunity to customize the CLI (add commands or
reconfigure existing ones) to suit their purposes.
2020-05-25 15:55:28 -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
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
24164f4869
Disable use-package's :ensure t property by default
Many packages recommend setting up their packages with something like:

  (use-package PACKAGE
    :ensure t
    ...)

New users will frequently copy these into their config, then experience
long startup times or a cryptic error about the package failing to
install.

This is because `:ensure t`, by default, uses package.el (Emacs'
built-in package manager) to check for and install packages, but Doom
doesn't use package.el, it uses straight.el. So we disable `:ensure`.

On the other hand, if the user has loaded `package` by hand, then we
should assume that they know what they're doing, and restore the old
behavior.
2020-05-11 16:16:58 -04:00
Henrik Lissner
079b748217
Fix conflict between private & default autodefs
e.g. If you had a ~/.doom.d/modules/tools/lsp/autoload.el that defined
an lsp! autodef, it would be indexed and included in
~/.emacs.d/.local/autoloads.el *before* the lsp! autodef from the
original ~/.emacs.d/modules/tools/lsp/autoload.el.
2020-04-29 18:32:25 -04:00
Henrik Lissner
c51b2d42ad
Remove require! macro
This was meant for unit tests, which is where it will be moved to.
2020-04-24 02:35:41 -04:00
Henrik Lissner
38f957557a
Remove def-package macros
They've been deprecated for some time now.
2020-04-24 02:35:29 -04:00
Henrik Lissner
1cb753cbb1
lang/haskell: remove intero support
The package was deprecated and abandoned upstream since November 2019.

Closes #2121
2020-04-14 19:27:33 -04:00
Henrik Lissner
a732875ce6
More aggressively deprecate def-package!
It'll be gone soon!
2020-04-08 23:51:40 -04:00
Henrik Lissner
b8c25b6b4e
Move after! to core-lib
Doesn't really belong in core-modules.
2020-01-30 16:57:49 -05:00
Henrik Lissner
12094788d7
Fix references to :tools fly{spell,check} 2020-01-14 03:04:26 -05:00
Henrik Lissner
20bc70096f
Fix deprecation warnings for fly{check,spell} modules 2020-01-10 22:58:10 -05:00
Henrik Lissner
b89992624b
Move :tools fly{check,spell} to :checkers {syntax,spell}
These modules were renamed so we can later generalize their
implementations, such as adding flymake support to the syntax checker.
2020-01-09 22:56:26 -05:00
Henrik Lissner
fe57256d6b
Minor refactors; reduce sp-max-prefix-length 2020-01-05 19:58:59 -05:00
Henrik Lissner
ae5cf1889b
Move custom-file to {doom-local-dir}/custom.el 2020-01-04 17:10:56 -05:00
Clément Busschaert
0ec1355f13
docs/core: typo in featurep! docs
`s/moduel/module`
2019-12-30 09:35:53 +01:00
Henrik Lissner
322bca710a
General refactors & reformatting 2019-12-20 00:59:52 -05:00
Henrik Lissner
235d31e82e
Shorten def-package{,-hook}! deprecation warnings 2019-12-03 20:02:32 -05:00
Henrik Lissner
724bf9aa08
Refactor evaluation of doom!'s arguments
And update doom!'s docstring
2019-12-02 20:22:00 -05:00
Henrik Lissner
d11902f313
doom-module-from-path: return nil if not in a module #2107 2019-11-23 14:52:38 -05:00
Henrik Lissner
e0cd71e25f
Complain louder about deprecated def-package! macros
They will be removed soon.
2019-10-31 14:35:24 -04:00