Function: tree-widget-lookup-image

tree-widget-lookup-image is a byte-compiled function defined in tree-widget.el.gz.

Signature

(tree-widget-lookup-image NAME)

Documentation

Look up in current theme for an image with NAME.

Search first in current theme, then in parent themes (see also the function tree-widget-set-parent-theme). Return the first image found having a supported format, or nil if not found.

Source Code

;; Defined in /usr/src/emacs/lisp/tree-widget.el.gz
(defun tree-widget-lookup-image (name)
  "Look up in current theme for an image with NAME.
Search first in current theme, then in parent themes (see also the
function `tree-widget-set-parent-theme').
Return the first image found having a supported format, or nil if not
found."
  (let (file)
    (catch 'found
      (dolist (default-directory (tree-widget-themes-path))
        (dolist (dir (aref tree-widget--theme 0))
          (dolist (fmt (tree-widget-image-formats))
            (dolist (ext (cdr fmt))
              (setq file (expand-file-name (concat name ext) dir))
              (and (file-readable-p file)
                   (file-regular-p file)
                   (throw 'found
                          (apply #'create-image
                                 file (car fmt) nil
                                 (tree-widget-image-properties name))))))))
      nil)))