From 3ee035fec36201a0e9d2e3644273804a021d95a9 Mon Sep 17 00:00:00 2001 From: hmurata Date: Tue, 20 Sep 2005 01:54:02 +0000 Subject: [PATCH] * elmo-search.el (elmo-search-engine-alist): Define with defvar; Set default value as nil. (toplevel): Register search engines by `elmo-search-register-engine' if there are not defined. * elmo.el (autoload): Added autoload setting for `elmo-search-register-engine'. --- elmo/ChangeLog | 10 ++++++++++ elmo/elmo-search.el | 26 ++++++++++++++++---------- elmo/elmo.el | 3 ++- 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 14fbde3..b882def 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,13 @@ +2005-09-20 Hiroya Murata + + * elmo-search.el (elmo-search-engine-alist): Define with defvar; + Set default value as nil. + (toplevel): Register search engines by + `elmo-search-register-engine' if there are not defined. + + * elmo.el (autoload): Added autoload setting for + `elmo-search-register-engine'. + 2005-09-17 Hiroya Murata * elmo.el (toplevel): `[' is redefined as the prefix of the search diff --git a/elmo/elmo-search.el b/elmo/elmo-search.el index fe4f5ea..b9c7c4c 100644 --- a/elmo/elmo-search.el +++ b/elmo/elmo-search.el @@ -42,20 +42,12 @@ (other :tag "Use" t)) :group 'elmo) -(defcustom elmo-search-engine-alist - '((namazu local-file - :prog "namazu" - :args ("--all" "--list" "--early" pattern elmo-search-namazu-index) - :charset 'iso-2022-jp) - (grep local-file - :prog "grep" - :args ("-l" "-e" pattern elmo-search-grep-target))) +(defvar elmo-search-engine-alist nil "*An alist of search engines. Each element looks like (ENGINE CLASS PROPERTIES...) ENGINE is a symbol, the name of the search engine. CLASS is a symbol, the class name that performs a search. -PROPERTIES is a plist, it configure an engine with the CLASS." - :group 'elmo) +PROPERTIES is a plist, it configure an engine with the CLASS.") (defcustom elmo-search-default-engine 'namazu "*Default search engine for elmo-search folder." @@ -359,6 +351,20 @@ If the value is a list, all elements are used as index paths for namazu." files)) +;;; Setup `elmo-search-engine-alist' +(unless noninteractive + (or (assq 'namazu elmo-search-engine-alist) + (elmo-search-register-engine + 'namazu 'local-file + :prog "namazu" + :args '("--all" "--list" "--early" pattern elmo-search-namazu-index) + :charset 'iso-2022-jp)) + (or (assq 'grep elmo-search-engine-alist) + (elmo-search-register-engine + 'grep 'local-file + :prog "grep" + :args '("-l" "-e" pattern elmo-search-grep-target)))) + (require 'product) (product-provide (provide 'elmo-search) (require 'elmo-version)) diff --git a/elmo/elmo.el b/elmo/elmo.el index d71f2a5..6847d57 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -117,7 +117,8 @@ Otherwise, entire fetching of the message is aborted without confirmation." (autoload 'elmo-get-global-flags "elmo-flag") (autoload 'elmo-global-flags-initialize "elmo-flag") (autoload 'elmo-global-mark-migrate "elmo-flag") - (autoload 'elmo-folder-list-global-flag-messages "elmo-flag")) + (autoload 'elmo-folder-list-global-flag-messages "elmo-flag") + (autoload 'elmo-search-register-engine "elmo-search")) (defun elmo-define-folder (prefix backend) "Define a folder. -- 1.7.10.4