Commit graph

4461 commits

Author SHA1 Message Date
Henrik Lissner
a9bf0b8985
Add cmd!, cmd!!, cmds! convenience macros
It's kind of silly that our command lambda macros (λ! and λ!!) need a
snippet, special key sequence or copy-paste to insert, so in the spirit
of fn! -- and to make sure they take up less space than `lambda!` --
I've added `cmd!` and `cmd!!` aliases. `lambda!` and `lambda!!` are now
deprecated. λ! and λ!! will remain.

I've also added `cmds!` as a convenience wrapper around
general-predicate-dispatch.
2020-05-27 18:29:35 -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
77a4e8f8a7
Fix switch-project completion defaulting to current project
Affects doom/browse-in-other-project, doom/find-file-in-other-project,
+default/search-other-project and
+default/search-project-for-symbol-at-point.

When performing a text or file search in "another project", prior to
this update the current project would be the first highlighted
candidate, which doesn't make much sense when you're invoking a command
for searching *other* projects.
2020-05-26 14:06:19 -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
10a4e6570d
Fix 'doom env' refusing arguments/options 2020-05-26 03:21:27 -04:00
Henrik Lissner
b6cc110f4c
Fix 'wrong-type-arg' error on 'doom upgrade' 2020-05-26 03:12:35 -04:00
Henrik Lissner
894966b1e2
Fix #3221: incorrect usage of doom-cli-execute
The function is variadic in as-of-yet published versions of Doom's CLI;
this usage snuck into a commit.
2020-05-26 02:55:24 -04:00
Henrik Lissner
a814239ec7
Implement daisy-chaining for CLI sessions
elisp lacks an execv implementation (or mature subprocess library), so
we exploit some splenderiffic hackery to get Emacs to execute arbitrary
shell commands after a 'doom ...' command completes. This allows us to
daisy chain doom commands in distinct sessions (wonderful for reloading
doom after a 'doom upgrade', which we do). This minimizes errors when a
'doom upgrade' pulls in breaking changes to Doom's CLI.

We also bring 'doom run' into elisp, since this new functionality
enables us to.
2020-05-26 02:30:54 -04:00
Henrik Lissner
e89b604f5f
Fix 'doom upgrade' when doom is a git submodule 2020-05-26 02:13:02 -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
d1fcbf244b
doom/toggle-debug-mode -> doom-debug-mode 2020-05-25 20:18:36 -04:00
Henrik Lissner
15a58d5b81
Prevent 'doom sync' rebuilding all packages, each time 2020-05-25 18:17:38 -04:00
Henrik Lissner
f47ec8b919
Disable default doom-font in config.el template
Closes #3194
2020-05-25 16:30:21 -04:00
Henrik Lissner
9f024e549f
Instruct user to rerun 'doom upgrade'
If it fails during reloading of Doom's core.

Relevant to #3131
2020-05-25 16:27:51 -04:00
Henrik Lissner
16d44de0db
Add/improve docs for doom sync's -u & -p switches 2020-05-25 16:26:16 -04:00
Henrik Lissner
8c37928de2
Disable 'doom refresh'
That 'doom refresh' and 'doom sync' do the same thing has been a point
of confusion for a while. By phasing out 'doom refresh' we can finally
put that to rest.
2020-05-25 16:23:17 -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
5cba174bd9
Add doom-sync-{pre,post}-hook 2020-05-25 16:03:16 -04:00
Henrik Lissner
3139303874
Remove unused test module
This will be replaced soon.
2020-05-25 16:02:07 -04:00
Henrik Lissner
fe7df725f6
Have package manager manage straight.el
We used a clumsy hack in `doom--ensure-straight` to delete straight if
its pinned commit didn't match the current one, to force it to be
reinstalled. With this, Doom's package manager will delete/update
straight like any other package.
2020-05-25 15:58:28 -04:00
Henrik Lissner
0bc3f8ea87
doom/purge: refactor & optimize
Reduce how much work it had to do.
2020-05-25 15:55:29 -04:00
Henrik Lissner
944d7ec83f
Extract installation of core packages to function 2020-05-25 15:55:29 -04:00
Henrik Lissner
235b69bd20
Parameterize packages.el filename 2020-05-25 15:55:29 -04:00
Henrik Lissner
e60d8f9cb1
doom/install: refactor template insertion & module init 2020-05-25 15:55:29 -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
be889d09e8
Rename doom-format lib -> doom-output
`format` isn't an appropriate for this library, considering it (and
future additions to it) will be mainly concerned with printing or
capturing output.
2020-05-25 15:55:29 -04:00
Henrik Lissner
ccd1764acb
Remove 'doom sync' from shell.nix
Let user decide what they want to do upon starting the shell. We
accommodate the user that wants simple access to Emacs 26/27/HEAD.
2020-05-25 15:55:28 -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
e00bfc7612
Minor refactors & reformatting 2020-05-25 03:43:40 -04:00
Henrik Lissner
3e5cf3de09
Simplify gcmh config
We don't need to manipulate gc-cons-percentage. The GC never procs at
startup either way.
2020-05-25 02:10:07 -04:00
Henrik Lissner
09c6e99e23
Fix 'Cannot get this file-path' when bumping in babel edit buffers
Break glass in case of literate configs.
2020-05-25 01:19:03 -04:00
Henrik Lissner
6a8e990459
Fix wrong-number-of-args error on doom-init-theme-h
And silence byte-compiler warning for unused lexical argument.
2020-05-25 00:01:52 -04:00
Henrik Lissner
ec1c6291ac
Merge pull request #3198 from cxb811201/patch-1
Bump :core
2020-05-24 22:50:18 -04:00
Henrik Lissner
a9316525c4
Backport variadic setq-local from Emacs 27 2020-05-24 16:45:55 -04:00
Mike Chen
2cfff96437
Bump :core
raxod502/straight.el@f606bfa -> raxod502/straight.el@846956e
jwiegley/use-package@c873d55 > jwiegley/use-package@d2640fe
bbatsov/projectile@768f057 > bbatsov/projectile@5103cfc
noctuid/general.el@42e3803 > noctuid/general.el@a0b17d2
2020-05-22 23:58:00 +08:00
Henrik Lissner
a262527a7f
Fix load-theme not disabling old themes in Emacs 26
In Emacs 26, the old themes must be disabled *before* the new one is
loaded, otherwise it will fail to do so. In 27+ this isn't necessary,
and it's preferred that we do it after the theme loads, so we can be
absolutely sure the theme was successfully enabled, before we disable
the others!
2020-05-21 04:33:39 -04:00
Henrik Lissner
dd0da922a3
{menu,tool,scroll}-bar-mode = nil
See comments.
2020-05-20 15:40:39 -04:00
Henrik Lissner
196490c772
Improve UX & output of doom/bump-* commands 2020-05-20 15:33:55 -04:00
Henrik Lissner
35b99fb272
Add fn! macro
For cl-function version of lambda, for implicit destructuring of
arguments.
2020-05-20 15:33:55 -04:00
Henrik Lissner
ecbd4b7567
Fix setq! not triggering setters
Because the setters were looked up at expansion/compile time (much, much
too early), rather than at runtime.

This should indirectly fix "No year zero" errors for org-journal
users (#3173).
2020-05-20 01:06:04 -04:00
Henrik Lissner
f0e6ede81b
Relax how strict doom/bump-package-at-point is about point
This command would formerly work only if the point was on the opening
parenthesis, and sometimes insert the :pin in odd places. It is now much
more relaxed.
2020-05-19 22:00:20 -04:00
Henrik Lissner
69a25a8468
Make doctor treat missing ripgrep as an error
It's a hard dependency for Doom.
2020-05-19 21:49:01 -04:00
Henrik Lissner
204783a96e
Change how doom core reloads itself after 'doom upgrade'
Hopefully to address weird void-function errors while upgrading.
2020-05-19 21:49:01 -04:00