nix systemd-use-company-p

This commit is contained in:
Mark Oteiza 2016-05-02 13:12:02 -04:00
parent de5da7fce7
commit 921f8d0df8

View File

@ -70,9 +70,10 @@
(function :tag "Other function")) (function :tag "Other function"))
:group 'systemd) :group 'systemd)
(defcustom systemd-use-company-p nil (defcustom systemd-mode-hook nil
"Whether to use `company-mode' for completion, if available." "Hook run after entering `systemd-mode'."
:type 'boolean :type 'hook
:options '(company-mode)
:group 'systemd) :group 'systemd)
(defconst systemd-unit-sections (defconst systemd-unit-sections
@ -380,8 +381,6 @@ Key bindings:
\\{systemd-mode-map}" \\{systemd-mode-map}"
(set-keymap-parent systemd-mode-map nil) (set-keymap-parent systemd-mode-map nil)
(conf-mode-initialize systemd-comment-start) (conf-mode-initialize systemd-comment-start)
(if (and systemd-use-company-p (fboundp 'company-mode))
(company-mode 1))
(add-hook 'company-backends #'systemd-company-backend) (add-hook 'company-backends #'systemd-company-backend)
(add-hook 'completion-at-point-functions #'systemd-complete-at-point) (add-hook 'completion-at-point-functions #'systemd-complete-at-point)
(setq-local font-lock-defaults '(systemd-font-lock-keywords))) (setq-local font-lock-defaults '(systemd-font-lock-keywords)))