Function: embark-selected-candidates
embark-selected-candidates is a byte-compiled function defined in
embark.el.
Signature
(embark-selected-candidates)
Documentation
Return currently selected candidates in the buffer.
Source Code
;; Defined in ~/.emacs.d/elpa/embark-20260610.302/embark.el
(defun embark-selected-candidates ()
"Return currently selected candidates in the buffer."
(when embark--selection
(cl-flet ((unwrap (x) (get-text-property 0 'multi-category x)))
(let* ((first-type (car (unwrap (caar embark--selection))))
(same (cl-every (lambda (item)
(eq (car (unwrap (car item))) first-type))
embark--selection))
(extract (if same
(pcase-lambda (`(,cand . ,overlay))
(cons (cdr (unwrap cand)) overlay))
#'identity)))
(cons
(if same first-type 'multi-category)
(nreverse
(mapcar
(lambda (item)
(pcase-let ((`(,cand . ,ov) (funcall extract item)))
(if ov `(,cand ,(overlay-start ov) . ,(overlay-end ov)) cand)))
embark--selection)))))))