Function: newsticker--icon-read

newsticker--icon-read is a byte-compiled function defined in newst-reader.el.gz.

Signature

(newsticker--icon-read FEED-NAME-SYMBOL)

Documentation

Read the cached icon for FEED-NAME-SYMBOL from disk.

Return the image.

Source Code

;; Defined in /usr/src/emacs/lisp/net/newst-reader.el.gz
(defun newsticker--icon-read (feed-name-symbol)
  "Read the cached icon for FEED-NAME-SYMBOL from disk.
Return the image."
  (catch 'icon
    (when (file-exists-p (newsticker--icons-dir))
      (dolist (file (directory-files (newsticker--icons-dir) t
                             (concat (symbol-name feed-name-symbol) "\\..*")))
        (condition-case error-data
            (throw 'icon (create-image
                          file (and (fboundp 'imagemagick-types)
                                    (imagemagick-types)
                                    'imagemagick)
                          nil
                          :ascent 'center
                          :max-width 16
                          :max-height 16))
          (error
           (message "Error: cannot create icon for %s: %s"
                    feed-name-symbol error-data)))))
    ;; Fallback: default icon.
    (find-image '((:type png :file "newsticker/rss-feed.png" :ascent center)))))