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

Company autocompletion unpredictable in terminal #377

Closed
gustavjf opened this issue Sep 4, 2016 · 3 comments
Closed

Company autocompletion unpredictable in terminal #377

gustavjf opened this issue Sep 4, 2016 · 3 comments

Comments

@gustavjf
Copy link

gustavjf commented Sep 4, 2016

Emacs version: 25.1.1 (via brew install --devel emacs)
Also tried: 24.5.1, 24.5.1 --with-x

On a fresh clone, running M-/, or company-complete fails (no tooltip) with the error message:

Company: frontend company-quickhelp-frontend error "Symbol's function definition is void: pos-tip-hide" on command hide.

Company completion is unpredictable - sometimes it works the first time runningcompany-complete after opening a buffer, but afterwards it fails and throws the error above consistently. That's until I remove company-quickhelp from company frontends.

I suspect this is because pos-tip doesn't work in the terminal.

@purcell Are you using a GUI distribution of Emacs? If you're using it in the terminal and the tooltip with documentation pop-up is working well, I'd be grateful to know how. For the moment I'm relying on F1 to open a separate documentation buffer, which is a bit more cumbersome.

@purcell
Copy link
Owner

purcell commented Sep 5, 2016

Hmmm... I normally use a GUI version of Emacs, typically Emacs HEAD.

Do you see the problem when starting Emacs in the terminal, or creating a terminal frame using Emacsclient? I've tried both with my Emacs and can't reproduce this.

@gustavjf
Copy link
Author

gustavjf commented Sep 6, 2016

Sorry, I should have provided steps to reproduce:

Inside OSX Terminal
Emacs Version: 25.1.1

  1. git clone https://github.com/purcell/emacs.d.git ~/.emacs.d
  2. emacs
  3. wait for package downloads
  4. Load and treat as safe sanityinc-solarized theme
  5. Lots of compile warnings, guessing its normal:

screen shot 2016-09-06 at 9 05 35 pm

1. `C-x C-f ~/.emacs.d/lisp/init-company.el` 2. On line 3, type `(set`. Let completion start automatically, can see tooltip.

screen shot 2016-09-06 at 9 19 45 pm

1. _While still seeing the tooltip, `C-f`, then `C-b`. Cursor should now be above automatically inserted closing paren and tooltip should have disappeared._ 2. `M-/` to force completion. Check minibuffer:

screen shot 2016-09-06 at 9 16 56 pm

1. Delete line 3, retype `(set`, can't see tooltip show up. `M-/` shows `pos-tip` error again.

purcell added a commit to purcell/company-quickhelp that referenced this issue Feb 26, 2017
It's possible for company-quickhelp to be enabled in terminal Emacs
frames, e.g. by starting a GUI frame and then opening additional
terminal frames with emacsclient. And, indeed, it should logically
always be safe to enable company-quickhelp-mode in any buffer, because
that buffer may be displayed in terminal or GUI frames at any future
time.

Without this change, when company calls the company-quickhelp backend
in terminal frames, pos-tip-hide is called unconditionally, which
results in errors. For real-world examples, see
purcell/emacs.d#377 and
purcell/emacs.d#414.

This commit adds a function called
company-quickhelp-pos-tip-available-p, which is used to detect and
prevent these errors.
@purcell
Copy link
Owner

purcell commented Feb 27, 2017

I believe this is now fixed upstream in company-quickhelp.

@purcell purcell closed this as completed Jan 27, 2018
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