-
Notifications
You must be signed in to change notification settings - Fork 79
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
Comments
It is related to “autocomplete” (part of caml-mode and bound to |
Thanks for the insights. So please let me clarify the bug report: First, this "autocomplete" mechanism is triggered by just typing code, without hitting What should I do to further analyze this bug? What modifications should I try? What information do you need? |
First, this "autocomplete" mechanism is triggered by just typing code,
without hitting `C-c TAB` or any other keyboard shortcut.
I think `autocomplete` here refers to the Emacs package by that name.
In that case, indeed by design it kicks in just "as you type" without
having to trigger it explicitly. But it's not distributed with Emacs,
so you have to install & enable it manually before this happens.
|
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! |
The "auto-complete" was innocent, but I had the "company" package installed
and globally activated. That was the problem.
Indeed, `company` is another package offering the same kind of
functionality as `autocomplete`.
I turned "company" globally off, and the bug vanished. Thanks!
Good to know. This said, it would be good to make company-mode usable,
or at least not force you to turn it off globally.
My suspicion is that the following happens:
- company-mode uses its company-capf backend which lets it take
advantage of the completion-at-point-functions that the major-mode may
have set.
- tuareg adds tuareg-completion-at-point to completion-at-point-functions.
- tuareg-completion-at-point uses caml-mode's ocaml-module-symbols to
provide completion.
- probably ocaml-module-symbols (or ocaml-module-alist or
ocaml-visible-modules) is the long-running function.
When the completion is triggered explicitly by a call to
`completion-at-point`, this is probably good enough, but when
tuareg-completion-at-point is triggered by company-mode as a side-effect
of innocent typing this is not acceptable.
So while you've found a workaround, I think the problem still deserves
to have its own issue and we should try and fix it.
|
Ok. One more detail that is perhaps relevant: With disabled company-mode, an explicit |
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: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'spervasives.mli
even though I'm in a local OPAM switch? (i.e. subdirectory_opam
exists)The text was updated successfully, but these errors were encountered: