This commit is contained in:
Mark Oteiza 2015-11-27 23:48:13 -05:00
parent 1513dd0fa4
commit a2ec338fa6

View File

@ -21,7 +21,7 @@
;;; Code: ;;; Code:
(require 'cl-lib) (eval-when-compile (require 'cl-lib))
(declare-function company-mode "company") (declare-function company-mode "company")
(declare-function company-begin-backend "company") (declare-function company-begin-backend "company")
@ -171,15 +171,15 @@
(prefix (and (eq major-mode 'systemd-mode) (prefix (and (eq major-mode 'systemd-mode)
(company-grab-symbol))) (company-grab-symbol)))
(candidates (candidates
(cl-remove-if-not (cl-loop
(lambda (c) (string-prefix-p arg c)) for comp in (if (systemd-company-network-p)
(if (systemd-company-network-p) (if (systemd-company-section-p)
(if (systemd-company-section-p) systemd-company-network-sections
systemd-company-network-sections systemd-company-network-directives)
systemd-company-network-directives) (if (systemd-company-section-p)
(if (systemd-company-section-p) systemd-company-unit-sections
systemd-company-unit-sections systemd-company-unit-directives))
systemd-company-unit-directives)))))) if (string-prefix-p arg comp) collect comp))))
(defun systemd-company--setup-company (enable) (defun systemd-company--setup-company (enable)
(when enable (when enable
(add-to-list (make-local-variable 'company-backends) 'systemd-company-backend)) (add-to-list (make-local-variable 'company-backends) 'systemd-company-backend))