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

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

[elpa] externals/consult b410759d6a 3/3: consult--multi-candidates: Use


From: ELPA Syncer
Subject: [elpa] externals/consult b410759d6a 3/3: consult--multi-candidates: Use cl-loop instead of seq-doseq
Date: Thu, 2 Jan 2025 15:57:40 -0500 (EST)

branch: externals/consult
commit b410759d6adb9c894d264ac8120cffb8324df275
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    consult--multi-candidates: Use cl-loop instead of seq-doseq
---
 consult.el | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/consult.el b/consult.el
index 0844dc77ca..d38b35274d 100644
--- a/consult.el
+++ b/consult.el
@@ -2801,24 +2801,24 @@ KEYMAP is a command-specific keymap."
 
 (defun consult--multi-candidates (sources)
   "Return `consult--multi' candidates from SOURCES."
-  (let ((idx 0) candidates)
-    (seq-doseq (src sources)
-      (let* ((face (and (plist-member src :face) `(face ,(plist-get src 
:face))))
-             (cat (plist-get src :category))
-             (items (plist-get src :items))
-             (items (if (functionp items) (funcall items) items)))
-        (dolist (item items)
-          (let* ((str (or (car-safe item) item))
-                 (cand (consult--tofu-append str idx)))
-            ;; Preserve existing `multi-category' datum of the candidate.
-            (if (and (eq str item) (get-text-property 0 'multi-category str))
-                (when face (add-text-properties 0 (length str) face cand))
-              ;; Attach `multi-category' datum and face.
-              (add-text-properties
-               0 (length str)
-               `(multi-category (,cat . ,(or (cdr-safe item) item)) ,@face) 
cand))
-            (push cand candidates))))
-      (cl-incf idx))
+  (let (candidates)
+    (cl-loop
+     for src across sources for idx from 0 do
+     (let* ((face (and (plist-member src :face) `(face ,(plist-get src 
:face))))
+            (cat (plist-get src :category))
+            (items (plist-get src :items))
+            (items (if (functionp items) (funcall items) items)))
+       (dolist (item items)
+         (let* ((str (or (car-safe item) item))
+                (cand (consult--tofu-append str idx)))
+           ;; Preserve existing `multi-category' datum of the candidate.
+           (if (and (eq str item) (get-text-property 0 'multi-category str))
+               (when face (add-text-properties 0 (length str) face cand))
+             ;; Attach `multi-category' datum and face.
+             (add-text-properties
+              0 (length str)
+              `(multi-category (,cat . ,(or (cdr-safe item) item)) ,@face) 
cand))
+           (push cand candidates)))))
     (nreverse candidates)))
 
 (defun consult--multi-enabled-sources (sources)



reply via email to

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