Function: mh-face-display-function

mh-face-display-function is a byte-compiled function defined in mh-xface.el.gz.

Signature

(mh-face-display-function)

Documentation

Display a Face, X-Face, or X-Image-URL header field.

If more than one of these are present, then the first one found in this order is used.

Source Code

;; Defined in /usr/src/emacs/lisp/mh-e/mh-xface.el.gz
(defun mh-face-display-function ()
  "Display a Face, X-Face, or X-Image-URL header field.
If more than one of these are present, then the first one found
in this order is used."
  (save-restriction
    (goto-char (point-min))
    (re-search-forward "\n\n" (point-max) t)
    (narrow-to-region (point-min) (point))
    (let* ((case-fold-search t)
           (face (message-fetch-field "face" t))
           (x-face (message-fetch-field "x-face" t))
           (url (message-fetch-field "x-image-url" t))
           raw type)
      (cond (face (setq raw (mh-face-to-png face)
                        type 'png))
            (x-face (setq raw (mh-uncompface x-face)
                          type 'pbm))
            (url (setq type 'url))
            (t (cl-multiple-value-setq (type raw)
                 (cl-values-list (mh-picon-get-image)))))
      (when type
        (goto-char (point-min))
        (when (re-search-forward "^from:" (point-max) t)
          (if (eq type 'url)
              (mh-x-image-url-display url)
            (insert-image (create-image
                           raw type t
                           :foreground
                           (face-foreground 'mh-show-xface nil t)
                           :background
                           (face-background 'mh-show-xface nil t))
             " ")))))))