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

Prevent constant errors when enabled in terminal #64

Merged
merged 1 commit into from
Feb 26, 2017

Conversation

purcell
Copy link
Contributor

@purcell purcell commented 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.

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.
@expez expez merged commit 30197a3 into company-mode:master Feb 26, 2017
@expez
Copy link
Collaborator

expez commented Feb 26, 2017

Thanks for investigating, @purcell! This looks like a good idea to me! 👍

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

Successfully merging this pull request may close these issues.

2 participants