Function: eca-completion--resolve-foreground

eca-completion--resolve-foreground is a natively compiled function defined in eca-completion.el.

Signature

(eca-completion--resolve-foreground FACE)

Documentation

Return the foreground color implied by FACE, or nil.

FACE may be a face name symbol, a list of faces (symbols and/or anonymous face plists like (:foreground COLOR)), or a single anonymous face plist. Anonymous plists are inspected directly because face-foreground rejects them on Emacs 28.

Source Code

;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-completion.el
(defun eca-completion--resolve-foreground (face)
  "Return the foreground color implied by FACE, or nil.
FACE may be a face name symbol, a list of faces (symbols and/or
anonymous face plists like (:foreground COLOR)), or a single
anonymous face plist.  Anonymous plists are inspected directly
because `face-foreground' rejects them on Emacs 28."
  (cond
   ((null face) nil)
   ((and (listp face) (keywordp (car face)))
    (plist-get face :foreground))
   ((listp face)
    (let (result)
      (while (and face (not result))
        (setq result (eca-completion--resolve-foreground (car face))
              face (cdr face)))
      result))
   ((symbolp face)
    (face-foreground face nil 'default))))