Closed prosoitos closed 1 year ago
Note: I suspect that the problem has to do with the dot. After dot, there is automatic completion, regardless of company settings.
company-jedi has a variable about auto-completion after dot that can be set to nil to prevent this behaviour. Maybe a similar variable could be added into elpy???
Thanks!!!
The issue here is around elpy.el:2809 where the package quite rudely overrules your preferences. Just a few lines before, it sets a hook to override your preference for company-minimum-prefix-length. IMO, packages shouldn't override your customizations like this.
To work around this behavior, you can patch elpy.el or, I assume, you can put a hook somewhere to reset these variables to your preferred values after elpy clobbers them.
Does running the company settings in elpy-mode-hook
help with this?
(add-hook 'elpy-mode-hook '(lambda () (setq company-idle-delay nil) (setq company-minimum-prefix-length 10))
Yep, that hook seems to work to restore the original values for me.
On Fri, Mar 10, 2023 at 9:51 AM Gopar @.***> wrote:
Does running the company settings in elpy-mode-hook help with this?
(add-hook 'elpy-mode-hook '(lambda () (setq company-idle-delay nil) (setq company-minimum-prefix-length 10))
— Reply to this email directly, view it on GitHub https://github.com/jorgenschaefer/elpy/issues/1958#issuecomment-1464006792, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACIURZBHU32LAH5QHDNJ63W3NEYTANCNFSM5L2N26UA . You are receiving this because you commented.Message ID: @.***>
Closing this as resolved, since settings can be put in elpy-mode-hook
Summary
I don't like company and eldoc popups to be triggered automatically. I much prefer triggering them manually with a kbd when I need them. This is how I have configured company and it works perfectly everywhere... except for elpy which seems to override my company settings.
My my config, I have:
The first one should be sufficient to stop company from auto-completing without being manually triggered (and it works well elsewhere). The 2nd one is thus not useful, but I am adding it here to show that elpy does not follow these settings.
Whenever I use a dot in a python-mode buffer, the company auto-completion popup pops up automatically, even if there is only one character (e.g.
t.
) and even if it shouldn't popup in the first place.So my questions are:
Of course, I could disable company in python-mode and that would solve those annoying popups when I don't want them. But then, of course, I wouldn't be able to trigger them with a kbd when I do want them.
Thanks!!!!
My configuration
OS
Arch Linux (5.15.13-arch1-1)
Result of
(elpy-config)
Elpy configuration in my init.el