Function: mh-mime-display-alternative

mh-mime-display-alternative is a byte-compiled function defined in mh-mime.el.gz.

Signature

(mh-mime-display-alternative HANDLES)

Documentation

Choose among the alternatives, HANDLES the part that will be displayed.

If no part is preferred then all the parts are displayed.

Source Code

;; Defined in /usr/src/emacs/lisp/mh-e/mh-mime.el.gz
(defun mh-mime-display-alternative (handles)
  "Choose among the alternatives, HANDLES the part that will be displayed.
If no part is preferred then all the parts are displayed."
  (let* ((preferred (mm-preferred-alternative handles))
         (others (cl-loop for x in handles unless (eq x preferred) collect x)))
    (cond ((and preferred
                (stringp (car preferred)))
           (mh-mime-display-part preferred)
           (mh-mime-maybe-display-alternatives others))
          (preferred
           (save-restriction
             (narrow-to-region (point) (if (eobp) (point) (1+ (point))))
             (mh-mime-display-single preferred)
             (mh-mime-maybe-display-alternatives others)
             (goto-char (point-max))))
          (t
           (mh-mime-display-mixed handles)))))