Function: projectile-group-file-candidates

projectile-group-file-candidates is a byte-compiled function defined in projectile.el.

Signature

(projectile-group-file-candidates FILE CANDIDATES)

Documentation

Group file candidates by dirname matching count.

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260310.858/projectile.el
(defun projectile-group-file-candidates (file candidates)
  "Group file candidates by dirname matching count."
  (seq-sort (lambda (a b) (> (car a) (car b)))
            (let (value result)
              (while (setq value (pop candidates))
                (let* ((key (projectile-dirname-matching-count file value))
                       (kv (assoc key result)))
                  (if kv
                      (setcdr kv (cons value (cdr kv)))
                    (push (list key value) result))))
              (mapcar (lambda (x)
                        (cons (car x) (nreverse (cdr x))))
                      (nreverse result)))))