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

Conflict with company-quickhelp-mode #1

Closed
seagle0128 opened this issue Jun 25, 2018 · 25 comments
Closed

Conflict with company-quickhelp-mode #1

seagle0128 opened this issue Jun 25, 2018 · 25 comments

Comments

@seagle0128
Copy link

seagle0128 commented Jun 25, 2018

company-quickhelp-mode will make posframe close automatically. Any alternative for it? or any plan to port company-quickhelp to posframe? Thanks!

@seagle0128 seagle0128 changed the title Conflict with beacon-mode Conflict with company-quickhelp-mode Jun 25, 2018
@tumashu
Copy link
Owner

tumashu commented Jul 5, 2018

At the moment, no plan, but, PR is welcome :-)

@c0001
Copy link

c0001 commented Jul 18, 2018

The same conflicted question for me and with none ability for fixing or PR it 😺 .

Sitting for waiting for the feature adding by @tumashu '大佬' .

@ermingol23
Copy link

I have found the reason for why company-quickhelp tooltip hides company-posframe; the hook window-configuration-change-hook gets called when a tooltip is shown and that in turn triggers company-posframe to hide its posframe...

Thus the solution to the problem is to add a guard (e.g. if-statement) to company-posframe-hide that ensures that the posframe is not hidden when a popup is shown but hides it when window is switched. :-)

@ermingol23
Copy link

I have verified that modifying company-posframe.el like this solves this issue (I am not able to send you a PR, but this change is trivial anyway). The idea is to add a new function that gets called from the window-configuration-change-hook instead of company-posframe-hide. This new function depends on a global variable that stores the selected window when the company-posframe was shown. The heuristics used is that if window-configuration-change-hook gets called and (selected-window) differs from the cached value then the user switched windows. Otherwise, it is assumed that a tooltip or posframe etc. was shown. In the former case company-posframe is hidden and in the latter case nothing happens.

(defvar company-posframe-window nil
"Window containing company-posframe if it is showing.")

(defun company-posframe-show ()
"Show company-posframe candidate menu."
(let* (...)
...
(setq company-posframe-window (selected-window))
...))

(defun company-posframe-window-configuration-changed ()
"Function called from window-configuration-change-hook."
(if (not (eq company-posframe-window (selected-window)))
(company-posframe-hide)))

(defun company-posframe-hide ()
"Hide company-posframe candidate menu."
(posframe-hide company-posframe-buffer)
(setq company-posframe-window nil))

and in "define-minor-mode" replace
(add-hook 'window-configuration-change-hook #'company-posframe-hide)
with
(add-hook 'window-configuration-change-hook #'company-posframe-window-configuration-changed-hook)

and conversely
(remove-hook 'window-configuration-change-hook #'company-posframe-hide)
with
(remove-hook 'window-configuration-change-hook #'company-posframe-window-configuration-changed-hook)

@seagle0128
Copy link
Author

seagle0128 commented Nov 15, 2018

@tumashu Would you please consider merging @ermingol23 's solution? Which looks good.

@ylluminarious
Copy link

@tumashu I would also appreciate it if you would merge @ermingol23's solution above. Auto-complete recently died (the maintainers archived the project) so company-mode is the only solution for auto-completion in Emacs now. This package helps solve issues with zooming in, so it would be nice if it was able to work with company-quickhelp.

@tumashu
Copy link
Owner

tumashu commented Jun 6, 2019

auto-complete died?

@seagle0128
Copy link
Author

Now I have to switch to company-box although it's not perfect.

@ylluminarious
Copy link

@tumashu Well, if you look at their organization page you can see that three of their main projects are archived. Namely, auto-complete, popup.el and fuzzy.el. This means no one can make new pull requests or comment on issues. This effectively means no more new development can occur without forking the projects and it puts the code in a read-only state. Since company-mode exists, I doubt anyone will fork it. We actually discussed this problem here, but no one was able to take up the torch (including myself).

@ylluminarious
Copy link

@seagle0128 Does company-box work with company-posframe? Does it also provide the same functionality as company-quickhelp?

@seagle0128
Copy link
Author

@tumashu auto-compelete are archived and died...

@ylluminarious company-box provides same functionalities of company-posframe, plus quck help and icon, like this:

image

@tumashu
Copy link
Owner

tumashu commented Jun 6, 2019

company-box 看起来也很赞

@seagle0128
Copy link
Author

@tumashu 是不错,可惜有些bug,性能也有点问题,作者似乎不积极更新,提交了issue和PR都不怎么理,不如大佬勤快啊 ~~~

@tumashu
Copy link
Owner

tumashu commented Jun 6, 2019

@seagle0128
Copy link
Author

@tumashu 我简单测试了下,在27上一闪窗口就没了。

@tumashu
Copy link
Owner

tumashu commented Jun 6, 2019

1

@tumashu
Copy link
Owner

tumashu commented Jun 6, 2019

我这边效果是这样子的

@tumashu
Copy link
Owner

tumashu commented Jun 8, 2019

图片

tumashu added a commit to tumashu/company-quickhelp that referenced this issue Jun 8, 2019
tumashu added a commit to tumashu/company-quickhelp that referenced this issue Jun 8, 2019
@tumashu
Copy link
Owner

tumashu commented Jun 8, 2019

@seagle0128 I have add a PR to company-quickhelp, you can try:

(setq company-quickhelp-tooltip 'posframe)

@seagle0128
Copy link
Author

@tumashu I tried d7e0bd9e063c7e52a0dbcde79df0e4b2e7a4f3e7, and it works well, except one minor issue: C-g is unable hide the doc window.

Will this be merged into the upstream?

@ylluminarious
Copy link

@tumashu It looks like your PR was rejected by the upstream developer of company-quickhelp. What should we do now in order to resolve this issue? Also, do you know what's causing the problem reported by @seagle0128? Thanks for your work on this issue so far.

@tumashu
Copy link
Owner

tumashu commented Jul 3, 2019

I do not know, the best way is merging to company-quickhelp, for I do not want to maintain many advice in company-posframe, may be we have other way ...

@ylluminarious
Copy link

@tumashu Yes, it's really too bad the developer turned you down. What is the other way you have in mind?

@ema2159
Copy link

ema2159 commented Jul 17, 2019

@tumashu Yes, it's really too bad the developer turned you down. What is the other way you have in mind?

That's just wrong. If he claims he doesn't have much time to maintain his package (company-quickhelp author) he should seek for a new maintainer or at least get help for maintaining the package.

@tumashu
Copy link
Owner

tumashu commented Dec 10, 2019

https://github.com/tumashu/company-posframe/blob/master/company-posframe-quickhelp.el

@tumashu tumashu closed this as completed Dec 10, 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

6 participants