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-select-next won't bind to <tab> #75

Closed
calve opened this issue Mar 11, 2014 · 3 comments
Closed

company-select-next won't bind to <tab> #75

calve opened this issue Mar 11, 2014 · 3 comments

Comments

@calve
Copy link

calve commented Mar 11, 2014

Hi !

From my point of view, it looks that company-select-next doesn't let itself bound to

Step to reproduce :
add "(global-set-key (kbd "") 'company-select-next)" to .emacs
open a file which as completion working.
try "M-x company-select-next" several times to check the expected behaviour
try to cycle throught completion using the tabulation key

Nothing appened

Am I missing something ? company-complete-common work fines using
I hope to be clear. Please let me know if one needs extra informations

@dgutov
Copy link
Member

dgutov commented Mar 11, 2014

Hello,

You cannot override a minor mode map using a global binding. You'll have to change the keymap the mode uses. Also, for historical reasons, you'll need to rebind both [tab] and (kbd "TAB"), the former for the graphical mode, and the latter for the terminal, if you use Emacs in that mode.

The result:

(eval-after-load 'company
  '(progn
     (define-key company-active-map (kbd "TAB") 'company-select-next)
     (define-key company-active-map [tab] 'company-select-next)))

Also, I'm guessing, you'll want to set company-selection-wrap-around to t.

@calve
Copy link
Author

calve commented Mar 11, 2014

Everything work as expected by adding your lines.
I appreciate the information. Thank you very much.

Le mardi 11 mars 2014, 12:52:33 Dmitry Gutov a écrit :

Hello,

You cannot override a minor mode map using a global binding. You'll have to
change the keymap the mode uses. Also, for historical reasons, you'll need
to rebind both [tab] and (kbd "TAB"), the former for the graphical
mode, and the latter for the terminal, if you use Emacs in that mode.

The result:

(eval-after-load 'company
  '(progn
     (define-key company-active-map (kbd "TAB") 'company-select-next)
     (define-key company-active-map [tab] 'company-select-next)))

Also, I'm guessing, you'll want to set company-selection-wrap-around to
t.


Reply to this email directly or view it on GitHub:
#75 (comment)

@dgutov
Copy link
Member

dgutov commented Mar 12, 2014

No problem.

@dgutov dgutov closed this as completed Mar 12, 2014
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