Function: mh-flists-execute

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

Signature

(mh-flists-execute &rest IGNORED)

Documentation

Execute flists.

Search for messages belonging to mh-flists-sequence in the folders specified by mh-flists-search-folders. If mh-recursive-folders-flag is t, then the folders are searched recursively. All arguments are IGNORED.

Source Code

;; Defined in /usr/src/emacs/lisp/mh-e/mh-search.el.gz
(defun mh-flists-execute (&rest _ignored)
  "Execute flists.
Search for messages belonging to `mh-flists-sequence' in the
folders specified by `mh-flists-search-folders'. If
`mh-recursive-folders-flag' is t, then the folders are searched
recursively. All arguments are IGNORED."
  (set-buffer (get-buffer-create mh-temp-index-buffer))
  (erase-buffer)
  (unless (executable-find "sh")
    (error "Didn't find sh"))
  (with-temp-buffer
    (let ((seq (symbol-name mh-flists-sequence)))
      (insert "for folder in `" (expand-file-name "flists" mh-progs) " "
              (cond ((eq mh-flists-search-folders t)
                     (mh-quote-for-shell mh-inbox))
                    ((eq mh-flists-search-folders nil) "")
                    ((listp mh-flists-search-folders)
                     (cl-loop for folder in mh-flists-search-folders
                              concat
                              (concat " " (mh-quote-for-shell folder)))))
              (if mh-recursive-folders-flag " -recurse" "")
              " -sequence " seq " -noshowzero -fast` ; do\n"
              (expand-file-name "mhpath" mh-progs) " \"+$folder\" " seq "\n"
              "done\n"))
    (call-process-region
     (point-min) (point-max) "sh" nil (get-buffer mh-temp-index-buffer))))