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

Does not work along with company-complete #113

Open
avatar-lavventura opened this issue Nov 10, 2020 · 11 comments
Open

Does not work along with company-complete #113

avatar-lavventura opened this issue Nov 10, 2020 · 11 comments

Comments

@avatar-lavventura
Copy link

avatar-lavventura commented Nov 10, 2020

I was not able to make it work, what may be the reason? C-c h is not triggered as well.

my config file:

(company-quickhelp-mode)

(eval-after-load 'company
  '(define-key company-active-map (kbd "C-c h") #'company-quickhelp-manual-begin))

(setq company-auto-complete t)

(eval-after-load 'company
  '(progn
     (define-key company-active-map (kbd "TAB") 'company-complete-common-or-cycle)
     (define-key company-active-map (kbd "<tab>") 'company-complete-common-or-cycle)))

(setq company-frontends
      '(company-pseudo-tooltip-unless-just-one-frontend
        company-preview-frontend
        company-echo-metadata-frontend))

(setq company-auto-complete t)
(global-set-key (kbd "C-c C-k") 'company-complete)

@avatar-lavventura avatar-lavventura changed the title Does not work in Python file Does not work along with company-complete Nov 10, 2020
@dgutov
Copy link
Member

dgutov commented Nov 10, 2020

Does company-show-doc-buffer work? It's normally bound to C-h while the completion is active.

If it does not, the current backend does not support to documentation display. You can find out the currently used backend with M-x company-diag.

@avatar-lavventura
Copy link
Author

avatar-lavventura commented Nov 10, 2020

M-x company-show-doc-buffer returns:

abs(n: SupportsAbs[_T], /) -> _T

Return the absolute value of the argument.

C-h is bind to delete a character on my end; while completion is active, C-h deletes a character.

Output of M-x company-diag; my current backend: https://gist.github.com/avatar-lavventura/c37df6f9f35e377c89d880f9be9ec664

@dgutov
Copy link
Member

dgutov commented Nov 11, 2020

OK.

Please clarify: does it work with other backends? In .el files, for instance.

@avatar-lavventura
Copy link
Author

avatar-lavventura commented Nov 14, 2020

I am not sure it does not do work do anything, maybe I was not able to make proper init.el file.

Is there any .emacs configurations that I can try, which works on your end?

@dgutov
Copy link
Member

dgutov commented Nov 14, 2020

Here's the problem: you're resetting the value of company-frontends after enabling company-quickhelp-mode. Thereby undoing the effect of that function.

Do it in the reverse: move (company-quickhelp-mode) to the last line.

@avatar-lavventura
Copy link
Author

avatar-lavventura commented Nov 15, 2020

ah I tried it but I does not work :-(


updated .emacs:

(require 'package)
(setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
                         ("melpa" . "https://melpa.org/packages/")
                         ("org" . "https://orgmode.org/elpa/")))

(add-to-list 'package-archives
             '("MELPA Stable" . "http://stable.melpa.org/packages/") t)

(package-initialize)

(when (not package-archive-contents)
  (package-refresh-contents))

(if (not (package-installed-p 'company-quickhelp))
    (progn
      (package-install 'company-quickhelp)))

(add-hook 'after-init-hook 'global-company-mode)
(setq company-auto-complete t)

(setq company-auto-complete t)
(global-set-key (kbd "C-c C-k") 'company-complete)

(company-quickhelp-mode)  ;; moved to the end of the file

(eval-after-load 'company
  '(define-key company-active-map (kbd "C-c h") #'company-quickhelp-manual-begin))

@dgutov
Copy link
Member

dgutov commented Nov 15, 2020

ah I tried it but I does not work :-(

Does it work in emacs-lisp-mode? Or in *scratch*?

@avatar-lavventura
Copy link
Author

Like I only used text code on my previoes comment in .emacs file and deleted all the other stuff but there was no affect.

@dgutov
Copy link
Member

dgutov commented Nov 19, 2020

Could you rephrase that? I'm not sure I understand you well.

@avatar-lavventura
Copy link
Author

Sorry I am just unable to make it work.

@dgutov
Copy link
Member

dgutov commented Nov 19, 2020

It doesn't work in *scratch* either?

Are you using a graphical Emacs? Not in terminal?

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