Function: nerd-icons--read-candidates-for-glyph-set

nerd-icons--read-candidates-for-glyph-set is a natively compiled function defined in nerd-icons.el.

Signature

(nerd-icons--read-candidates-for-glyph-set GLYPH-SET &optional SHOW-GLYPH-SET)

Documentation

Helper to build read candidates for GLYPH-SET.

If SHOW-GLYPH-SET is non-nil, displays the icons glyph set in the candidate string.

Source Code

;; Defined in /nix/store/yazcqi510kxs7jygyiirgf8qyg348f6p-emacs-packages-deps/share/emacs/site-lisp/elpa/nerd-icons-20260823.17/nerd-icons.el
(defun nerd-icons--read-candidates-for-glyph-set (glyph-set &optional show-glyph-set)
  "Helper to build read candidates for GLYPH-SET.

If SHOW-GLYPH-SET is non-nil, displays the icons glyph set in the candidate
string."
  (let ((data   (funcall (nerd-icons--data-name glyph-set)))
        (icon-f (nerd-icons--function-name glyph-set)))
    (mapcar
     (lambda (it)
       (let* ((icon-name (car it))

              (icon-display (funcall icon-f icon-name))
              (icon-glyph-set (if show-glyph-set (format "\t[%s]" glyph-set) ""))

              (candidate-name (format "%s\t%s%s" icon-display icon-name icon-glyph-set))
              (candidate-icon (funcall (nerd-icons--function-name glyph-set) icon-name)))
         (cons candidate-name candidate-icon)))
     data)))