Commit Graph

4478 Commits

Author SHA1 Message Date
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
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
e00bfc7612 Minor refactors & reformatting 2020-05-25 03:43:40 -04:00
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
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
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
ec1c6291ac Merge pull request #3198 from cxb811201/patch-1
Bump :core
2020-05-24 22:50:18 -04:00
a9316525c4 Backport variadic setq-local from Emacs 27 2020-05-24 16:45:55 -04:00
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
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
dd0da922a3 {menu,tool,scroll}-bar-mode = nil
See comments.
2020-05-20 15:40:39 -04:00
196490c772 Improve UX & output of doom/bump-* commands 2020-05-20 15:33:55 -04:00
35b99fb272 Add fn! macro
For cl-function version of lambda, for implicit destructuring of
arguments.
2020-05-20 15:33:55 -04:00
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
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
69a25a8468 Make doctor treat missing ripgrep as an error
It's a hard dependency for Doom.
2020-05-19 21:49:01 -04:00
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
df0bca6579 Fix doom/bump-module for :private packages 2020-05-19 19:11:02 -04:00
92b98bed11 Fix doom/help-search-loaded-files
Would throw a string type error because load-history doesn't only
contain sublists whose CARs are strings.
2020-05-19 17:33:57 -04:00
49bf79a380 Restore .projectile recognition
Why it was removed in the first place: hlissner/doom-emacs#1974

Why it's being restored: seems this causes too much confusion. Folks ask
why projectile doesn't recognize their projects. It's too much of
maintenance hassle. We'll deal with the breaking changes project.el will
introduce when we cross that bridge.

Closes #3074
2020-05-19 01:56:56 -04:00
a680885ed9 Fix doom-first-{file,buffer}-hook on first file
Due to typo.
2020-05-18 13:59:40 -04:00
ebdb3399b5 Recommend the correct option for changes in package origin
For prompts like these

  > In repository "org-roam", remote "origin" has URL
    "https://github.com/jethrokuan/org-roam.git"
  but recipe specifies a URL of
    "https://github.com/org-roam/org-roam.git"

       1) Abort
       2) Rename remote "origin" to "origin-1", re-create "origin" with correct URL, and fetch
       3) Rename remote "origin" manually, re-create it with correct URL, and fetch (Recommended)
       4) Delete remote "origin", re-create it with correct URL, and fetch
       5) Delete remote "origin", re-create it with manually set URL, and fetch

    How to proceed? (1, 2, 3, 4, 5)

4 should be recommended, not 3.
2020-05-18 03:37:42 -04:00
643377d8a4 Fix void-function doom--straight-respect-print-indent-a error
On first use of 'doom upgrade'
2020-05-18 03:27:30 -04:00
de78d0cc62 Fix #3138: infinite loop when reading package! files 2020-05-17 06:14:37 -04:00
6241ba2faa Emit fetch output when updating recipe repos 2020-05-17 06:14:37 -04:00
375faedb1b Emit backtrace if doom upgrade fails 2020-05-16 05:38:20 -04:00
49790fb53f Include the error when 'doom upgrade' fails 2020-05-16 05:31:33 -04:00
10d9ca87e9 Correct regexps for recommended straight options
When you're being prompted, these regexps control what option is
highlighted as the recommended option, and two of them were definitely
wrong, and another two *might've* been wrong.
2020-05-15 22:58:00 -04:00
1b43cf99f7 Add comments to & reformat doom-initialize 2020-05-15 21:57:21 -04:00
2e1c706c73 doom/env: fix -a switch, add -r switch #2434
Can now white and blacklist envvars
2020-05-15 21:56:04 -04:00
3d10e984ec Fix #3134: invalid lambda variable t on 'doom compile' 2020-05-15 17:56:29 -04:00
0972858808 Update 'doom install' post-amble 2020-05-15 17:55:23 -04:00
ea2de668b7 Fix #3135: no template after doom install 2020-05-15 17:19:39 -04:00
c1bee692cf doom/install? ignore errors in module init.el's
Fix #3132
2020-05-15 14:22:13 -04:00
8a83e9addd Fix wrong-number-of-args error on dired-find-file 2020-05-15 14:20:03 -04:00
e16c410b2a Fix use-package load errors on 'doom install' 2020-05-15 05:37:10 -04:00
2b8388079b Fix doom/bump-module command
Also allows you to bump :core now.
2020-05-15 05:37:10 -04:00
76b133fd98 Install core packages early 2020-05-15 05:37:08 -04:00
87e279ce61 doom/doctor: improve error handler for font detection
Fixes #3008
2020-05-15 04:59:10 -04:00
8f8d796ecd doom/doctor: fix 'missing emacs package: org' #2284 2020-05-15 04:19:25 -04:00
2884dd9ea7 Fix 'recreate repo' option not being recommended
When updating a package with a changed recipe (e.g. it's branch).
2020-05-15 02:29:22 -04:00
ea18c83c0a General refactors & reformatting across the board 2020-05-15 01:44:53 -04:00
f521823d3b Fix quiet! macro not silencing file loading 2020-05-15 01:33:52 -04:00
fc90e0fb71 Simplify quiet!'s expanded form
We don't need to test doom-interactive-mode at runtime.
2020-05-15 01:33:52 -04:00
68709fe93a Fix letf! sometimes losing letf binds
When expanding:

  (quiet! ...)

You'd expect (simplified for explanation):

  (letf! ((standard-output ...)
         ((symbol-function #'message) ...)
         ((symbol-function #'load-file) ...)
         ((symbol-function #'write-region) ...))
    ...)

But instead get:

  (letf! ((standard-output ...))
    ;; where'd the other binds go?
    ...)

This was due to data-loss caused by nreverse's destructive mutation of
the given bindings.

Also: silences byte-compiler complaining about unused bindings.
2020-05-15 01:33:52 -04:00
68b5f687bd doom/doctor: fix 'org not installed' error
Also indents missing package warnings correctly and makes them harder to
mistake for system packages.

Fixes #2284
2020-05-15 01:33:52 -04:00
c682079783 doom/doctor: warn about 28+, not 27+
27 is now the recommended version for Doom.
2020-05-15 01:33:52 -04:00
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
e92a470252 Merge pull request #3100 from chuxubank/develop
Change path separator on Windows when using fd
2020-05-14 04:20:09 -04:00
a2011232a2 Change envvar coding system buffer locally 2020-05-14 04:13:05 -04:00