Commit graph

826 commits

Author SHA1 Message Date
Henrik Lissner
9d7885abbf
fix(evil): q/Q keybinds in view-mode
Caused by evil-collection-view binding q to quit-window, which breaks
view-exit-action. This should be reported upstream.
2024-07-10 01:16:29 -04:00
Henrik Lissner
e43d575caf
refactor(lib): don't use smartparens' API
Toward our eventual goal of moving smartparens out of core, I've adapted
this from code provided by hpfr on Discord, which was adapted from
smartparen's syntax-ppss caching logic. `:config default` will need need
some attention before we can fully move smartparens to its own `:editor
smartparens` module.

Co-authored-by: hpfr <hpfr@users.noreply.github.com>
2024-07-09 20:55:29 -04:00
Eloise Christian
081231b73f fix(format): apheleia doesn't invoke lsp formatter
change `+format--lsp-fn` to run `+format--lsp-fn` in context of main
buffer rather than apheleia's scratch buffer so that the lsp mode can
be discovered
2024-07-08 21:41:39 -04:00
Henrik Lissner
dfe9d572a7
docs(format): hacks: mention save-buffer advice 2024-07-08 13:59:16 -04:00
Henrik Lissner
7d25ba3f6c
fix(format): void function +format-with-lsp-maybe-h error
Regression introduced in fd1941b.

Amend: fd1941b95f
2024-07-08 13:59:06 -04:00
Henrik Lissner
6b526b1b47
refactor(format): +format/org-block: make arg optional 2024-07-07 21:48:17 -04:00
Henrik Lissner
f104f10c5b
docs(format): revise README.org
To reflect recent changes and for clarity.
2024-07-07 21:48:17 -04:00
Henrik Lissner
fd1941b95f
refactor!(format): simplify & gate lsp/eglot impl behind +lsp
BREAKING CHANGE: This commit introduces two changes, a breaking, one
not.

The breaking change: `+format-with-lsp` used to control lsp-mode/eglot
integration for this module, but it is now gated behind a new +lsp flag.
Users will need to add it to their `doom!` blocks (in $DOOMDIR/init.el)
to restore the integration.

The other change: I've merged the former `lsp` and `eglot` formatters
into a single `lsp` formatter that dispatches to the appropriate
backend, as well as wrapping this integration in a
`+format-with-lsp-mode` minor mode, so it can be toggled at will; mainly
to assist in debugging formatter behavior.

A unified formatter makes it easier for folks to configure
`+format-with` on a per-project/directory/file basis, without needing to
know what backend this module uses, and opens us up to integrating other
LSP backends in the future (like lsp-bridge).
2024-07-07 21:43:27 -04:00
Henrik Lissner
cca40c0277
tweak(format): doom-debug-variables: add apheleia-log-debug-info 2024-07-07 21:43:27 -04:00
Henrik Lissner
d648bfda40
docs(format): revise docstrings and comments 2024-07-07 20:41:03 -04:00
Henrik Lissner
c5c7f0bc99
feat(format): add +format-inhibit alias
I want both `apheleia-formatter` and `apheleia-inhibit` exposed for easy
setting from directory/file-local variables (like .dir-locals.el), but
I'd like to abstract away the implementation (Apheleia) a little, hence
these aliases. This way, whether or not we're still using Apheleia in a
year or three, `+format-with` and `+format-inhibit` should always work.
2024-07-07 16:31:24 -04:00
Henrik Lissner
5e78ed0911
refactor(format): use eglot-server-capable
eglot--server-capable was deprecated.
2024-07-07 14:39:50 -04:00
Henrik Lissner
deb59ca4ad
fix(format): LSP formatters before Apheleia is loaded 2024-07-07 14:39:27 -04:00
Henrik Lissner
21a427c33b
fix(format): eglot-managed{,-mode}-hook hook 2024-07-06 21:18:34 -04:00
Henrik Lissner
17d4aaace3
fix(format): add lsp functions
Forgot to include these functions in 8072762. Oops.

Amend: 8072762de8
2024-07-06 21:03:12 -04:00
Henrik Lissner
8072762de8
refactor(format): redesign module
Rather than wrap Apheleia in custom formatting logic, I now use
Apheleia's own machinary to integrate into LSP and Eglot, which is less
complexity to maintain. It also makes settings +format-with a more
reliable option for per-project or per-file configuration.

This also adds a +format/org-src-block command, which I'll incorporate
into the org module in a follow-up commit.

Ref: #7685
2024-07-06 19:54:55 -04:00
Henrik Lissner
2bfb7821b6
refactor(evil): +evil--window-swap: no-op if on edge
Also error checks DIRECTION, just in case.
2024-07-05 20:10:57 -04:00
Henrik Lissner
39ee7129ef
refactor(evil): remove unneeded advice
This was resolved upstream.

Fix: #2493
Ref: emacs-evil/evil#1268
2024-06-30 22:20:39 -04:00
45mg
42ae401deb fix(fold): +fold/next: actually support outlines
The docstring says that this function will move to the next folded
outline heading, but this had not been implemented.
2024-06-27 18:07:33 -04:00
45mg
bff7baca69 fix(fold): fold-levels off-by-one
Without this change, we need to pass a prefix arg that is one more than
the actual fold-level we're trying to achieve; `C-u 2` is equivalent to
not passing a digit arg. While this looks intentional, I don't see what
purpose it serves.

This change provides saner behavior that matches other commands that
handle fold-levels (eg. `org-fold-hide-sublevels`).
2024-06-27 18:07:19 -04:00
45mg
56e998c577 fix(fold): properly handle recursive folds
With four folding systems in play, there are numerous ways to create
nested folds (eg. hideshow folds inside folded outline headings with
`+fold/close-all`). So `+fold/open-rec' needs to be able to open all
kinds of folds within the newly unfolded region. It can't stop at
unfolding the type of fold it was called on.
2024-06-26 20:45:14 -04:00
45mg
c471ab00a6 fix(fold): don't expect evil-vimish-fold
This module is also used by non-Evil users. Also,
`evil-vimish-fold/next-fold` and friends just wrap the corresponding
vimish-fold functions in `dotimes`, anyway.
2024-06-26 20:45:00 -04:00
Henrik Lissner
cc7a509e10
bump: :editor fold
emacs-tree-sitter/ts-fold@6ce584d1ac -> emacs-tree-sitter/ts-fold@5b8abb69cd
2024-06-25 19:36:51 -04:00
Henrik Lissner
7ce9a99583
fix(fold): only enable ts-fold-mode in tree-sitter buffers
ts-fold-mode is buffer-local, and will complain if activated in a buffer
tree-sitter doesn't support (e.g. fundamental-mode). global-ts-fold-mode
will filter based on tree-sitter-mode's activation and language support.

Fix: #7895
2024-06-25 19:36:51 -04:00
Henrik Lissner
c48a5e5f9c
fix(god): cursor color change
If the cursor's color changed from A to B, it didn't change back.

Close: #7841
Amend: #7049
Co-authored-by: darth10 <darth10@users.noreply.github.com>
2024-06-23 15:56:17 -04:00
Henrik Lissner
a3a0629e03
bump: :editor
doomemacs/snippets@c1384cc797 -> doomemacs/snippets@3a0b029c5d
emacs-evil/evil-collection@ca977acb83 -> emacs-evil/evil-collection@acb056b1d0
emacs-evil/evil@0251080640 -> emacs-evil/evil@0ad84c5216
emacs-straight/adaptive-wrap@70005d2012 -> emacs-straight/adaptive-wrap@a3b179ea21
emacs-tree-sitter/ts-fold@0627723e5f -> emacs-tree-sitter/ts-fold@6ce584d1ac
emacsmirror/visual-fill-column@5e74afe39d -> emacsmirror/visual-fill-column@e04d3521b6
joaotavora/yasnippet@297546f085 -> joaotavora/yasnippet@eb5ba2664c
juliapath/evil-numbers@7a1b62afc1 -> juliapath/evil-numbers@c789989451
justinbarclay/parinfer-rust-mode@e9a23e136b -> justinbarclay/parinfer-rust-mode@a96c768e9d
magnars/multiple-cursors.el@234806c832 -> magnars/multiple-cursors.el@c870c18462
radian-software/apheleia@96a9805ecb -> radian-software/apheleia@61766b50b2
2024-06-22 18:14:05 -04:00
Henrik Lissner
b405225b90
refactor!(vc-gutter): drop git-gutter for diff-hl
BREAKING CHANGE: This removes git-gutter as an implementation for the
`:ui vc-gutter` module, leaving only the diff-hl implementation. There
are no longer any +git-gutter or +diff-hl flags for this module. Users
don't have to do anything to keep the vc gutter, unless they prefer
git-gutter for any reason (in which case they'll need to install and set
it up themselves).

This has been planned for some time, because of a roadmap goal for Doom
to lean into native/built-in functionality where it's equal or better
than the third party alternatives. diff-hl relies on the built-in vc.el
library instead of talking to git directly (thus expanding support to
whatever VCS's vc.el supports, and not git alone), which also means it
can take advantage of its caching and other user configuration for
vc.el. Overall, it is faster and lighter.

What I've also been waiting for was a stage-hunk command, similar to
git-gutter:stage-hunk, which arrived in dgutov/diff-hl@a0560551cd and
dgutov/diff-hl@133538973b, and have evolved since.

Ref: dgutov/diff-hl@a0560551cd
Ref: dgutov/diff-hl@133538973b
Ref: https://github.com/orgs/doomemacs/projects/5/views/1?pane=issue&itemId=58747789
2024-06-22 18:14:04 -04:00
Hyunggyu Jang
6479fc7132 fix(word-wrap): choose first element if indent-var is list 2024-06-19 22:25:34 -04:00
Henrik Lissner
7c20ef2619
bump: :editor parinfer
justinbarclay/parinfer-rust-mode@8df117a3b5 -> justinbarclay/parinfer-rust-mode@e9a23e136b

Close: #7876
Co-authored-by: welcome-linja <welcome-linja@users.noreply.github.com>
2024-06-03 16:22:10 -04:00
Henrik Lissner
9620bb45ac
fix(evil): ]f/[f opening broken symlinks 2024-04-18 14:20:48 -04:00
Henrik Lissner
968974663d
bump: :editor snippets
doomemacs/snippets@07b3bdaf60 -> doomemacs/snippets@c1384cc797
joaotavora/yasnippet@33587a8551 -> joaotavora/yasnippet@eb5ba2664c

- Recently, yasnippet start complaining about snippets with the same
  name (particularly y-or-n-p and x-file). I've removed/renamed the
  offending snippets in doomemacs/snippets.

Ref: doomemacs/snippets@41417b4398
Ref: doomemacs/snippets@d0a96a37d4
2024-04-07 16:08:40 -04:00
Henrik Lissner
a3de6ad04f
bump: :editor evil
emacs-evil/evil-collection@e0982fcbb6 -> emacs-evil/evil-collection@ca977acb83
emacs-evil/evil@88d073c9d0 -> emacs-evil/evil@0251080640

- Fixes #7798: corfu completion in minibuffer for Evil users (thanks to
  emacs-evil/evil-collection#801).

Fix: #7798
Ref: emacs-evil/evil-collection#801
2024-04-06 12:35:00 -04:00
Henrik Lissner
34a9c3d0b3
bump: :editor snippets
doomemacs/snippets@f022984ee1 -> doomemacs/snippets@07b3bdaf60
joaotavora/yasnippet@297546f085 -> joaotavora/yasnippet@33587a8551
2024-04-02 20:10:16 -04:00
Henrik Lissner
13b60b9702
bump: :editor evil
emacs-evil/evil-collection@8c84f9bc89 -> emacs-evil/evil-collection@e0982fcbb6
emacs-evil/evil-surround@c7116cdc77 -> emacs-evil/evil-surround@da05c60b06
emacs-evil/evil@5995f6f21f -> emacs-evil/evil@88d073c9d0
redguardtoo/evil-nerd-commenter@3b197a2b55 -> redguardtoo/evil-nerd-commenter@ae52c5070a
wcsmith/evil-args@2671071a4a -> wcsmith/evil-args@a8151556f6
2024-04-02 20:08:07 -04:00
45mm
142f28eb9a fix(fold): properly support outline-minor-mode
- Make `+fold/close-all` work for outline-minor-mode.

- Distinguish between `zo` and `zO` for outline-minor-mode alone, by
  binding `zO` to a new function `+fold/open-rec`. `zO` will now trigger
  `outline-show-subtree` in outline-minor-mode, while `zo` will only
  trigger `outline-show-branches`, keeping the subheadings folded. This
  matches the behavior in org-mode.

- Fix a bug in `+fold/open-all`, introduced in
  7b9d00d661, that makes it only operate
  on vimish-fold folds.

Note that outline-minor-mode is still not enabled by default anywhere.
These changes are only to prevent incorrect behavior for users who
decide to turn it on themselves.
2024-04-01 13:30:43 -04:00
Ian McCowan
c564c17a6b fix(fold): reorder fold type checks
(+fold--ts-fold-p) just checks that the mode is active so it will block
any checks following it. Move it to the end so other fold types have a
chance, and consistently order fold type checks.
2024-03-19 23:57:15 -04:00
Henrik Lissner
5cc4056abf
fix(format): +format-with-eglot-fn: eglot detection 2024-03-13 01:00:38 -04:00
Henrik Lissner
198fe82b6d
feat(lib): backport find-sibling-file
I will slowly phase out projectile in favor of project.el, starting with
projectile-find-other-file, which -- as of Emacs 29 -- has a native
alternative: `find-sibling-file`.

Ref: doomemacs/community#1
2024-03-11 00:53:44 -04:00
Henrik Lissner
179e300bfd
bump: visual-fill-column
https://codeberg.org/joostkremers/visual-fill-column@db7c7c236555 -> emacsmirror/visual-fill-column@5e74afe39d

codeberg has uptime issues. Where possible, we should prefer Github
sources.

Fix: #7013
2024-03-04 03:26:07 -05:00
Henrik Lissner
5c7149da67
docs(format): +format-in-org-src-blocks-fn: add docstring 2024-02-17 07:13:39 -05:00
Henrik Lissner
1e8fd09120
fix(format): +format-in-org-src-blocks-fn
Didn't return non-nil, so whether or not it worked, Apheleia would
attempt to (ineffectually) format the org buffer afterwards.

Also remove unneeded beg/end checks (the functions always receive a
value).
2024-02-17 07:13:39 -05:00
Henrik Lissner
9ba6d7191c
refactor(format): improve lsp/eglot formatter dispatchers 2024-02-14 18:12:22 -05:00
Henrik Lissner
e9ea3cc591
feat(format): add eglot support
Fix: #7673
2024-02-14 18:12:22 -05:00
Henrik Lissner
20de3d0f29
refactor(format): introduce +format-functions 2024-02-14 18:12:22 -05:00
Benjamin Schwehn
4db347769e
fix(file-templates): unknown directive error from __license-lgpl3
The misspelling produces a 'Ignoring unknown directive "contribuer"'
error, which was introduced in joaotavora/yasnippet@25f5d88.

Ref: joaotavora/yasnippet@25f5d8808a
2024-02-08 23:11:48 -05:00
Henrik Lissner
e701522d68
bump: :editor
doomemacs/snippets@d490cba6d7 -> doomemacs/snippets@f022984ee1
emacs-straight/adaptive-wrap@fc9f0306f1 -> emacs-straight/adaptive-wrap@70005d2012
emacs-tree-sitter/ts-fold@75e72c658a -> emacs-tree-sitter/ts-fold@0627723e5f
joaotavora/yasnippet@5cbdbf0d20 -> joaotavora/yasnippet@297546f085
joostkremers/visual-fill-column@695a597892 -> joostkremers/visual-fill-column@db7c7c2365
justinbarclay/parinfer-rust-mode@6e6bdeeba3 -> justinbarclay/parinfer-rust-mode@8df117a3b5
raxod502/apheleia@56651724ad -> raxod502/apheleia@96a9805ecb
2024-02-04 19:18:24 -05:00
Henrik Lissner
151b67baf2
bump: :editor evil
TheBB/evil-indent-plus@b4dacbfdb5 -> TheBB/evil-indent-plus@f392696e48
emacs-evil/evil-collection@8be4b75c86 -> emacs-evil/evil-collection@8c84f9bc89
emacs-evil/evil-surround@8fad8540c4 -> emacs-evil/evil-surround@c7116cdc77
emacs-evil/evil@5fc16776c5 -> emacs-evil/evil@5995f6f21f
2024-02-04 19:17:18 -05:00
Henrik Lissner
659f7bfc71
refactor!: deprecate IS-* OS constants
BREAKING CHANGE: This deprecates the IS-(MAC|WINDOWS|LINUX|BSD) family
of global constants in favor of a native `featurep` check:

  IS-MAC      ->  (featurep :system 'macos)
  IS-WINDOWS  ->  (featurep :system 'windows)
  IS-LINUX    ->  (featurep :system 'linux)
  IS-BSD      ->  (featurep :system 'bsd)

The constants will stick around until the v3 release so folks can still
use it -- and there are still some modules that use it, but I'll phase
those uses out gradually.

Fix: #7479
2024-02-04 17:54:29 -05:00
RBckmnn
d509d8bea1
fix(file-templates): invalid function call
`evil-initialize-state` recently changed to no longer accept any
arguments, so use `evil-change-state` instead.

Ref: emacs-evil/evil@1c4c3bfff8
2024-02-01 02:38:34 -05:00
Henrik Lissner
b1d8d1cd9f
nit: reformatting, comment, and markup revision 2023-12-02 11:34:10 -05:00