Commit graph

19166 commits

Author SHA1 Message Date
StrawberryTea
5ea9c00f30
refactor(corfu): unwrap add-hook from after! block
add-hook handles void variables so there is no need to wrap it in an
after! block. This also makes it easier for the user to remove the hook.
2024-03-01 12:33:11 -03:00
StrawberryTea
7daf8e4e15
fix(corfu): load minibuffer-setup-hook earlier
This way Corfu can be lazily-loaded by the minibuffer-setup-hook.
2024-03-01 12:33:11 -03:00
Luigi Sartor Piucco
70b2e345cc
bump: :completion corfu
minad/corfu@24dccafeea -> minad/corfu@b48d3017a4
minad/cape@18a30f48bb -> minad/cape@bfde79ed44
elken/yasnippet-capf@a0a6b1c2bb -> elken/yasnippet-capf@db12b55cd0
2024-03-01 12:33:10 -03:00
Luigi Sartor Piucco
70c327a4f1
feat(corfu): general move-to-minibuffer impl
We previously implemented only consult/vertico as a target for export,
now we have all of them. It was necessary to use case-by-case
conditions, unfortunately, because other UIs have subtle quirks that
prevent a single generalized approach to work.

Ivy is almost compliant, but it needs beg and end to not be markers.

Helm doesn't replace `completion-in-region-function`, it expects to go
around the default `completion--in-region`, so a small addition was made
to its module, because we weren't doing that. This was likely an
oversight due to the non-standard usage. This was fixed here because we
need it working for this feature.

Ido doesn't implement `completion-in-region` and its `completing-read`
is retricted to a list of strings as table, so it's treated the same as
absence of a framework, because it lacks the needed features.
2024-03-01 12:33:10 -03:00
Luigi Sartor Piucco
a5db530622
feat(corfu): impl smart confirm in minibuffer
An issue when using corfu in the minibuffer was the need for pressing
RET twice, since the first only inserts the completion. This commit
aliviates that by providing C-RET to ignore completion and conclude the
minibuffer imediately and S-RET to insert completion then conclude.
2024-03-01 12:33:10 -03:00
Luigi Sartor Piucco
14a3eaaa02
fix(corfu): move binds to :config default
Bindings were moved to the `:config default` module and some keys were
adjusted to match Company/other modules. The changes were documented in
the README.
2024-03-01 12:33:10 -03:00
Luigi Sartor Piucco
b3bd325000
feat(corfu,vertico): use equal orderless config
This removes the old `&` separator for Vertico (does anyone use that
instead of just space?) in favor of escapable space and unifies
orderless config with Corfu. Also implements smart separator
insert/escape/reset on `C-SPC`

Co-authored-by: Liam Hupfer <liam@hpfr.net>
2024-03-01 12:33:10 -03:00
StrawberryTea
b239de123c
feat(corfu): more CAPFs and ergonomy changes
Add various CAPFs from cape:
- `cape-dabbrev`;
- `cape-emoji`;
- `cape-dict`;
Fixed some CAPFs via cape:
- Make non-exclusive, purified and silent `pcomplete-completions-at-point`;
- Make non-exclusive and non-interruptable `lsp-completion-at-point`;
- Make non-exclusive `eglot-completion-at-point`;
- Make non-exclusive `comint-completion-at-point`;
Fix and improve keybindings:
- Smart `DEL`/`backspace` for `+tng`;
- Smart `RET`;
Add depth to CAPFs, allowing ordering to be adjustable.
Enable in minibuffer.
2024-03-01 12:33:10 -03:00
Luigi Sartor Piucco
a866bf82f6
feat(corfu): add snippets
Yasnippet is now properly integrated! A previosly-unset default has now
been given to `corfu-on-exact-match`. With snippets, it causes immediate
expansion upon single match by default, so we set it to nil and
recommend against changing it in the README.
2024-03-01 12:33:10 -03:00
Luigi Sartor Piucco
c6b7eb6e7c
module: add :completion corfu
This commit's primary goal is allowing use of
[minad/corfu](https://github.com/minad/corfu) as an alternative to
[company](https://github.com/company-mode/company-mode). It introduces a
module under :completion for this purpose, plus some conditionals on
other relevant modules to toggle functionality like lsp back-ends and
[minad/cape](https://github.com/minad/cape) capfs for certain modes.

Other optional or miscellaneous features include:

- Support for displaying the completion's documentation on a secondary
  popup;
- Support for terminal display if :os tty;
- Support for icons if +icons;
- Support for tab-and-go completion if +tng;
2024-03-01 12:33:09 -03:00
StrawberryTea
40518d932a feat(corfu): make minibuffer completion optional 2024-03-01 12:29:45 -03:00
StrawberryTea
1a3c973f33 feat(config): modify smart-ret in +tng minibuffer
If we are using +tng, we can make RET always exit the minibuffer. This
has the downside of not being able to insert snippets, but no one writes
snippets for the minibuffer anyway.
2024-03-01 12:29:45 -03:00
StrawberryTea
2223add382 fix(corfu): eval lambdas 2024-03-01 12:29:45 -03:00
StrawberryTea
a85b61dc0c fix(corfu): improve detection of comments
Due to https://github.com/minad/cape/pull/109, we cannot rely on only
faces to detect comments.
2024-03-01 12:29:45 -03:00
StrawberryTea
5627e7b50b fix(corfu): use :filter instead of :enable 2024-03-01 12:29:45 -03:00
StrawberryTea
fb985684e3 fix(corfu): complete after colon in lispy 2024-03-01 12:29:45 -03:00
StrawberryTea
dd65e57a3a fix(corfu): move orderless conf out of corfu block 2024-03-01 12:29:45 -03:00
StrawberryTea
bb7a8e3866 feat(config): add smart-ret for corfu
This commit makes RET in Corfu quit auto-completion and passthrough to
the underlying keymap if no completion is selected.
2024-03-01 12:29:45 -03:00
Henrik Lissner
b439300e6a
fix(everywhere): commandp error from C-c C-c
A temporary fix for an issue introduced upstream.

Ref: tecosaur/emacs-everywhere#75
2024-02-29 02:01:22 -05:00
Henrik Lissner
35dc13632b
bump: :lang rust
rust-lang/rust-mode@HEAD -> rust-lang/rust-mode@f74dd1cd87

- rust-lang/rust-mode@08cea61 introduced some clumsy autoloads that will
  cause treesit and rust-ts-mode (and more in later commits) to be
  eagerly loaded at startup. This causes other problems, but the primary
  issue is that it causes errors at startup or when installing
  rust-mode (#7698), which this bump addresses. Eager-loading will have
  to be addressed upstream.

Ref: rust-lang/rust-mode@08cea61390
Fix: #7698
2024-02-28 20:51:06 -05:00
25519fe95e dev: updating from latest 2024-02-25 10:17:52 -05:00
50b536b3aa dev: updating from latest 2024-02-25 10:17:20 -05:00
2ba206fc95 dev: merge branch 'pr7002' into emenel 2024-02-23 10:16:58 -05:00
76d3769dd6 dev: merge branch 'master'into pr7002 2024-02-23 10:16:27 -05:00
5b97fb9e19 dev: updating from latest 2024-02-21 11:17:17 -05:00
4b8eed8b09 dev: updating from latest 2024-02-21 11:16:59 -05:00
c93f45efb3 dev: updating from latest 2024-02-21 08:37:37 -05:00
0bd81aa284 dev: updating from latest 2024-02-21 08:37:20 -05:00
fa8ca3f898 dev: updating from latest 2024-02-20 19:53:34 -05:00
ea6a2a68b9 dev: updating from latest 2024-02-20 19:53:17 -05:00
7325a2dc42 dev: updating from latest 2024-02-20 19:00:42 -05:00
StrawberryTea
023c2ec72c fix: use window-buffer instead of current-buffer
This is because immediately after switching persps or using similar
commands, the current-buffer is not the buffer that is displayed in the
window.
2024-02-20 15:32:32 -06:00
StrawberryTea
345f7f575b doc(corfu): document +corfu-want-C-x-bindings 2024-02-20 07:50:24 -03:00
Henrik Lissner
98d753e103
fix: blank frame on can't-find-font error during startup
Due to our inhibit-redisplay hack, a missing font could lead to a blank
Emacs after startup. This change fixes that so that not only is an error
emitted when Emacs can't find your font, but the error will be a little
more readable.

This is a stopgap solution until I finish a better one I'm preparing for
v3.

Fix: #7055
2024-02-20 05:37:28 -05:00
Henrik Lissner
7a3773484b
fix(doom): remove neotree icon config
Since we've remove all-the-icons, doom-themes-neotree-config will no
longer work properly, so I disable it for now (not a complete solution
though; we still need proper nerd-icons support for neotree).

Fix: #7634
Ref: #7664
2024-02-20 05:04:26 -05:00
01878b82d2 dev: merge branch 'pr7002' into emenel 2024-02-19 14:42:51 -05:00
StrawberryTea
3cc4605943 fix(corfu): bind tng tab commands to insert state
These commands were being shadowed by the other Corfu commands
previously.
2024-02-19 16:29:22 -03:00
StrawberryTea
39b0de8736 feat(config): make C-x corfu bindings optional
For someone like me that uses the vanilla emacs commands bound to C-x
C-p, C-x C-n, etc, I prefer to set the completion keybindings manually.
2024-02-19 16:29:22 -03:00
StrawberryTea
3b275b271a fix(corfu): bind cape-dabbrev eagerly
Set up cape-dabbrev in completion-at-point-functions before dabbrev is
loaded.
2024-02-19 16:29:22 -03:00
StrawberryTea
b2c1b574e2 feat(corfu): update minibuffer hints manually
In the scenario where we exit the minibuffer using C-RET or S-RET, we
need this advice to ensure that visual hints are updated before exiting.
2024-02-19 16:29:22 -03:00
StrawberryTea
775749c4cf refactor(corfu): unwrap add-hook from after! block
add-hook handles void variables so there is no need to wrap it in an
after! block. This also makes it easier for the user to remove the hook.
2024-02-19 16:29:22 -03:00
StrawberryTea
86e5994003 fix(corfu): load minibuffer-setup-hook earlier
This way Corfu can be lazily-loaded by the minibuffer-setup-hook.
2024-02-19 16:29:22 -03:00
Jakob Fassunge
377e6245b6 fix: treemacs nerd icons 2024-02-19 17:26:55 +01:00
79772978bf dev: merge branch 'pr7002' into emenel 2024-02-18 16:13:26 -05:00
Luigi Sartor Piucco
2776fa2c4b
bump: :completion corfu
minad/corfu@24dccafeea -> minad/corfu@b48d3017a4
minad/cape@18a30f48bb -> minad/cape@bfde79ed44
elken/yasnippet-capf@a0a6b1c2bb -> elken/yasnippet-capf@db12b55cd0
2024-02-18 17:52:39 -03:00
Luigi Sartor Piucco
159f61a3a1
feat(corfu): general move-to-minibuffer impl
We previously implemented only consult/vertico as a target for export,
now we have all of them. It was necessary to use case-by-case
conditions, unfortunately, because other UIs have subtle quirks that
prevent a single generalized approach to work.

Ivy is almost compliant, but it needs beg and end to not be markers.

Helm doesn't replace `completion-in-region-function`, it expects to go
around the default `completion--in-region`, so a small addition was made
to its module, because we weren't doing that. This was likely an
oversight due to the non-standard usage. This was fixed here because we
need it working for this feature.

Ido doesn't implement `completion-in-region` and its `completing-read`
is retricted to a list of strings as table, so it's treated the same as
absence of a framework, because it lacks the needed features.
2024-02-18 17:52:39 -03:00
Luigi Sartor Piucco
a4c9c4cc44
feat(corfu): impl smart confirm in minibuffer
An issue when using corfu in the minibuffer was the need for pressing
RET twice, since the first only inserts the completion. This commit
aliviates that by providing C-RET to ignore completion and conclude the
minibuffer imediately and S-RET to insert completion then conclude.
2024-02-18 17:51:46 -03:00
Luigi Sartor Piucco
73090187d7
fix(corfu): move binds to :config default
Bindings were moved to the `:config default` module and some keys were
adjusted to match Company/other modules. The changes were documented in
the README.
2024-02-18 17:50:21 -03:00
17b109158d dev: merge branch 'pr7002' into emenel 2024-02-18 11:02:23 -05:00
Luigi Sartor Piucco
d6a4761625
bump: :completion corfu
minad/corfu@24dccafeea -> minad/corfu@b48d3017a4
minad/cape@18a30f48bb -> minad/cape@bfde79ed44
elken/yasnippet-capf@a0a6b1c2bb -> elken/yasnippet-capf@db12b55cd0
2024-02-17 20:42:29 -03:00