]> code.delx.au - gnu-emacs/blobdiff - lisp/net/mairix.el
More CL cleanups and reduction of use of cl.el.
[gnu-emacs] / lisp / net / mairix.el
index 8c4bbb4a7858e3c6ede09e05d26166f7f5cd5d6b..f85983e6e9fa00b210657fde1c90485e518b5362 100644 (file)
@@ -1,6 +1,6 @@
 ;;; mairix.el --- Mairix interface for Emacs
 
-;; Copyright (C) 2008-2011  Free Software Foundation, Inc.
+;; Copyright (C) 2008-2012  Free Software Foundation, Inc.
 
 ;; Author: David Engster <dengste@eml.cc>
 ;; Keywords: mail searching
@@ -51,7 +51,7 @@
 ;; Currently, RMail, Gnus (with mbox files), and VM are supported as
 ;; mail programs, but it is pretty easy to interface it with other
 ;; ones as well.  Please see the docs and the source for details.
-;; In a nutshell: include your favourite mail program in
+;; In a nutshell: include your favorite mail program in
 ;; `mairix-mail-program' and write functions for
 ;; `mairix-display-functions' and `mairix-get-mail-header-functions'.
 ;; If you have written such functions for your Emacs mail program of
@@ -70,8 +70,6 @@
 (require 'widget)
 (require 'cus-edit)
 
-(eval-when-compile
-  (require 'cl))
 
 ;;; Keymappings
 
@@ -570,10 +568,10 @@ whole threads.  Function returns t if messages were found."
               mairix-output-buffer)))
     (zerop rval)))
 
-(defun mairix-replace-illegal-chars (header)
-  "Replace illegal characters in HEADER for mairix query."
+(defun mairix-replace-invalid-chars (header)
+  "Replace invalid characters in HEADER for mairix query."
   (when header
-    (while (string-match "[^-.@/,& [:alnum:]]" header)
+    (while (string-match "[^-.@/,^=~& [:alnum:]]" header)
       (setq header (replace-match "" t t header)))
     (while (string-match "[& ]" header)
       (setq header (replace-match "," t t header)))
@@ -620,7 +618,7 @@ See %s for details" mairix-output-buffer)))
         (concat
          (nth 1 cur)
          ":"
-         (mairix-replace-illegal-chars
+         (mairix-replace-invalid-chars
           (widget-value
           (cadr (assoc (concat "e" (car (cddr cur))) widgets)))))
         query)))
@@ -652,9 +650,17 @@ Fill in VALUES if based on an article."
     (kill-all-local-variables)
     (erase-buffer)
     (widget-insert
-     "Specify your query for Mairix (check boxes for activating fields):\n\n")
+     "Specify your query for Mairix using check boxes for activating fields.\n\n")
+    (widget-insert
+     (concat "Use ~word        to match messages "
+            (propertize "not" 'face 'italic)
+            " containing the word)\n"
+            "    substring=   to match words containing the substring\n"
+            "    substring=N  to match words containing the substring, allowing\n"
+            "                  up to N errors(missing/extra/different letters)\n"
+            "    ^substring=  to match the substring at the beginning of a word.\n"))
     (widget-insert
-     "(Whitespaces will be converted to ',' (i.e. AND). Use '/' for OR.)\n\n")
+     "Whitespace will be converted to ',' (i.e. AND).  Use '/' for OR.\n\n")
     (setq mairix-widgets (mairix-widget-build-editable-fields values))
     (when (member 'flags mairix-widget-other)
       (widget-insert "\nFlags:\n      Seen:     ")
@@ -935,7 +941,7 @@ Use cursor keys or C-n,C-p to select next/previous search.\n\n")
              (lambda (field)
                (list (car (cddr field))
                      (if (car field)
-                         (mairix-replace-illegal-chars
+                         (mairix-replace-invalid-chars
                           (funcall get-mail-header (car field)))
                        nil))))
             mairix-widget-fields-list)))
@@ -945,4 +951,3 @@ Use cursor keys or C-n,C-p to select next/previous search.\n\n")
 (provide 'mairix)
 
 ;;; mairix.el ends here
-