Commit graph

331 commits

Author SHA1 Message Date
Henrik Lissner
7a2be67efa
refactor!: redesign module init/config hooks
BREAKING CHANGE: For consistency and correctness, I've renamed the
module init/config hooks, and added new ones:

- Adds doom-before-modules-config-hook
- Adds doom-after-modules-config-hook (replaced doom-before-init-modules-hook)
- Adds doom-before-modules-init-hook
- Adds doom-after-modules-init-hook (replaced doom-init-modules-hook)
- Removed doom-after-init-modules-hook (replaced w/ after-init-hook)

The old naming (and timing) was counterintuitive. Now, it's named after
the loaded file group (init.el vs config.el), and I added before/after
variants. Altogether, this should make them less ambiguous.

I've also moved some functions in various modules to more correct hooks.

Load order before this change:
- $EMACSDIR/early-init.el
- $EMACSDIR/lisp/doom.el
- $EMACSDIR/lisp/doom-start.el
- $DOOMDIR/init.el
- {$DOOMDIR,~/.emacs.d}/modules/*/*/init.el
- `doom-before-init-modules-hook'
- {$DOOMDIR,~/.emacs.d}/modules/*/*/config.el
- `doom-init-modules-hook'
- $DOOMDIR/config.el
- `doom-after-init-modules-hook'
- `after-init-hook'
- `emacs-startup-hook'
- `window-setup-hook'

Load order after this change:
- $EMACSDIR/early-init.el
- $EMACSDIR/lisp/doom.el
- $EMACSDIR/lisp/doom-start.el
- $DOOMDIR/init.el
- `doom-before-modules-init-hook'
- {$DOOMDIR,~/.emacs.d}/modules/*/*/init.el
- `doom-after-modules-init-hook'
- `doom-before-modules-config-hook'
- {$DOOMDIR,~/.emacs.d}/modules/*/*/config.el
- `doom-after-modules-config-hook'
- $DOOMDIR/config.el
- `after-init-hook'
- `emacs-startup-hook'
- `window-setup-hook'
2022-09-16 01:14:22 +02:00
Henrik Lissner
ad6a3d0f33
refactor: deprecate featurep! for modulep!
featurep! will be renamed modulep! in the future, so it's been
deprecated. They have identical interfaces, and can be replaced without
issue.

featurep! was never quite the right name for this macro. It implied that
it had some connection to featurep, which it doesn't (only that it was
similar in purpose; still, Doom modules are not features). To undo such
implications and be consistent with its namespace (and since we're
heading into a storm of breaking changes with the v3 release anyway),
now was the best opportunity to begin the transition.
2022-08-14 20:43:35 +02:00
Henrik Lissner
0407621aff
refactor: deprecate EMACS2[89]+, NATIVECOMP, MODULES
To reduce redundancy, remove the maintenance hassle that version
constants would impose later on, and rely on built-in
facilities (featurep) more over global variables or doomisms, these
global constants have been deprecated in favor of Emacs "features":

- EMACS28+   -- replace with (> emacs-major-version 27)
- EMACS29+   -- replace with (> emacs-major-version 28)
- NATIVECOMP -- replace with (featurep 'native-compile)
- MODULES    -- replace with (featurep 'dynamic-modules)

(These constants will be formally removed when v3 is released. The IS-*
constants are likely next, but I haven't decided on their substitutes
yet)

I also decided to follow native-compile's example and provide features
for Emacs' system features (since system-configuration-features' docs
outs itself as a poor method to detect features):

- dynamic-modules
- jansson
- native-compile -- this one already exists, but will instead be removed
  if it's non-functional; i.e. (native-comp-available-p) returns nil.

These are now detectable using featurep, which is fast and built-in.
2022-08-14 20:43:35 +02:00
Henrik Lissner
118f0c416a
refactor(evil): replace evil-visual-update-x-selection advice
With the new evil-visual-update-x-selection-p setting.

Also adds a more descriptive comment to this design choice.
2022-08-10 13:18:34 +02:00
Henrik Lissner
27a448b04b
feat(vc-gutter): add +diff-hl backend
This adds an alternative backend to the :ui vc-gutter module, enabled
with the +diff-hl flag. In the future, I intend for diff-hl to replace
git-gutter, as it is slightly faster and depends on more native
functionality (vc.el), but it's still a little buggy. It will remain
opt-in until those issues are sorted out.
2022-08-08 18:23:47 +02:00
Henrik Lissner
057e6c531c
refactor: replace doom-enlist with ensure-list
doom-enlist is now a deprecated alias for ensure-list, which is built
into Emacs 28.1+ and is its drop-in replacement. We've already
backported it for 27.x users in doom-lib (in 4bf4978).

Ref: 4bf49785fd
2022-08-07 19:43:13 +02:00
Henrik Lissner
1abcf913aa
revert: fix(docs): set mode in file-local vars
emacs-straight/org-mode@e22b4eb7aa introduced a breaking change that
made it impossible to rely on .dir-locals.el to change org-mode buffers
in $EMACSDIR to doom-docs-org-mode (without infinite recursion), so we
used file-local variables in 7e400ab.

emacs-straight/org-mode@215de6176b reverted that change, so we can use
.dir-locals.el again, and this is my preference, since it requires less
boilerplate across our hundreds of org files.

Ref: emacs-straight/org-mode@215de6176b
Ref: emacs-straight/org-mode@e22b4eb7aa
Revert: 7e400abdc0
2022-08-07 19:08:07 +02:00
Henrik Lissner
1f8bf7accb
merge: rewrite-docs
I've omitted docs/*.org from this merge, as there is still work left to
do there, but I am pushing the module docs early so folks can benefit
from the new docs sooner.
2022-08-03 03:27:50 +02:00
Henrik Lissner
7e400abdc0
fix(docs): set mode in file-local vars
Due to emacs-straight/org-mode@e22b4eb, a replacement major mode (for
org-mode) can no longer be specified from .dir-locals.el, as it spirals
into infinite recursion. Therefore, a mode: line is needed in all Doom
docs.

Ref: emacs-straight/org-mode@e22b4eb7aa
2022-08-03 02:46:33 +02:00
ivanbrennan
90c510caca refactor(evil): remove evil-want-C-w-scroll
This appears to have been added accidentally in the following commit:
8b9d4a94bb

The codebase contains no references to it.
2022-08-02 20:36:59 +02:00
Henrik Lissner
1255315bfc
refactor(docs): replace nav menus with virtual one
Now that the header is dynamically generated (when doom-docs-mode is
active), a literal header is unnecessary.
2022-08-02 19:37:07 +02:00
Henrik Lissner
e77a45bc22
docs: use lowercase keywords
As per Org's new defaults, which we're adopting elsewhere, so may as
well adopt it here.
2022-08-02 16:23:43 +02:00
Henrik Lissner
9ec60d9ab9
fix(evil): evil-collection-occur -> evil-collection-replace
evil-collection-occur.el was moved to evil-collection-replace.el in
emacs-evil/evil-collection@79fc09b014.

Fix: #6495
Close: #6524
Ref: emacs-evil/evil-collection@79fc09b014
Co-authored-by: DeesonGao <DeesonGao@users.noreply.github.com>
2022-07-05 14:16:16 +02:00
Henrik Lissner
5a98d59afc
perf(evil): lazy load evil-collection-shortdoc
Another package that Emacs loads eagerly at startup, that ends up
pulling in evil-collection et co.
2022-07-04 02:38:10 +02:00
Henrik Lissner
14b2395424
refactor: remove unused core variables
doom-debug-p and doom-interactive-p have always been intentionally
redundant, because changing the variables they replaced had other
side-effects, which made writing tests for them difficult. Since our
new (yet unpublished) tests lean heavily toward integration testing more
than unit testing, this becomes an implementation detail.

And doom-init-p's only use was refactor out at some point in the past,
so it's no longer used.

Also done to reduce Doom's footprint, in general.
2022-06-29 18:14:20 +02:00
Henrik Lissner
31519d393a
bump: :editor evil
emacs-evil/evil-collection@e557188692 -> emacs-evil/evil-collection@6cc02b238c
emacs-evil/evil@3e41a82333 -> emacs-evil/evil@157af04d2c
hlissner/evil-snipe@a79177df40 -> hlissner/evil-snipe@c07788c35c
redguardtoo/evil-nerd-commenter@42ba1a473b -> redguardtoo/evil-nerd-commenter@386cd758a4
2022-06-17 18:21:23 +02:00
Henrik Lissner
d0cdf8f5c6
fix(evil): ]f/[f opening directories
They should traverse files, not directories.
2022-06-13 01:16:22 +02:00
Samuel Tschiedel
488ad07cc5 fix(evil): define *-any-quote directly
Defining `*-any-quote` objects via the exiting `*-block` helpers leads
to incorrect behaviour, where the trailing boundary is also included as
part of the selection (cursor on `|`, selection between `|`):

```
start: "te|st"
v i q: "|test"|
```

The expected behaviour is the same as `v i "`:
```
start: "te|st"
v i q: "|test|"
```

Fix: #5698
2022-04-25 16:38:40 +02:00
Henrik Lissner
f6fd2dc000
bump: :editor
abo-abo/lispy@bf31576802 -> abo-abo/lispy@df1b7e614f
cute-jumper/evil-embrace.el@464e8ec52f -> cute-jumper/evil-embrace.el@7b5a539cfe
doomemacs/snippets@3083b2342f -> doomemacs/snippets@2d031f7231
edkolev/evil-lion@6b03593f5d -> edkolev/evil-lion@4da660e124
emacs-evil/evil-collection@e69abfcb1c -> emacs-evil/evil-collection@e557188692
emacs-evil/evil@be97395e31 -> emacs-evil/evil@3e41a82333
emacsorphanage/god-mode@d7e9330950 -> emacsorphanage/god-mode@fac7d26ecd
gabesoft/evil-mc@246aecc174 -> gabesoft/evil-mc@63fd2fe0c2
magnars/multiple-cursors.el@8a60fc7ef0 -> magnars/multiple-cursors.el@aae47aebc0
2022-03-31 19:25:50 +02:00
Dan
42e5763782
fix(evil): respect users' evil-collection-key-blacklist 2022-02-23 17:49:53 +01:00
7ym0n.q6e
d833242de7
fix(evil): +evil/next-preproc-statement -> +evil/next-preproc-directive
+evil/next-preproc-statement does not exist.

Ref: 83387d89e9
2022-02-10 04:07:16 +01:00
Henrik Lissner
7246db457c docs: replace doom-source with doom-repo links
I will later use "source" to refer to module sources, so better we avoid
the terminology for now.
2022-02-01 18:55:27 +01:00
Henrik Lissner
1db8462d6b bump: :editor evil
emacs-evil/evil-collection@0ce1ea96b4 -> emacs-evil/evil-collection@e69abfcb1c
emacs-evil/evil@a5fd96dadc -> emacs-evil/evil@be97395e31
wcsmith/evil-args@758ad5ae54 -> wcsmith/evil-args@2671071a4a

Fix: #6037
Ref: emacs-evil/evil#1573
Ref: emacs-evil/evil#1566
2022-01-27 18:49:21 +01:00
Henrik Lissner
09098bed48 fix(evil): activate evil-collection-mpc
Amend: 86034131c4
2022-01-27 03:49:53 +01:00
Henrik Lissner
1d41ee0c1a refactor(evil): use window-swap-states in +evil--window-swap
Taking a look at the built in windmove functions shows that Emacs has a
built in function for swapping windows called `window-swap-states`.
Using this ensures the window state is maintained.

Ref: #6023
Co-authored-by: luveti <luveti@users.noreply.github.com>
2022-01-27 03:43:51 +01:00
Dan
1643124104
fix(evil): window-selection-change-functions use case
`window-selection-change-functions` expects hooks to have one argument.
2022-01-27 03:33:13 +01:00
Henrik Lissner
86034131c4 bump: :editor evil
Dewdrops/evil-exchange@ac50f21b29 -> Dewdrops/evil-exchange@5f0a2d4143
emacs-evil/evil-collection@1b9d5c5d93 -> emacs-evil/evil-collection@0ce1ea96b4
emacs-evil/evil@b00018bf55 -> emacs-evil/evil@a5fd96dadc
redguardtoo/evil-nerd-commenter@63baf2d1c7 -> redguardtoo/evil-nerd-commenter@42ba1a473b

Close: #5983
2022-01-12 01:55:34 +01:00
Henrik Lissner
fe3f8866d8 fix(evil): disable evil-collection-smerge-mode
evil-collection-smerge-mode is broken due to incorrect pathing upstream,
so evilified keybinds for smerge-mode will have to wait until it is
addressed there.

Amend: 8d6221bc1e
Amend: 7bbc3bc48e
2021-12-14 01:21:33 +01:00
Henrik Lissner
8d6221bc1e fix(evil): evil-collection-smerge-mode
Amend: 7bbc3bc48e
2021-12-13 20:08:18 +01:00
Henrik Lissner
7bbc3bc48e bump: :editor
abo-abo/lispy@e9731aa955 -> abo-abo/lispy@bf31576802
emacs-evil/evil-collection@652d74acfb -> emacs-evil/evil-collection@1b9d5c5d93
emacs-evil/evil@07aba40dd3 -> emacs-evil/evil@b00018bf55
emacsorphanage/god-mode@1d7d647bb5 -> emacsorphanage/god-mode@d7e9330950
hlissner/doom-snippets@5c0eb5bd70 -> hlissner/doom-snippets@3083b2342f
2021-12-13 19:30:42 +01:00
Quoc Huy Vu
0352ade454 fix(evil): correct typesetting quotations in latex
Use `evil-embrace` for typsetting quotations in latex instead of
`evil-surround`.
2021-11-30 14:05:57 +01:00
Quoc Huy Vu
c09777b36b fix(evil): handle edge cases of embrace
If the surround key is `\(`, the text should be surrounded as
`\( text \)`. The same for `\[` and `\{`.
2021-11-25 01:45:09 +01:00
Henrik Lissner
88844e9cec docs: simplify internal docs links
Fewer links means less confusion.

- Merge doom-issue and doom-commit links into doom-ref (for auto-linking
  Issue/PR/commit references).
- Merge doom-module-source and doom-docs-source links into doom-source.
- Rename doom-report-issue to doom-report.
- Use '!' as the icon for module issues link.
- Remove doom-repo (replaced with "doom:*" in :lang org module).
- Add doomdir and emacsdir links to :lang org module.
2021-11-21 20:04:28 +01:00
Henrik Lissner
9ada400805 docs(:editor): update READMEs to new format 2021-11-21 20:04:28 +01:00
Henrik Lissner
8645634608 bump: :editor evil multiple-cursors
emacs-evil/evil-collection@63d84ff4bd -> emacs-evil/evil-collection@652d74acfb
emacs-evil/evil@17c635f6e1 -> emacs-evil/evil@07aba40dd3
hlissner/evil-multiedit@50179bfb26 -> hlissner/evil-multiedit@15a47540db
hlissner/evil-snipe@1a28d718c8 -> hlissner/evil-snipe@a79177df40
magnars/multiple-cursors.el@588daf8c52 -> magnars/multiple-cursors.el@8a60fc7ef0

- Fixes "void-variable: evil-digit-bound-motions" errors (#5700)
- Adds evil-collection support for:
  - Forge: emacs-evil/evil-collection@33461aa545
  - Org: emacs-evil/evil-collection@9e47d61bdf
  - Scheme: emacs-evil/evil-collection@838f609899

Fix: #5700
2021-11-18 18:56:16 +01:00
Henrik Lissner
a08ec4ab16 bump: :editor evil
emacs-evil/evil-collection@6709c1ec41 -> emacs-evil/evil-collection@63d84ff4bd
emacs-evil/evil@ebae35360c -> emacs-evil/evil@17c635f6e1
redguardtoo/evil-nerd-commenter@6bc41317ba -> redguardtoo/evil-nerd-commenter@63baf2d1c7

New version of evil was required by latest commit of
evil-multiedit (bumped in 363a031699).

Ref: 363a031699
Fix: #5700
2021-10-28 19:57:33 +02:00
Kenneth Lin
380d04f890
fix(evil): reference to removed command (#5608)
+vc/browse-at-remote-file-or-region no longer exists.
+vc/browse-at-remote seems like the reasonable replacement.
2021-10-11 00:13:11 +02:00
Henrik Lissner
b092a8f8e7 bump: :editor evil
emacs-evil/evil-collection@bc5a02ed85 -> emacs-evil/evil-collection@6709c1ec41
emacs-evil/evil@d8f5732708 -> emacs-evil/evil@ebae35360c
2021-10-10 20:15:40 +02:00
Henrik Lissner
0bb4d4dfcb refactor: switch buffer/frame/window hooks
Emacs 27 introduced a bunch of `window-*-change-functions` hooks,
including `window-selection-change-functions` and
`window-buffer-change-functions`, which handles 98% of the use case for
Doom's `doom-switch-{buffer,window,frame}-hook` hooks, so I've rewritten
them to use them under the hood, which amounts to simpler code and fewer
hacks.
2021-10-10 18:36:46 +02:00
Artem Smaznov
68c5336972
fix(evil): disable evil-snipe in dired (#5417)
Fix #3359
2021-10-07 03:11:03 +02:00
Henrik Lissner
ee890064f8 bump: :editor evil
emacs-evil/evil-collection@8a75a03656 -> emacs-evil/evil-collection@bc5a02ed85
emacs-evil/evil@82e5becae2 -> emacs-evil/evil@d8f5732708

Improves first-load time for consult commands, thanks to
emacs-evil/evil-collection@03d80be41b.

Ref emacs-evil/evil-collection#539
Ref emacs-evil/evil-collection@03d80be41b
2021-10-06 01:30:45 +02:00
Henrik Lissner
45c759d7d7 fix(evil): evil-join fails to join commented lines
Fix #5558
2021-10-05 02:33:15 +02:00
Henrik Lissner
a0a45ce81a bump: :editor evil
emacs-evil/evil-collection@9be3805b60 -> emacs-evil/evil-collection@8a75a03656
emacs-evil/evil@b237462fee -> emacs-evil/evil@82e5becae2
hlissner/evil-snipe@a9b9b39a79 -> hlissner/evil-snipe@1a28d718c8
juliapath/evil-numbers@cd23a7b458 -> juliapath/evil-numbers@8ce0066fa4
redguardtoo/evil-nerd-commenter@118bebd02a -> redguardtoo/evil-nerd-commenter@6bc41317ba

Fixes evil-collection-magit keybinds for magit-stash and
magit-worktree (on Z).

Ref emacs-evil/evil-collection@940dfe91aa
Ref emacs-evil/evil-collection@53a76e15df
Fix #5260
2021-09-15 17:47:17 +02:00
Itai Y. Efrat
2fdcefa831 feat(default): add +default/diagnostics
Unify flycheck-list-errors and flymake-show-diagnostics-buffer under
+default/diagnostics, and use consult-lsp-diagnostics if the lsp and
vertico modules are active.
2021-09-15 01:02:46 +03:00
Henrik Lissner
8e30579823 tweak(evil): reduce keybind conflicts between outline & org
This doesn't fix a particular issue, but makes designing keybinds for
org-mode more predictable and less vulnerable to unpredictable changes
imposed by evil-collection.
2021-09-13 17:29:12 +02:00
Itai Y. Efrat
2bfb8be383 fix(evil): use evil-collection for package-menu
I can't find a rationale for this in the git history, and from looking
through the evil-collection entry I can't think of one.
2021-09-11 18:48:40 +02:00
Henrik Lissner
6c52e33302 fix(evil): don't load help.el twice
a2a128d3 changed prefix-help-command to use embark. This commit fixes
prefix-help-command getting reset to describe-prefix-bindings due to
help.el setting it at top-level because it is eventually loaded twice
due to defer-feature!, which removes a symbol from emacs' list of loaded
features.

Ref a2a128d3a5
2021-08-05 21:24:01 -04:00
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
Wetlize
e12519d250 editor/evil: Add gr keybinding to refresh helpful buffers 2021-07-25 22:36:01 +03:00
Itai Y. Efrat
a0eb4e9b65 completion/selectrum -> completion/vertico, part 3
- Rename all functions and variables in the module to reflect the
  namechange (and the irc jump function)
2021-07-25 02:52:04 +03:00