I want to enable and disable
company-mode. Would I have to reset setup variables, everytime I want to enable
company-mode? Should I call
company-setup before calling
company-enable. Is the placement of
(add-hook 'after-init-hook 'global-company-mode) correct as part of setup?
(defun company-setup () "Text completion-at-point drop-down framework displaying possible candidates at cursor point as one types." (interactive) (setq company-minimum-prefix-length 2) (setq company-backends '(company-dabbrev company-dabbrev-code)) (setq company-dabbrev-other-buffers 'all) (setq company-dabbrev-ignore-case 'keep-prefix) (setq company-dabbrev-code-other-buffers 'all) (setq company-dabbrev-code-ignore-case t) (setq company-dabbrev-code-everywhere t) (add-hook 'after-init-hook 'global-company-mode)) (defun company-enable () "Disables company completion" (interactive) (company-mode 1))