Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emacs hangs during typing #219

Open
vog opened this issue Oct 2, 2019 · 6 comments
Open

Emacs hangs during typing #219

vog opened this issue Oct 2, 2019 · 6 comments

Comments

@vog
Copy link

vog commented Oct 2, 2019

When opening the first *.ml file in a fresh Emacs session in Tuareg mode, during typing code, Emacs suddenly hangs. The whole user interface blocks for many seconds, showing the following message in the Emacs status line:

Scanning module /usr/lib/ocaml//pervasives.mli

There are multiple issue I see here. First, why does it suddenly need to scan pervasives.mli and why does this take so long? Second, why does the whole user interface block, rather than doing this in the background? Third, why does it check the system's pervasives.mli even though I'm in a local OPAM switch? (i.e. subdirectory _opam exists)

@Chris00
Copy link
Member

Chris00 commented Oct 2, 2019

It is related to “autocomplete” (part of caml-mode and bound to C-c TAB in Tuareg). It should not be triggered unless you explicitly ask for it. For autocompletion, you should install Merlin.

@vog
Copy link
Author

vog commented Oct 3, 2019

Thanks for the insights. So please let me clarify the bug report:

First, this "autocomplete" mechanism is triggered by just typing code, without hitting C-c TAB or any other keyboard shortcut. Second, it is blocking. I believe both points are bugs, even though fixing one of them would already remove the pain.

What should I do to further analyze this bug? What modifications should I try? What information do you need?

@monnier
Copy link
Contributor

monnier commented Oct 3, 2019 via email

@vog
Copy link
Author

vog commented Oct 4, 2019

I see.

The "auto-complete" was innocent, but I had the "company" package installed and globally activated. That was the problem.

I turned "company" globally off, and the bug vanished. Thanks!

@vog vog closed this as completed Oct 4, 2019
@monnier
Copy link
Contributor

monnier commented Oct 4, 2019 via email

@vog
Copy link
Author

vog commented Oct 4, 2019

Ok. One more detail that is perhaps relevant: With disabled company-mode, an explicit C-c TAB makes the situation even worse: Not only pervasives.mli is scanned, but all other *.mli of stdlib as well, all blocking. I waited some time, but finally had to kill Emacs to be able to continue working. And this all happened with configured merlin and ocp-indent.

@vog vog reopened this Oct 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants