Function: mh-search-choose

mh-search-choose is a byte-compiled function defined in mh-search.el.gz.

Signature

(mh-search-choose &optional SEARCHER)

Documentation

Choose a searching function.

The side-effects of this function are that the variables mh-searcher, mh-search-function, and mh-search-next-result-function are set according to the first searcher in mh-search-choices present on the system. If optional argument SEARCHER is present, use it instead of mh-search-program.

Source Code

;; Defined in /usr/src/emacs/lisp/mh-e/mh-search.el.gz
(defun mh-search-choose (&optional searcher)
  "Choose a searching function.
The side-effects of this function are that the variables
`mh-searcher', `mh-search-function', and
`mh-search-next-result-function' are set according to the first
searcher in `mh-search-choices' present on the system. If
optional argument SEARCHER is present, use it instead of
`mh-search-program'."
  (cl-block nil
    (let ((program-alist (cond (searcher
                                (list (assoc searcher mh-search-choices)))
                               (mh-search-program
                                (list
                                 (assoc mh-search-program mh-search-choices)))
                               (t mh-search-choices))))
      (while program-alist
        (let* ((current (pop program-alist))
               (executable (symbol-value (cadr current))))
          (when executable
            (setq mh-searcher (car current))
            (setq mh-search-function (nth 2 current))
            (setq mh-search-next-result-function (nth 3 current))
            (setq mh-search-regexp-builder (nth 4 current))
            (cl-return mh-searcher))))
      nil)))