Function: mh-mairix-execute-search

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

Signature

(mh-mairix-execute-search FOLDER-PATH SEARCH-REGEXP-LIST)

Documentation

Execute mairix.

In the examples below, replace "/home/user/Mail" with the path to your MH directory.

First create the directory "/home/user/Mail/.mairix". Then create the file "/home/user/Mail/.mairix/config" with the following contents:

     base=/home/user/Mail

     # List of folders that should be indexed. 3 dots at the end means there
     # are subfolders within the folder
     mh=archive...:inbox:drafts:news:sent:trash

     vfolder_format=mh
     database=/home/user/Mail/.mairix/database

Use the following command line to generate the mairix index. Run this daily from cron:

     mairix -f /home/user/Mail/.mairix/config

In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP-LIST is used to search.

Source Code

;; Defined in /usr/src/emacs/lisp/mh-e/mh-search.el.gz
(defun mh-mairix-execute-search (folder-path search-regexp-list)
  "Execute mairix.

In the examples below, replace \"/home/user/Mail\" with the path
to your MH directory.

First create the directory \"/home/user/Mail/.mairix\". Then
create the file \"/home/user/Mail/.mairix/config\" with the
following contents:

     base=/home/user/Mail

     # List of folders that should be indexed. 3 dots at the end means there
     # are subfolders within the folder
     mh=archive...:inbox:drafts:news:sent:trash

     vfolder_format=mh
     database=/home/user/Mail/.mairix/database

Use the following command line to generate the mairix index. Run
this daily from cron:

     mairix -f /home/user/Mail/.mairix/config

In a program, FOLDER-PATH is the directory in which
SEARCH-REGEXP-LIST is used to search."
  (set-buffer (get-buffer-create mh-temp-index-buffer))
  (erase-buffer)
  (unless mh-mairix-binary
    (error "Set `mh-mairix-binary' appropriately"))
  (apply #'call-process mh-mairix-binary nil '(t nil) nil
         "-r" "-f" (format "%s%s/config" mh-user-path mh-mairix-directory)
         search-regexp-list)
  (goto-char (point-min))
  (setq mh-mairix-folder
        (let ((last-char (substring folder-path (1- (length folder-path)))))
          (if (equal last-char "/")
              folder-path
            (format "%s/" folder-path)))))