corfu and ESS: accessing list elements without having first to select list #451
Replies: 4 comments 5 replies
-
|
The more I think about it, the more I think the problem is due to |
Beta Was this translation helpful? Give feedback.
-
|
Hi, (defun mpger/cape-capf-ess ()
(dolist (elmnt
(mapcar #'cape-company-to-capf
(list #'company-R-library #'company-R-args #'company-R-objects)))
(add-to-list 'completion-at-point-functions elmnt))
(setq-local orderless-matching-styles '(orderless-literal))) ;; default is '(orderless-literal orderless-regexp)
(use-package cape
:hook
(ess-r-mode . mpger/cape-capf-ess))So, at the end of the day, to get the intended behavior I had to locally disable I guess that would be a substantial amount of work for a corner case, this is the reason I prefer to ask directly here instead of 'polluting' the issue tracker of |
Beta Was this translation helpful? Give feedback.
-
|
Max Pger ***@***.***> writes:
So, at the end of the day, to get the intended behavior I had to locally disable `orderless-regexp` matching style.
However, this is unfortunate because this is a pretty cool functionality of
`orderless`. @minad would it be worth to add a feature request to `orderless`,
like a custom variable allowing to exclude `$` from the metacharacters in order
to keep `orderless-regexp` as a matching style?
I don't think it would be worth it. But you can probably already achieve
your desired result with a custom Orderless matching style or style
dispatcher.
|
Beta Was this translation helpful? Give feedback.
-
|
Hey @maxecharel, I'm having some other issues with Corfu+ESS. You mentioned above that you used Are you just using Or are you using something like Thanks! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @minad,
I've tried
corfuwitheglot, works pretty well (amazing work, as always).I decided to give it a try with
ESS, which relies on CAPF + some Company-specific backends (so I also took that as an opportunity to trycape; also a really cool package).In R, dataframes are named lists, and their elements (i.e. features/columns/variables) can be accessed using the
$operator.In the example below, I consider
iris, a builtin dataset, but the result is the same if I assign it tofooorbar.With Company, I can type (in one shot)

iris$, and the popup will suggests the different elements it contains:However, I failed to have Corfu behaving the same way. If I type

iris$in one shot, Corfu will only suggest the corresponding object candidate, that is,iris. I then have to select it, and then use the$operator to have Corfu suggesting the different elements of the list:I tried to play with
corfu-preselect, but didn't succeed to get the desired behavior. Same when I tried to change the order the different backends were added tocompletion-at-point-functionsviacape-company-to-capf.Is there a way to make
corfubehave the waycompanydoes? Could my problem be due to the fact thatcorfutreats as$as the regex metacharacter?Thanks a lot for the great work!
Best,
M
Emacs 29.3
Corfu 20240409.438 (Melpa)
Cape 20240411.2207 (Melpa)
Beta Was this translation helpful? Give feedback.
All reactions