Function: mh-variants

mh-variants is a byte-compiled function defined in mh-e.el.gz.

Signature

(mh-variants)

Documentation

Return a list of installed variants of MH on the system.

This function looks for MH in mh-sys-path, mh-path and exec-path(var)/exec-path(fun). The format of the list of variants that is returned is described by the variable mh-variants(var)/mh-variants(fun).

Source Code

;; Defined in /usr/src/emacs/lisp/mh-e/mh-e.el.gz
(defun mh-variants ()
  "Return a list of installed variants of MH on the system.
This function looks for MH in `mh-sys-path', `mh-path' and
`exec-path'. The format of the list of variants that is returned
is described by the variable `mh-variants'."
  (if mh-variants
      mh-variants
    (let ((list-unique))
      ;; Make a unique list of directories, keeping the given order.
      ;; We don't want the same MH variant to be listed multiple times.
      (cl-loop for dir in (append mh-path mh-sys-path exec-path) do
               ;; skip relative dirs, typically "."
               (if (file-name-absolute-p dir)
                   (progn
                     (setq dir (file-chase-links (directory-file-name dir)))
                     (cl-pushnew dir list-unique :test #'equal))))
      (cl-loop for dir in (nreverse list-unique) do
               (when (and dir (file-accessible-directory-p dir))
                 (let ((variant (mh-variant-info dir)))
                   (if variant
                       (add-to-list 'mh-variants variant)))))
      mh-variants)))