Commit graph

1065 commits

Author SHA1 Message Date
StrawberryTea
c62aa84709
docs(corfu): debugging cape-dabbrev 2024-05-21 17:17:00 +02:00
Sean Farley
8451587ab0
refactor(corfu): consolidate +orderless logic without vertico
This tidy ups the corfu module to use the logic when a user enables
corfu +orderless without enabling vertico. Since that's probably a niche
situation, we only specify commit to pin to orderless in the vertico
module so that contributors aren't tripped up with trying to remember to
update orderless in two different code locations. Of course, if this
turns out to be a more popular use-case we can re-evaluate this logic.
2024-05-21 17:17:00 +02:00
Sean Farley
d7b70ddca4
nit(vertico): fix spelling in some docstrings 2024-05-21 17:17:00 +02:00
Sean Farley
1abcb71571
feat(vertico): add orderless annotation filtering
Ref: oantolin/orderless#162
2024-05-21 17:17:00 +02:00
Henrik Lissner
baeb7838f6
fix(vertico): consult-dir: don't guess user from containers
The tramp string used to connect to the container uses the first
`container-runtime ps` argument as a username, but the first argument
returned is the container ID, not a username.

Close: #7674
Co-authored-by: bergmannf <bergmannf@users.noreply.github.com>
Co-authored-by: elken <elken@users.noreply.github.com>
2024-05-21 17:16:59 +02:00
Henrik Lissner
07310dc9e2
feat(vertico): add consult-yasnippet
Close: #7471
Co-authored-by: LemonBreezes <LemonBreezes@users.noreply.github.com>
2024-05-21 17:16:59 +02:00
Henrik Lissner
ef3d30a9a2
refactor(corfu): remove redundant setting
Upstream, corfu-preview-current is already 'insert by default.
2024-05-21 17:16:59 +02:00
Henrik Lissner
2de1306da0
fix(corfu): wrong-type-argument characterp error
Corfu doesn't support a nil corfu-separator in general, but
+corfu-smart-sep-toggle-escape, specifically, will throw a characterp
type error if the user hasn't enabled +orderless.
2024-05-21 17:16:59 +02:00
Henrik Lissner
0b21a8252e
fix(corfu): ispell: only complain once per session 2024-05-21 17:16:58 +02:00
Henrik Lissner
122dd93e5b
fix(corfu): gate corfu-terminal config
If :completion corfu users don't have :os tty enabled, loading
corfu-terminal will throw an error in TTY Emacs.
2024-05-21 17:16:58 +02:00
Henrik Lissner
c98848e599
bump: :completion vertico
minad/consult-flycheck@d83f87581a -> minad/consult-flycheck@754f5497d8
minad/consult@9463146ba7 -> minad/consult@b48ff6bf05
minad/marginalia@ea356ebb1d -> minad/marginalia@f6fe86b989
minad/vertico@4a7da56b02 -> minad/vertico@68cbd47589
oantolin/embark@60139db879 -> oantolin/embark@c93abadc82
oantolin/orderless@b24748093b -> oantolin/orderless@dc7a781acf
2024-05-21 17:16:58 +02:00
Luigi Sartor Piucco
d2d22e024c
docs(corfu): add @LemonBreezes as co-maintainer
Co-authored-by: StrawberryTea <look@strawberrytea.xyz>
2024-05-21 17:16:58 +02:00
StrawberryTea
e574d2d711
feat(corfu): update minibuffer hints manually
We need this advice to ensure that visual hints are updated before
exiting.
2024-05-21 17:16:58 +02:00
StrawberryTea
2088c6fc27
feat(corfu): make minibuffer completion optional 2024-05-21 17:16:58 +02:00
Luigi Sartor Piucco
d44d8d94ea
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`. It's supposed to add the
advice by itself, but it's very unreliable, so we do the wrapping
manually.

Ido doesn't implement `completion-in-region` and its `completing-read`
is retricted to a list of strings as table, so we use default
`completion--in-region` with no bells or whistles.
2024-05-21 17:16:57 +02:00
Luigi Sartor Piucco
ae4ce38779
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-05-21 17:16:57 +02:00
StrawberryTea
ca68e0cdee
feat(corfu): more CAPFs and ergonomy changes
Add CAPFs from cape:
- `cape-dabbrev`;
- `cape-elisp-block`;
- `cape-file`;
Fix 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`;
Add depth to CAPFs, allowing ordering to be adjustable.
2024-05-21 17:16:57 +02:00
Luigi Sartor Piucco
a980695939
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-05-21 17:16:57 +02:00
Luigi Sartor Piucco
1b6e77c664
module: add :completion corfu
This commit's primary goal is allowing use of
[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
[Cape](https://github.com/minad/cape) capfs for certain modes.

Other optional or miscellaneous features include:

- Corfu is enabled in the minibuffer if `completion-at-point` is bound;
- Support for displaying the completion's documentation on a secondary
  popup;
- Support for terminal display if :os tty;
- Support for icons if +icons;
2024-05-21 17:16:57 +02:00
Dev380
651313a09b
fix(vertico): disable minor mode highlight duly
Minor mode highlights did not disable as long
as the mode was enabled.

Amend: #7706
2024-05-21 17:16:51 +02:00
Dev380
bd9bf18d73
feat(vertico): completion highlights a la ivy
* feat(vertico): completion highlights a la ivy

Adds completion highlighting that works similarly to ivy/counsel's
one (which is enabled by default). It'll highlight enabled major/minor
modes and directories in a different face. On by default.

Ref: https://github.com/minad/vertico/wiki#candidate-display-transformations-custom-candidate-highlighting

* fix(vertico): major mode not being highlighted

The major mode was not being highlighted correctly;
it should work now that the buffer is set correctly in
`+vertico-highlight-enabled-mode`.

* fix(vertico): make font lock prioritize match over type

The mode and directory highlights were [overriding the match
font-lock](https://github.com/doomemacs/doomemacs/pull/7706#issuecomment-1977722188).
This should resolve that by prioritizing the match font lock using
`'append` on `add-face-text-property` instead of `propertize`.
2024-05-21 17:16:50 +02:00
45mm
419f49e158
fix(vertico): mapping for embark open in workspace
We should always bind to both "TAB" and "<tab>" - if they have been
mapped to different commands anywhere, Emacs will no longer treat them
as equivalent.
2024-05-21 17:16:50 +02:00
Henrik Lissner
3ccc70adc6
fix(vertico): use remote fd in tramp buffers 2024-05-21 17:16:45 +02:00
Henrik Lissner
5767296cbc
bump: :completion
DarwinAwardWinner/ido-completing-read-plus@49e7967ea8 -> DarwinAwardWinner/ido-completing-read-plus@5995b4605b
company-mode/company-mode@ed46a616ab -> company-mode/company-mode@02903bd708
emacs-helm/helm@96aad023cb -> emacs-helm/helm@f34ea6b702
lewang/flx@7b44a5abb2 -> lewang/flx@4b1346eb9a
mhayashi1120/Emacs-wgrep@3132abd375 -> mhayashi1120/Emacs-wgrep@208b9d01cf
minad/consult@e4d3712356 -> minad/consult@9463146ba7
minad/vertico@cf8b2abf52 -> minad/vertico@4a7da56b02
oantolin/embark@33c392cf3c -> oantolin/embark@60139db879
radian-software/prescient.el@707c25c947 -> radian-software/prescient.el@4b875be52e
tumashu/vertico-posframe@bc0e67cbbb -> tumashu/vertico-posframe@2e0e09e5bb
2024-05-21 17:16:40 +02:00
Henrik Lissner
ddd3f7564d
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-05-21 17:16:36 +02:00
45mm
50fc35a934
docs(ivy): mention lowered ivy-sort-max-size
Depending on the system, this can cause sorting to be disabled long
before the performance hit would be felt, and it's not obvious that this
is the reason.
2024-05-21 17:16:35 +02:00
Itai Y. Efrat
d15ded9ba2
bump: :completion vertico
mhayashi1120/Emacs-wgrep@3132abd375 -> mhayashi1120/Emacs-wgrep@208b9d01cf
minad/consult-flycheck@0662839aa5 -> minad/consult-flycheck@d83f87581a
minad/consult@9c7dbbe4d6 -> minad/consult@e4d3712356
minad/marginalia@27ccfd2213 -> minad/marginalia@ea356ebb1d
minad/vertico@e8edac107d -> minad/vertico@cf8b2abf52
oantolin/embark@b9f2b3b9a5 -> oantolin/embark@33c392cf3c
tumashu/vertico-posframe@15168c92ca -> tumashu/vertico-posframe@bc0e67cbbb
2024-05-21 17:16:33 +02:00
Itai Y. Efrat
23615178a3
fix(vertico): use consult-fd only with new enough fd 2024-05-21 17:16:33 +02:00
Itai Y. Efrat
307c938266
bump: :completion vertico
minad/consult@43380042da -> minad/consult@9c7dbbe4d6
minad/marginalia@f1734375a5 -> minad/marginalia@27ccfd2213
minad/vertico@03bfb71a2b -> minad/vertico@e8edac107d
oantolin/embark@7758a1ac64 -> oantolin/embark@b9f2b3b9a5
oantolin/orderless@d6b402a89e -> oantolin/orderless@b24748093b
tumashu/vertico-posframe@db9fbc95bb -> tumashu/vertico-posframe@15168c92ca
2024-05-21 17:16:33 +02:00
Liam Hupfer
0521be9ae1
tweak(vertico): show entire path for fd results
Currently, fd does not expose a way to match against only the path
components beneath the target path. When --full-path is specified, the
pattern matches against all components. For example, executing
consult-fd from /home/hlissner/.emacs.d with `home` as the query would
match every file (not excluded by other arguments) under .emacs.d.
Despite this --full-path behavior, fd still outputs relative paths, so
the user cannot even determine why some candidates are returned.

Until there is a method to match only against subdirectories, use
--absolute-path to at least to show the user why all matches are
occurring.

Ref: https://github.com/sharkdp/fd/issues/839
2024-05-21 17:16:33 +02:00
Liam Hupfer
aede21fe47
nit(vertico): remove default --regex option for fd
Ref: eac20a8132
2024-05-21 17:16:33 +02:00
Liam Hupfer
7e273c9433
tweak(vertico): use fd’s smart case
If the user is going to the trouble of capitalizing input, that’s
probably all they want to match.

Ref: 6482f3ac09
2024-05-21 17:16:33 +02:00
Itai Y. Efrat
f307e0b86e
fix(vertico): consult-project(-root->)-function 2024-05-21 17:16:32 +02:00
Itai Y. Efrat
d8c99415ac
refactor(vertico): use consult-fd
Close: #7458
Co-authored-by: LemonBreezes <look@strawberrytea.xyz>
2024-05-21 17:16:32 +02:00
Itai Y. Efrat
ce73061e00
bump: :completion vertico
karthink/consult-dir@ed8f0874d2 -> karthink/consult-dir@3f5f4b71eb
minad/consult@fe49dedd71 -> minad/consult@43380042da
minad/marginalia@866e50aee4 -> minad/marginalia@f1734375a5
minad/vertico@a28370d07f -> minad/vertico@03bfb71a2b
oantolin/embark@9a44418c34 -> oantolin/embark@7758a1ac64
oantolin/orderless@e678402671 -> oantolin/orderless@d6b402a89e
tumashu/vertico-posframe@7da6d648ff -> tumashu/vertico-posframe@db9fbc95bb
2024-05-21 17:16:32 +02:00
45mm
6f22b273e9
fix(vertico): don't shell-quote consult-ripgrep-args
We were using `shell-quote-argument`, which is meant for passing file
names, strings and so on, not command-line arguments. For example,
`(shell-quote-argument "--foo=bar")` yields "--foo\\=bar", which is
obviiously invalid unless we're trying to pass an option named '--foo\'.

At any rate, there is no quoting/escaping for shells in the default
value of `consult-ripgrep-args`, so it doesn't look like this is
something we need to do.
2024-05-21 17:16:32 +02:00
45mm
b4f530eeb4
docs(vertico): mention :args option in docstring 2024-05-21 17:16:31 +02:00
Kalle Lindqvist
965da03ba5
fix(vertico): embark open in new workspace action 2024-05-21 17:16:29 +02:00
Henrik Lissner
68b274cfb2
bump: :completion company helm ivy
Sodel-the-Vociferous/helm-company@6eb5c2d730 -> Sodel-the-Vociferous/helm-company@4622b82353
abo-abo/swiper@9d630d800e -> abo-abo/swiper@8c30f4cab5
bbatsov/helm-projectile@35a2111d00 -> bbatsov/helm-projectile@e2e38825c9
company-mode/company-mode@9b21604d19 -> company-mode/company-mode@ed46a616ab
emacs-helm/helm-org@d67186d3a6 -> emacs-helm/helm-org@c80e53315c
emacs-helm/helm@dfd6403947 -> emacs-helm/helm@96aad023cb
emacs-jp/helm-c-yasnippet@e214eec8b2 -> emacs-jp/helm-c-yasnippet@c5880e740d
radian-software/prescient.el@d7cc55dad4 -> radian-software/prescient.el@707c25c947
tumashu/helm-posframe@87461b52b6 -> tumashu/helm-posframe@0b6bb016f0
yyoncho/helm-icons@53349000b1 -> yyoncho/helm-icons@0d113719ee
2024-05-21 17:16:27 +02:00
Maoli
f271b58361
bump: :completion company
sebastiencs/company-box@766546b266 -> sebastiencs/company-box@b6f53e26ad
company-mode/company-mode@2ca3e29abf -> company-mode/company-mode@9b21604d19

Fix: doomemacs/doomemacs#6710
2024-05-21 17:16:24 +02:00
Liam Hupfer
0efca9afd4
fix(vertico): ensure recentf-mode for consult-buffer
`consult-buffer` uses `recentf` to populate file candidates. It is not
uncommon to use `consult-buffer` as a single entry point to buffers,
bookmarks and recent files, effectively replacing `recentf` and
`consult-recent-file`.

To improve startup performance, Doom enables `recentf-mode` after the
first file is opened (0e851ace9b). When executing `consult-buffer` at
startup, `recentf-mode` won’t be enabled yet. Add it to the
`consult-recent-file` advice to ensure that can’t happen.

Unlike `consult-recent-file`, `consult-buffer` does have significant
functionality without `recentf-mode`, but for the tiny fraction of Doom
users that disable `recentf-mode`, this is easy enough to
`advice-remove`.

Fix: https://github.com/doomemacs/doomemacs/issues/7461
2024-05-21 17:16:17 +02:00
Henrik Lissner
4fa9362224
docs(*): replace all-the-icons with nerd-icons
Also colorizes the leading icon in notices.
2024-05-21 17:16:13 +02:00
Henrik Lissner
415fac6a32
fix(ivy): void-function nerd-icons-ivy-rich-mode error
Amend: 9787022b839d
2024-05-21 17:15:57 +02:00
Henrik Lissner
587dca9020
docs(helm,ivy,vertico,ido): add incompatibility checks
These modules tend to conflict if more than one of them are enabled at
once. More systematic compatibility tests are in the works, but for now
this will do.
2024-05-21 17:15:56 +02:00
Ellis Kenyő
cb016f2dba
refactor!: replace all-the-icons with nerd-icons
BREAKING CHANGE: This commit replaces all-the-icons with nerd-fonts. Any
all-the-icons-* function calls or variable references in your private
config will break and should be replaced with their nerd-icons-*
equivalent. That said, Doom will continue to install all-the-icons for
a while, so feel free to load it if you don't want to fully commit to
the change yet.

This change is happening because nerd-icon has wider support for GUI and
TUI Emacs; has a larger, more consistent selection of symbols; plus unicode
coverage.

Fix: #7368
Close: #6675
Close: #7364
2024-05-21 17:15:56 +02:00
Henrik Lissner
5e6d9a2266
tweak: scroll-conservatively = 10
Forces the window to recenter if the cursor moves >=10 lines off-screen.
This makes some of our manual recentering elsewhere unnecessary.
2024-05-21 17:15:53 +02:00
Ellis Kenyő
dc9e7bec9e
refactor(vertico): consult-dir: drop dependence on docker-tramp
Removes the dependence on docker-tramp, can later be cleaned up with
`tramp-container--completion-function` when we drop support for <29.
2024-05-21 17:15:51 +02:00
Liam Hupfer
b29758300a
fix(vertico): gate which-key integration
This prevents an error for users disabling which-key.
2024-05-21 17:15:49 +02:00
Jeetaditya Chatterjee
0aa3760fdf
tweak(syntax): feat gate flycheck in all modules 2024-05-21 17:15:44 +02:00
Henrik Lissner
a82163cb99
bump: :completion ivy
DarwinAwardWinner/amx@37f9c7ae55 -> DarwinAwardWinner/amx@5b3aa1aae8
Yevgnen/ivy-rich@600b8183ed -> Yevgnen/ivy-rich@aff9b6bd53
abo-abo/swiper@b8be4913a6 -> abo-abo/swiper@9d630d800e
mhayashi1120/Emacs-wgrep@edf768732a -> mhayashi1120/Emacs-wgrep@3132abd375
radian-software/prescient.el@35cf5d3613 -> radian-software/prescient.el@d7cc55dad4

Close: #7173
Co-authored-by: notevenaperson <notevenaperson@users.noreply.github.com>
2023-07-22 17:57:25 +02:00