Function: allout-fetch-icon-image

allout-fetch-icon-image is a byte-compiled function defined in allout-widgets.el.gz.

Signature

(allout-fetch-icon-image NAME)

Documentation

Fetch allout icon for symbol NAME.

We use a caching strategy, so the caller doesn't need to do so.

Source Code

;; Defined in /usr/src/emacs/lisp/allout-widgets.el.gz
;;;_ : Icon management
;;;_  > allout-fetch-icon-image (name)
(defun allout-fetch-icon-image (name)
  "Fetch allout icon for symbol NAME.

We use a caching strategy, so the caller doesn't need to do so."
  (let* ((types allout-widgets-icon-types)
         (use-dir (if (equal (frame-parameter nil 'background-mode)
                             'light)
                      allout-widgets-icons-light-subdir
                    allout-widgets-icons-dark-subdir))
         (key (list name use-dir))
         (got (assoc key allout-widgets-icons-cache)))
    (if got
        ;; display system shows only first of subsequent adjacent
        ;; `eq'-identical repeats - use copies to avoid this problem.
        (allout-widgets-copy-list (cadr got))
      (while (and types (not got))
        (setq got
              (find-image
               (list (append (list :type (car types)
                                   :file (concat use-dir
                                                 (symbol-name name)
                                                 "." (symbol-name
                                                      (car types))))
                             allout-widgets-item-image-properties-emacs
                             ))))
        (setq types (cdr types)))
      (if got
          (push (list key got) allout-widgets-icons-cache))
      got)))