Function: mh-thread-sort-containers

mh-thread-sort-containers is a byte-compiled function defined in mh-thread.el.gz.

Signature

(mh-thread-sort-containers CONTAINERS)

Documentation

Sort a list of message CONTAINERS to be in ascending order wrt index.

Source Code

;; Defined in /usr/src/emacs/lisp/mh-e/mh-thread.el.gz
(defun mh-thread-sort-containers (containers)
  "Sort a list of message CONTAINERS to be in ascending order wrt index."
  (sort containers
        (lambda (x y)
          (when (and (mh-container-message x) (mh-container-message y))
            (let* ((id-x (mh-message-id (mh-container-message x)))
                   (id-y (mh-message-id (mh-container-message y)))
                   (index-x (gethash id-x mh-thread-id-index-map))
                   (index-y (gethash id-y mh-thread-id-index-map)))
              (and (integerp index-x) (integerp index-y)
                   (< index-x index-y)))))))