Function: mh-find-path
mh-find-path is an autoloaded and byte-compiled function defined in
mh-utils.el.gz.
Signature
(mh-find-path)
Documentation
Set variables from user's MH profile.
This function sets mh-user-path from your "Path:" MH profile
component (but defaults to "Mail" if one isn't present),
mh-draft-folder from "Draft-Folder:", mh-unseen-seq from
"Unseen-Sequence:", mh-previous-seq from
"Previous-Sequence:", and mh-inbox from "Inbox:" (defaults
to "+inbox").
The hook mh-find-path-hook is run after these variables have
been set. This hook can be used the change the value of these
variables if you need to run with different values between MH and
MH-E.
Source Code
;; Defined in /usr/src/emacs/lisp/mh-e/mh-utils.el.gz
;;;###mh-autoload
(defun mh-find-path ()
"Set variables from user's MH profile.
This function sets `mh-user-path' from your \"Path:\" MH profile
component (but defaults to \"Mail\" if one isn't present),
`mh-draft-folder' from \"Draft-Folder:\", `mh-unseen-seq' from
\"Unseen-Sequence:\", `mh-previous-seq' from
\"Previous-Sequence:\", and `mh-inbox' from \"Inbox:\" (defaults
to \"+inbox\").
The hook `mh-find-path-hook' is run after these variables have
been set. This hook can be used the change the value of these
variables if you need to run with different values between MH and
MH-E."
(unless mh-find-path-run
(or mh-variant-in-use (mh-variant-set mh-variant))
;; Sanity checks.
(if (and (getenv "MH")
(not (file-readable-p (getenv "MH"))))
(error "MH environment variable contains unreadable file %s"
(getenv "MH")))
(if (null (mh-variants))
(error "Install MH and run install-mh before running MH-E"))
(if (not (or (getenv "MH") (file-readable-p "~/.mh_profile")))
(error "Run install-mh before running MH-E"))
;; Read MH profile.
(setq mh-user-path (mh-profile-component "Path"))
(if (not mh-user-path)
(setq mh-user-path "Mail"))
(setq mh-user-path
(file-name-as-directory
(expand-file-name mh-user-path (expand-file-name "~"))))
(mh-set-x-image-cache-directory (expand-file-name ".mhe-x-image-cache"
mh-user-path))
(setq mh-draft-folder (mh-profile-component "Draft-Folder"))
(if mh-draft-folder
(progn
(if (not (mh-folder-name-p mh-draft-folder))
(setq mh-draft-folder (format "+%s" mh-draft-folder)))
(if (not (file-exists-p (mh-expand-file-name mh-draft-folder)))
(error
"Draft folder \"%s\" not found; create it and try again"
(mh-expand-file-name mh-draft-folder)))))
(setq mh-inbox (mh-profile-component "Inbox"))
(cond ((not mh-inbox)
(setq mh-inbox "+inbox"))
((not (mh-folder-name-p mh-inbox))
(setq mh-inbox (format "+%s" mh-inbox))))
(setq mh-unseen-seq (mh-profile-component "Unseen-Sequence"))
(if mh-unseen-seq
(setq mh-unseen-seq (intern mh-unseen-seq))
(setq mh-unseen-seq 'unseen)) ;old MH default?
(setq mh-previous-seq (mh-profile-component "Previous-Sequence"))
(if mh-previous-seq
(setq mh-previous-seq (intern mh-previous-seq)))
(run-hooks 'mh-find-path-hook)
(mh-collect-folder-names)
(setq mh-find-path-run t)))