emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/systemd a2ec338 055/131: use loop


From: ELPA Syncer
Subject: [nongnu] elpa/systemd a2ec338 055/131: use loop
Date: Sun, 29 Aug 2021 11:35:14 -0400 (EDT)

branch: elpa/systemd
commit a2ec338fa6908d05dba48baf69be9426cd97f7f7
Author: Mark Oteiza <mvoteiza@udel.edu>
Commit: Mark Oteiza <mvoteiza@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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]