2

I am a newbie to emacs and know nothing about lisp. I just want to config some features for autocompletion.

Here is how I config company-mode now:

(eval-after-load 'company
  '(add-to-list
    'company-backends '(company-irony-c-headers company-irony)))
(eval-after-load 'company
  '(add-to-list 'company-backends 'company-irony))
(require 'company)
(add-hook 'after-init-hook 'global-company-mode)
(global-set-key "\t" 'company-complete-common)

I want the auto complete pop up window to be closed when I type any character. For example, I type "ab" and I hit , the auto complete window pop up. I was unable to type any character that is not in the auto complete list. So, I want when I type "c", the pop-up window close and "c" should be inputted.

  • 3
    Welcome to Emacs SX! Please try to ask only one question per topic, and please use descriptive titles for your questions. Thank you – lunaryorn Dec 7 '15 at 12:50
  • I've changed the title to more clearly reflect what I believe you are asking here. Feel free to change it again if I've missed the point. – glucas Dec 8 '15 at 16:15
3

Try adding this:

(setq company-require-match nil)

This tells company not to require what you type to match a completion candidate. If you start completion you should then be able to type something that doesn't match to cancel the completion and keep typing normally.

Note that you can use a progn to perform multiple steps within a single eval-after-load. For example:

(eval-after-load 'company
    '(progn
        (add-to-list 'company-backends ....)
        (add-to-list 'company-backends ....)
        (setq company-require-match nil)))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.