* wl-vars.el (wl-additional-search-condition-fields):
authorhmurata <hmurata>
Mon, 19 Jun 2006 08:28:37 +0000 (08:28 +0000)
committerhmurata <hmurata>
Mon, 19 Jun 2006 08:28:37 +0000 (08:28 +0000)
New user option.

* wl-util.el (wl-search-condition-fields): New function; export
from `wl-read-search-condition-internal'.
(wl-read-search-condition-internal): Use it.

* wl-folder.el (wl-folder-complete-filter-condition): Ditto.

wl/ChangeLog
wl/wl-folder.el
wl/wl-util.el
wl/wl-vars.el

index 92f8553..3d4fed3 100644 (file)
@@ -1,3 +1,14 @@
+2006-06-19  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
+
+       * wl-vars.el (wl-additional-search-condition-fields):
+       New user option.
+
+       * wl-util.el (wl-search-condition-fields): New function; export
+       from `wl-read-search-condition-internal'.
+       (wl-read-search-condition-internal): Use it.
+
+       * wl-folder.el (wl-folder-complete-filter-condition): Ditto.
+
 2006-06-10  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
 
        * wl-summary.el (wl-summary-define-sort-command): New function.
index ffff140..b4d3fc8 100644 (file)
@@ -3043,11 +3043,7 @@ Call `wl-summary-write-current-folder' with current folder name."
    (t
     (let ((candidate
           (mapcar (lambda (x) (list (concat (downcase x) ":")))
-                  (append '("last" "first"
-                            "from" "subject" "to" "cc" "body"
-                            "since" "before" "tocc"
-                            "larger" "smaller")
-                          elmo-msgdb-extra-fields))))
+                  (wl-search-condition-fields))))
       (if (not flag)
          (try-completion string candidate)
        (all-completions string candidate))))))
index 61d296d..e81fe2a 100644 (file)
@@ -1033,23 +1033,27 @@ is enclosed by at least one regexp grouping construct."
             (symbol-value variable))))))
 
 ;;; Search Condition
+(defun wl-search-condition-fields ()
+  (let ((denial-fields
+        (nconc (mapcar 'capitalize elmo-msgdb-extra-fields)
+               (mapcar 'capitalize wl-additional-search-condition-fields)
+               '("Flag" "Since" "Before"
+                 "From" "Subject" "To" "Cc" "Body" "ToCc"
+                 "Larger" "Smaller"))))
+    (append '("AND" "OR" "Last" "First")
+           denial-fields
+           (mapcar (lambda (f) (concat "!" f))
+                   denial-fields))))
+
 (defun wl-read-search-condition (default)
   "Read search condition string interactively."
   (wl-read-search-condition-internal "Search by" default))
 
 (defun wl-read-search-condition-internal (prompt default &optional paren)
   (let* ((completion-ignore-case t)
-        (denial-fields (nconc (mapcar 'capitalize elmo-msgdb-extra-fields)
-                              '("Flag" "Since" "Before"
-                                "From" "Subject" "To" "Cc" "Body" "ToCc"
-                                "Larger" "Smaller")))
         (field (completing-read
                 (format "%s (%s): " prompt default)
-                (mapcar 'list
-                        (append '("AND" "OR" "Last" "First")
-                                denial-fields
-                                (mapcar (lambda (f) (concat "!" f))
-                                        denial-fields)))))
+                (mapcar #'list (wl-search-condition-fields))))
         value)
     (setq field (if (string= field "")
                    (setq field default)
index a6e90aa..479f744 100644 (file)
@@ -727,6 +727,12 @@ when `wl-prefetch-confirm' is non-nil."
   :type 'boolean
   :group 'wl-summary)
 
+(defcustom wl-additional-search-condition-fields nil
+  "*A list of field name which is used for candidates of search condition."
+  :type '(repeat (string :tag "Field name"))
+  :group 'wl-pref
+  :group 'wl-setting)
+
 ;;;; Hooks
 (defvar wl-folder-mode-hook nil
   "A hook called when wanderlust folder mode is started.
@@ -1215,7 +1221,7 @@ In sync-all or rescan."
 
 (defcustom wl-score-files-directory (concat elmo-msgdb-directory elmo-path-sep)
   "*Name of the directory where score files will be stored.
-(default \"~/.elmo\")."
+\(default \"~/.elmo\")."
   :type 'directory
   :group 'wl)