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

elpy -> company-mode -> tramp interaction #985

Closed
kordosky opened this issue May 23, 2020 · 8 comments
Closed

elpy -> company-mode -> tramp interaction #985

kordosky opened this issue May 23, 2020 · 8 comments

Comments

@kordosky
Copy link

While coding in emacs with elpy enabled I've found that I get a freeze of a few minutes after typing

os.chdir("/ho

I'm just trying to change to my home directory. After the third character emacs freezes. It is not sensitive to ctrl-G. This happens the first time in an emacs session. It also happens with other function calls (e.x. os.stat()). The /xx also does not have to be the start of a valid path.

What appears to be happening is that elpy is using company to complete the text string. Company seems to interpret the /xx as something tramp should try to handle and passes it to tramp. Tramp ends up calling ssh. The most relevant part of the backtrace seems to be:

Selection_077

Sorry for the image. There are some unicode characters in the text that screw up markdown.

My questions are: (1) Is if this is the desired behavior from the standpoint of company-mode? (2) Is there something about the way elpy is using company-mode that could be at issue? (3) Can anyone duplicate the issue? Perhaps it has to do with my tramp or ssh setups (both are pretty unremarkable). Duplication is simple:

`
import os
os.chdir("/xx

`

@kordosky
Copy link
Author

Sorry, left off the versions:
Company 0.9.12
Elpy 1.33.0
Tramp 2.2.11-24.5
Emacs 24.5.1

@dgutov
Copy link
Member

dgutov commented May 23, 2020

What if you try to reproduce it without company?

M-x eshell, type cd /ho, abort company popup if it comes up, then press C-M-i.

@dgutov
Copy link
Member

dgutov commented May 23, 2020

Emacs 24.5.1

In any case, though, you might want to try a newer Emacs first. This version is 5 years old.

@kordosky
Copy link
Author

Thanks,
I tried "M-x eshell cd /ho"
it didn't freeze (I could step back a character) and then C-M-i produced "cd use-package-/:hook"

@dgutov
Copy link
Member

dgutov commented May 23, 2020

Hmm, what if you do this instead?

  • C-x C-f
  • Input /ho
  • Press TAB

All of the above with the default completion engine, preferably. No Ido/Ivy/Helm/etc.

@kordosky
Copy link
Author

Emacs 26 doesn't have the error, but I think it's only because elpy throws errors on initialization and doesn't run correctly. I don't get any command completion. The errors are:
'
Error (use-package): elpy/:init: Symbol’s value as variable is void: xref-location-marker
Error (use-package): elpy/:catch: Symbol’s value as variable is void: xref-location-marker
'
Also, when I "list-packages" and click on elpy it states emacs-24.4 as a dependency.

@dgutov
Copy link
Member

dgutov commented May 24, 2020

Something to report, maybe? But it shouldn't be hard to fix: xref-location-marker is in Emacs 25+. It's a function though, not a variable.

Also, when I "list-packages" and click on elpy it states emacs-24.4 as a dependency

That just means it's the minimum version.

@dgutov
Copy link
Member

dgutov commented May 2, 2021

Nothing further seems likely to happen here, so closing.

@dgutov dgutov closed this as completed May 2, 2021
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

2 participants