Function: mh-swish++-execute-search

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

Signature

(mh-swish++-execute-search FOLDER-PATH SEARCH-REGEXP)

Documentation

Execute swish++.

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

First create the directory "/home/user/Mail/.swish++". Then create the file "/home/user/Mail/.swish++/swish++.conf" with the following contents:

     IncludeMeta Bcc Cc Comments Content-Description From Keywords
     IncludeMeta Newsgroups Resent-To Subject To
     IncludeMeta Message-Id References In-Reply-To
     IncludeFile Mail *
     IndexFile /home/user/Mail/.swish++/swish++.index

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

     find /home/user/Mail -path /home/user/Mail/mhe-index -prune \
                          -o -path /home/user/Mail/.swish++ -prune \
                          -o -name "[0-9]*" -print \
         | index -c /home/user/Mail/.swish++/swish++.conf -

This command 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.

On some systems (Debian GNU/Linux, for example), use "index++" instead of "index".

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-swish++-execute-search (folder-path search-regexp)
  "Execute swish++.

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

First create the directory \"/home/user/Mail/.swish++\". Then create
the file \"/home/user/Mail/.swish++/swish++.conf\" with the following
contents:

     IncludeMeta         Bcc Cc Comments Content-Description From Keywords
     IncludeMeta         Newsgroups Resent-To Subject To
     IncludeMeta         Message-Id References In-Reply-To
     IncludeFile         Mail    *
     IndexFile           /home/user/Mail/.swish++/swish++.index

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

     find /home/user/Mail -path /home/user/Mail/mhe-index -prune \\
                          -o -path /home/user/Mail/.swish++ -prune \\
                          -o -name \"[0-9]*\" -print \\
         | index -c /home/user/Mail/.swish++/swish++.conf -

This command 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.

On some systems (Debian GNU/Linux, for example), use \"index++\"
instead of \"index\".

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