branch: elpa/systemd commit a2ec338fa6908d05dba48baf69be9426cd97f7f7 Author: Mark Oteiza <mvote...@udel.edu> Commit: Mark Oteiza <mvote...@udel.edu>
use loop --- systemd-company.el | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/systemd-company.el b/systemd-company.el index 52b66af..4ba9c6e 100644 --- a/systemd-company.el +++ b/systemd-company.el @@ -21,7 +21,7 @@ ;;; Code: -(require 'cl-lib) +(eval-when-compile (require 'cl-lib)) (declare-function company-mode "company") (declare-function company-begin-backend "company") @@ -171,15 +171,15 @@ (prefix (and (eq major-mode 'systemd-mode) (company-grab-symbol))) (candidates - (cl-remove-if-not - (lambda (c) (string-prefix-p arg c)) - (if (systemd-company-network-p) - (if (systemd-company-section-p) - systemd-company-network-sections - systemd-company-network-directives) - (if (systemd-company-section-p) - systemd-company-unit-sections - systemd-company-unit-directives)))))) + (cl-loop + for comp in (if (systemd-company-network-p) + (if (systemd-company-section-p) + systemd-company-network-sections + systemd-company-network-directives) + (if (systemd-company-section-p) + systemd-company-unit-sections + systemd-company-unit-directives)) + if (string-prefix-p arg comp) collect comp)))) (defun systemd-company--setup-company (enable) (when enable (add-to-list (make-local-variable 'company-backends) 'systemd-company-backend))