minad / corfu

:desert_island: corfu.el - COmpletion in Region FUnction
GNU General Public License v3.0
1.15k stars 43 forks source link

M-d (corfu-popupinfo-documentation) is active after completion #254

Closed dr-scsi closed 1 year ago

dr-scsi commented 2 years ago

Hi,

I'm trying the new corfu-popupinfo.el and have the issue that after a completion, M-d stays active in the buffer and replaces kill-word. I can place the point somewhere in the buffer and do C-h k M-d and get:

M-d runs the command corfu-popupinfo-documentation (found in corfu-popupinfo-map), which is an interactive native-compiled Lisp function in ‘corfu-popupinfo.el’.

It is bound to M-d.

(corfu-popupinfo-documentation)

Show or hide documentation in popup. Behaves like corfu-popupinfo-toggle.

My config is basically this:

(setq corfu-popupinfo-delay nil)
(global-corfu-mode)
(corfu-popupinfo-mode)

Sorry but I haven't found a reliable recipe (yet?) to reproduce this, but I get the behavior after restarting and/or hitting C-g. Any idea what's going wrong?

minad commented 2 years ago

Thanks for the report. Can you please check if corfu-popupinfo--teardown is executed correctly and in the correct buffer?

Check in particular if the modification to the key maps is undone:

https://github.com/minad/corfu/blob/4bd40f82f112f6ad510cd3f81afe2f0db4fa2fa0/extensions/corfu-popupinfo.el#L465-L467

dr-scsi commented 2 years ago

@minad - Thanks. I will try it and report back. I have to find a way to trigger the issue again.

ctrl2wei commented 1 year ago

I encountered the same problem when manually entering the characters of completion option.

emacs-version: 29.0.50 emacs-repository-version: 690f7ac86ad9a9d714b1107d05c5e856a43bb18d (pkg-info-version-info "corfu") -> "0.31" (setq corfu-popupinfo-delay nil)

Screencast from 2022-11-21 23-11-45.webm

minad commented 1 year ago

Unfortunately I am unable to reproduce the issue. In my setup (Emacs 28, Linux/X11), the minor-mode-overriding-map-alist is reset successfully after Corfu completion. Please let me know if you manage to reproduce the issue reliably. Then I can investigate further. Please use Emacs 28 and start from emacs -Q, with only global-corfu-mode and corfu-popupinfo-mode enabled.

dr-scsi commented 1 year ago

@minad - Thanks to @ctrl2wei for the recipe, I can reproduce this with Emacs 28.2 (My first report was with Emacs 29, both on Win10). Here is what I did:

It looks like this: corfu

I've also instrumented the function corfu-popupinfo--teardown; it seems to work Ok in both cases. So I suspect the issue lies somewhere else.

minad commented 1 year ago

I hope the issue is fixed now. Unfortunately corfu-popupinfo is still quite buggy. It will take a while until all the issues are sorted out.

dr-scsi commented 1 year ago

@minad - Yes, it seems to be fixed now, thanks. I think corfu-popupinfo is worth the effort. I keep using it and report back if new issues pop up. Thanks 👍