From: hmurata Date: Mon, 19 Jun 2006 08:28:37 +0000 (+0000) Subject: * wl-vars.el (wl-additional-search-condition-fields): X-Git-Tag: wl-2_15_4~27 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=7d3196d3733fc2d3b2387d14069a331b49a3e9af;p=elisp%2Fwanderlust.git * 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. --- diff --git a/wl/ChangeLog b/wl/ChangeLog index 92f8553..3d4fed3 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,14 @@ +2006-06-19 Hiroya Murata + + * 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 * wl-summary.el (wl-summary-define-sort-command): New function. diff --git a/wl/wl-folder.el b/wl/wl-folder.el index ffff140..b4d3fc8 100644 --- a/wl/wl-folder.el +++ b/wl/wl-folder.el @@ -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)))))) diff --git a/wl/wl-util.el b/wl/wl-util.el index 61d296d..e81fe2a 100644 --- a/wl/wl-util.el +++ b/wl/wl-util.el @@ -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) diff --git a/wl/wl-vars.el b/wl/wl-vars.el index a6e90aa..479f744 100644 --- a/wl/wl-vars.el +++ b/wl/wl-vars.el @@ -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)