The mentioned fragment does not work in any case.
Here is a snippet you can use instead:
(defun company-yasnippet-or-completion () (interactive) (let ((yas-fallback-behavior nil)) (unless (yas-expand) (call-interactively
To make sure this is called instead of company-complete-common , use
(add-hook 'company-mode-hook (lambda () (substitute-key-definition 'company-complete-common 'company-yasnippet-or-completion company-active-map)))
Background: this locally changes the value of yas-fallback-behaviour , which causes yas to call company-complete-common if no completion is found.
Clement
source share