Function: mh-namazu-execute-search
mh-namazu-execute-search is a byte-compiled function defined in
mh-search.el.gz.
Signature
(mh-namazu-execute-search FOLDER-PATH SEARCH-REGEXP)
Documentation
Execute namazu.
In the examples below, replace "/home/user/Mail" with the path to your MH directory.
First create the directory "/home/user/Mail/.namazu". Then create the file "/home/user/Mail/.namazu/mknmzrc" with the following contents:
package conf; # Don't remove this line!
$ADDRESS = 'user@localhost';
$ALLOW_FILE = "[0-9]*";
$EXCLUDE_PATH = "^/home/user/Mail/(mhe-index|spam)";
This configuration does not index the folders that hold the results of your searches in "+mhe-index" since they tend to be ephemeral and the original messages are indexed anyway.
Use the following command line to generate the namazu index. Run this daily from cron:
mknmz -f /home/user/Mail/.namazu/mknmzrc -O /home/user/Mail/.namazu \
-q /home/user/Mail
In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP is used to search.
Source Code
;; Defined in /usr/src/emacs/lisp/mh-e/mh-search.el.gz
(defun mh-namazu-execute-search (folder-path search-regexp)
"Execute namazu.
In the examples below, replace \"/home/user/Mail\" with the path to
your MH directory.
First create the directory \"/home/user/Mail/.namazu\". Then create
the file \"/home/user/Mail/.namazu/mknmzrc\" with the following
contents:
package conf; # Don't remove this line!
$ADDRESS = \\='user@localhost\\=';
$ALLOW_FILE = \"[0-9]*\";
$EXCLUDE_PATH = \"^/home/user/Mail/(mhe-index|spam)\";
This configuration does not index the folders that hold the results of
your searches in \"+mhe-index\" since they tend to be ephemeral and
the original messages are indexed anyway.
Use the following command line to generate the namazu index. Run this
daily from cron:
mknmz -f /home/user/Mail/.namazu/mknmzrc -O /home/user/Mail/.namazu \\
-q /home/user/Mail
In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP
is used to search."
(let ((namazu-index-directory
(format "%s%s" mh-user-path mh-namazu-directory)))
(unless (file-exists-p namazu-index-directory)
(error "Namazu directory %s not present" namazu-index-directory))
(unless (executable-find mh-namazu-binary)
(error "Set `mh-namazu-binary' appropriately"))
(set-buffer (get-buffer-create mh-temp-index-buffer))
(erase-buffer)
(call-process mh-namazu-binary nil '(t nil) nil
"-alR" search-regexp namazu-index-directory)
(goto-char (point-min))
(setq mh-namazu-folder
(let ((last (substring folder-path (1- (length folder-path)))))
(if (equal last "/")
folder-path
(format "%s/" folder-path))))))