Function: gnus--random-face-with-type

gnus--random-face-with-type is a byte-compiled function defined in gnus-fun.el.gz.

Signature

(gnus--random-face-with-type DIR EXT OMIT FUN)

Documentation

Return file from DIR with extension EXT.

Omit matches of OMIT, and process them by FUN.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-fun.el.gz
;;;###autoload
(defun gnus--random-face-with-type (dir ext omit fun)
  "Return file from DIR with extension EXT.
Omit matches of OMIT, and process them by FUN."
  (when (file-exists-p dir)
    (let* ((files
            (remove nil (mapcar
                         (lambda (f) (unless (string-match (or omit "^$") f) f))
                         (directory-files dir t ext))))
           (file (and files (seq-random-elt files))))
      (when file
        (funcall fun file)))))