From: hmurata Date: Sat, 17 Sep 2005 09:43:26 +0000 (+0000) Subject: * elmo.el (toplevel): `[' is redefined as the prefix of the search X-Git-Tag: wl-2_15_3~55 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6890f558f194bb6bca951898e3cc61b57e7080bb;p=elisp%2Fwanderlust.git * elmo.el (toplevel): `[' is redefined as the prefix of the search folder instead of nmz folder. (elmo-nmz-default-index-path): Added obsolete variable setting. (elmo-nmz-index-alias-alist): Ditto. (elmo-nmz-use-drive-letter): Ditto. * elmo-search.el (elmo-search-register-engine): New function. * elmo-nmz.el: Removed. * WL-ELS (ELMO-MODULES): Removed elmo-nmz. --- diff --git a/ChangeLog b/ChangeLog index f468d65..47ecca3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-09-17 Hiroya Murata + + * WL-ELS (ELMO-MODULES): Removed elmo-nmz. + 2005-09-10 Hiroya Murata * WL-ELS (ELMO-MODULES): Added elmo-search. diff --git a/NEWS b/NEWS index d43c655..7b469a7 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,9 @@ Wanderlust NEWS -- User-visible changes in Wanderlust. +* Changes in 2.16.0 from 2.14.x + +** A folder type `namazu' is abolished. New folder type `search' is added instead. + * Changes in 2.14.1 from 2.14.0 Version 2.14.1 is a bug fix version of 2.14.0. diff --git a/NEWS.ja b/NEWS.ja index 7cb0582..2459131 100644 --- a/NEWS.ja +++ b/NEWS.ja @@ -1,5 +1,11 @@ Wanderlust NEWS ($BF|K\8lHG(B) -- User-visible changes in Wanderlust. +* 2.14.x $B$+$i(B 2.16.0 $B$X$NJQ99E@(B + +** namazu $B%U%)%k%@$O5!G=$r3HD%$7$?(B search $B%U%)%k%@$KCV$-49$($i$l$^$7$?!#(B + namazu $B0J30$N30It%W%m%0%i%`$r;H$C$?8!:w$,=PMh$k$h$&$K$J$j$^$7$?!#%G(B + $B%U%)%k%H$G$O!"(Bgrep $B$G$N8!:w$,%5%]!<%H$5$l$F$$$^$9!#(B + * 2.14.0 $B$+$i(B 2.14.1 $B$X$NJQ99E@(B 2.14.1 $B$O!"(B2.14.0 $B$N%P%0=$@5HG$G$9!#(B diff --git a/WL-ELS b/WL-ELS index e4ec931..f54144c 100644 --- a/WL-ELS +++ b/WL-ELS @@ -23,7 +23,7 @@ elmo-multi elmo-access elmo-filter elmo-archive elmo-pipe elmo-cache elmo-internal elmo-flag elmo-sendlog elmo-null - elmo-dop elmo-nmz elmo-search elmo-file elmo-split + elmo-dop elmo-search elmo-file elmo-split elmo-spam elsp-bogofilter elsp-sa elsp-bsfilter elsp-spamoracle modb modb-entity modb-legacy modb-standard )) diff --git a/doc/wl-ja.texi b/doc/wl-ja.texi index d8008d5..7bf622d 100644 --- a/doc/wl-ja.texi +++ b/doc/wl-ja.texi @@ -695,7 +695,7 @@ Wanderlust $B$O(B ELMO $B$N%$%s%?%U%'!<%9$rMxMQ$7$F$$$k$?$a!"(BELMO $B%b%8% $B%5%]!<%H$7$F$$$l$P!"$I$s$J%U%)%k%@$G$bMxMQ$G$-$^$9!#(B $B%P!<%8%g%s(B @value{VERSION} $B8=:_!"MQ0U$5$l$F$$$k%U%)%k%@$O!"(BIMAP, NNTP, -LocalDir(MH), Maildir, News Spool, Archive, POP, Shimbun, Namazu, Multi, +LocalDir(MH), Maildir, News Spool, Archive, POP, Shimbun, Search, Multi, Filter, Pipe, File, Access, Internal $B$N(B 15 $BH$7$F$/$@$5$$!#(B '("^@@airs\\." "^@@namazu\\.")) @end example -$B%5%^%j$NI=<($r99?7$9$k$K$O!"%U%'%C%A$7$?8e$K(B @kbd{s rescan} $B$,I,MW$G$9!#(B +$B%5%^%j$NI=<($O!"<+F0E*$K99?7$5$l$^$9!#(B @end table -@node Namazu Folder, Multi Folder, Shimbun Folder, Folders -@section Namazu $B%U%)%k%@(B -@cindex Namazu Folder +@node Search Folder, namazu, Shimbun Folder, Folders +@section $B8!:w%U%)%k%@(B +@cindex Search Folder @cindex @samp{[} -@cindex Folder, Namazu +@cindex Folder, Search @cindex Folder, Text Search -@pindex Namazu -@pindex nmz -namazu (@uref{http://www.namazu.org/}) $B$rMQ$$$F!"8!:w<0$K%^%C%A$7$?(B -$B%a%C%;!<%8$r=8$a$?2>A[E*$J%U%)%k%@$r9=@.$7$^$9!#(B + +$B30It%W%m%0%i%`$rMQ$$$F!"8!:w<0$K%^%C%A$7$?%a%C%;!<%8$r=8$a$?2>A[E*$J%U%)(B +$B%k%@$r9=@.$7$^$9!#(B $B=q<0(B: @example @group -@samp{[} @var{namazu $B8!:w<0(B} @samp{]} [ @var{$B%$%s%G%C%/%9$N%Q%9!J@dBP%Q%9!K(B} ] +@samp{[} @var{$B8!:w<0(B} @samp{]} [ @var{$B8!:wBP>](B} [ @samp{!} @var{$B8!:wJ}<0(B} ] ] @end group @end example -$B%$%s%G%C%/%9$N%Q%9$N%G%U%)%k%HCM$O(B @code{elmo-nmz-default-index-path} $B$G;XDj$G$-$^$9!#(B +$B8!:w<0$H8!:wBP>]$N;XDjJ}K!$O!"8!:wJ}<0$K$h$C$F0[$J$j$^$9!#(B + +@subsection $BBP1~$7$F$$$k8!:wJ}<0(B + +$B%G%U%)%k%H$G$O!"0J2<$N8!:wJ}<0$KBP1~$7$F$$$^$9!#8!:wJ}<0$r>JN,$7$?>l9g$O!"(B +@code{elmo-search-default-engine} $B$G;XDj$5$l$?8!:wJ}<0$,;HMQ$5$l$^$9!#(B + +@menu +* namazu:: namazu +* grep:: grep +@end menu + + +@node namazu, grep, Search Folder, Folders +@section namazu +@pindex namazu + +namazu (@uref{http://www.namazu.org/}) $B$r;H$C$F!"%$%s%G%C%/%9$KEPO?$5$l$?(B +$BJ8=q$r8!:w$7$^$9!#(B + +$B8!:w<0$O!"(Bnamazu $B$N8!:w<0$G$9!#>\$7$/$O!"(Bnamazu $B$KIUB0$NJ8=q$r;2>H$7$F2<(B +$B$5$$!#(B + +$B8!:wBP>]$K$O!";HMQ$9$k%$%s%G%C%/%9$r;XDj$7$^$9!#%$%s%G%C%/%9$N$"$k%G%#%l(B +$B%/%H%j$N%Q%9$r$=$N$^$^;XDj$9$k$+!"0J2<$N@bL@$K$"$kJLL>$r;XDj$9$k;v$,=PMh(B +$B$^$9!#%$%s%G%C%/%9$r>JN,$7$?>l9g$O!"(B +@code{elmo-search-namazu-default-index-path} $B$G;XDj$5$l$?CM$,;HMQ$5$l$^$9!#(B $BNc(B: @@ -1404,7 +1429,7 @@ namazu (@uref{http://www.namazu.org/}) $B$rMQ$$$F!"8!:w<0$K%^%C%A$7$?(B $B%$%s%G%C%/%9$K$O%(%$%j%"%9L>(B($BJLL>(B)$B$rDj5A$G$-$^$9!#(B @example -(setq elmo-nmz-index-alias-alist +(setq elmo-search-namazu-index-alias-alist '(("cache" . "~/.elmo/cache") ("docs" . "~/documents"))) @end example @@ -1421,14 +1446,15 @@ namazu (@uref{http://www.namazu.org/}) $B$rMQ$$$F!"8!:w<0$K%^%C%A$7$?(B @subsubsection $BJ#?t%$%s%G%C%/%9$N;XDj(B -@code{elmo-nmz-default-index-path}, @code{elmo-nmz-index-alias-alist} $B$N(B -$BCM$H$7$F%$%s%G%C%/%9$N%j%9%H$r;XDj$9$k$3$H$b2DG=$G$9!#(B -$B%j%9%H$r;XDj$9$k$H!"J#?t$N%$%s%G%C%/%9$rBP>]$H$7$?8!:w$H$J$j$^$9!#(B +@code{elmo-search-namazu-default-index-path}, +@code{elmo-search-namazu-index-alias-alist} $B$NCM$H$7$F%$%s%G%C%/%9$N%j%9(B +$B%H$r;XDj$9$k$3$H$b2DG=$G$9!#%j%9%H$r;XDj$9$k$H!"J#?t$N%$%s%G%C%/%9$rBP>](B +$B$H$7$?8!:w$H$J$j$^$9!#(B $BNc$($P!"(B @example -(setq elmo-nmz-index-alias-alist +(setq elmo-search-namazu-index-alias-alist '(("all" . ("~/.elmo/cache" "~/documents")) ("cache" . "~/.elmo/cache"))) @end example @@ -1439,10 +1465,34 @@ namazu (@uref{http://www.namazu.org/}) $B$rMQ$$$F!"8!:w<0$K%^%C%A$7$?(B [wanderlust]all @end example -$B$HF~NO$9$l$P!"(B@file{~/.elmo/cache} $B$H(B @file{~/documents} $B$N%$%s%G%C%/%9$rBP>]$H$7$F!"%-!<%o!<%I(B @samp{wanderlust} $B$G8!:w$r9T$$$^$9!#(B +$B$HF~NO$9$l$P!"(B@file{~/.elmo/cache} $B$H(B @file{~/documents} $B$N%$%s%G%C%/%9$r(B +$BBP>]$H$7$F!"%-!<%o!<%I(B @samp{wanderlust} $B$G8!:w$r9T$$$^$9!#(B + +@node grep, Multi Folder, namazu, Folders +@section grep +@pindex grep + +grep $B$r;H$C$F!"8!:wBP>]$G;XDj$5$l$?%G%#%l%/%H%j$K$"$k%U%!%$%k$r8!:w$7$^$9!#(B + +$B8!:w<0$K$O!"(Bgrep $B$N@55,I=8=$r;XDj$7$^$9!#8!:wBP>]$H$9$k%G%#%l%/%H%j$r>JN,(B +$B$9$k;v$O=PMh$^$;$s!#(B + +$BNc(B: + +@example +@group +[wanderlust]~/Mail/inbox!grep + -> $B%G%#%l%/%H%j(B "~/Mail/inbox" $B$+$i(B + "wanderlust" $B$K%^%C%A$9$k$b$N$rC5$9(B + +["[sr]emi"]~/Mail/semi!grep + -> $B8!:w<0$,(B @samp{]} $B$r4^$`@55,I=8=$G$"$k>l9g$O!"(B + @samp{"} $B$G0O$`I,MW$,$"$j$^$9(B +@end group +@end example -@node Multi Folder, Filter Folder, Namazu Folder, Folders +@node Multi Folder, Filter Folder, grep, Folders @section $B%^%k%A%U%)%k%@(B @cindex @samp{*} @cindex Multi Folder diff --git a/doc/wl.texi b/doc/wl.texi index 47f592b..396f7c9 100644 --- a/doc/wl.texi +++ b/doc/wl.texi @@ -673,7 +673,7 @@ supported by ELMO. As of version @value{VERSION}, 15 types of folders are predefined. These are IMAP, NNTP, LocalDir(MH), Maildir, News Spool, Archive, POP, -Shimbun, Namazu, Multi, Filter, Pipe, File, Access and Internal folder +Shimbun, Search, Multi, Filter, Pipe, File, Access and Internal folder types. @menu @@ -685,7 +685,7 @@ types. * Archive Folder:: @samp{$} -- Archive folder * POP Folder:: @samp{&} -- POP folder * Shimbun Folder:: @samp{@@} -- Shimbun Folder -* Namazu Folder:: @samp{[} -- Namazu Folder +* Search Folder:: @samp{[} -- Search Folder * Multi Folder:: @samp{*} -- Multi folder * Filter Folder:: @samp{/} -- Filter folder * Pipe Folder:: @samp{|} -- Pipe folder @@ -1280,7 +1280,7 @@ normal connection in these cases, add @samp{!direct} at the end of folder name. -@node Shimbun Folder, Namazu Folder, POP Folder, Folders +@node Shimbun Folder, Search Folder, POP Folder, Folders @section Shimbun Folder @cindex @samp{@@} @cindex Shimbun Folder @@ -1332,30 +1332,56 @@ Example: '("^@@airs\\." "^@@namazu\\.")) @end example -@kbd{s rescan} is needed after fetching to update summary view. +Update summary view automatically after fetching. @end table -@node Namazu Folder, Multi Folder, Shimbun Folder, Folders -@section Namazu Folder +@node Search Folder, namazu, Shimbun Folder, Folders +@section Search Folder @cindex @samp{[} -@cindex Namazu Folder -@cindex Folder, Namazu +@cindex Search Folder +@cindex Folder, Search @cindex Folder, Text Search -@pindex Namazu -@pindex nmz -A folder to access messages found in namazu-index with some condition. -It uses namazu (@uref{http://www.namazu.org/}) for search. + +A folder to access messages found by an external program with some +condition. Format: @example @group -@samp{[} @var{search condition} @samp{]} [ @var{absolute path of namazu index} ] +@samp{[} @var{search condition} @samp{]} [ @var{search target} [ @samp{!} @var{search engine} ] ] @end group @end example -Default value of the path of namazu index can be assigned by @code{elmo-nmz-default-index-path}. +The format of the @var{search condition} and @var{search target} depend +on the @var{search engine}. + +@subsection Supported search engines + +Supported search engines are following ones. Default search engine can +be assigned by @code{elmo-search-default-engine}. + +@menu +* namazu:: namazu +* grep:: grep +@end menu + + +@node namazu, grep, Search Folder, Folders +@section namazu +@pindex namazu + +The messages registered in the namazu-index is found by using namazu +(@uref{http://www.namazu.org/}). + +@var{search condition} is a query of namazu. Please refer to the +document of the attached to namazu for details. + +@var{search target} is a namazu-index used for search. The directory +with the index or the alias that explain in the following can be +specified. Default value of the path of namazu index can be assigned by +@code{elmo-search-namazu-default-index-path}. Example: @@ -1381,7 +1407,7 @@ You can define an alias name for index. Example: @example -(setq elmo-nmz-index-alias-alist +(setq elmo-search-namazu-index-alias-alist '(("cache" . "~/.elmo/cache") ("docs" . "~/documents"))) @end example @@ -1398,15 +1424,15 @@ directory @file{~/.elmo/cache}. @subsubsection Multiple indices -You can specify a list for @code{elmo-nmz-default-index-path} and -@code{elmo-nmz-index-alias-alist}. +You can specify a list for @code{elmo-search-namazu-default-index-path} and +@code{elmo-search-namazu-index-alias-alist}. When list is specified, all index contained in the list is used as the namazu indices. Example: @example -(setq elmo-nmz-index-alias-alist +(setq elmo-search-namazu-index-alias-alist '(("all" . ("~/.elmo/cache" "~/documents")) ("cache" . "~/.elmo/cache"))) @end example @@ -1420,7 +1446,32 @@ Using above alias setting, you can specify to execute a namazu search with keyword @samp{wanderlust} using indices in the directory @file{~/.elmo/cache} and @file{~/documents}. -@node Multi Folder, Filter Folder, Namazu Folder, Folders +@node grep, Multi Folder, namazu, Folders +@section grep +@pindex grep + +The files that exists in the directory specified with the @var{search +target} are found by using grep. + +@var{search condition} is a regular expression of grep. The directory +as @var{search target} cannot be omitted. + +Example: + +@example +@group +[wanderlust]~/Mail/inbox!grep + -> search messages matched with "wanderlust" + from the directory "~/Mail/inbox" + +["[sr]emi"]~/Mail/semi!grep + -> If @samp{]} is included in regular expression, + @var{search condition} should be enclosed with @samp{"}. +@end group +@end example + + +@node Multi Folder, Filter Folder, grep, Folders @section Multi Folder @cindex @samp{*} @cindex Multi Folder diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 9faf2e6..14fbde3 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,5 +1,15 @@ 2005-09-17 Hiroya Murata + * elmo.el (toplevel): `[' is redefined as the prefix of the search + folder instead of nmz folder. + (elmo-nmz-default-index-path): Added obsolete variable setting. + (elmo-nmz-index-alias-alist): Ditto. + (elmo-nmz-use-drive-letter): Ditto. + + * elmo-search.el (elmo-search-register-engine): New function. + + * elmo-nmz.el: Removed. + * elmo-version.el (elmo-version): Up to 2.15.2. 2005-09-10 Hiroya Murata diff --git a/elmo/elmo-nmz.el b/elmo/elmo-nmz.el deleted file mode 100644 index 56adf88..0000000 --- a/elmo/elmo-nmz.el +++ /dev/null @@ -1,256 +0,0 @@ -;;; elmo-nmz.el --- Namazu interface for ELMO. - -;; Copyright (C) 2000 Yuuichi Teranishi - -;; Author: Yuuichi Teranishi -;; Keywords: mail, net news - -;; This file is part of ELMO (Elisp Library for Message Orchestration). - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. -;; -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. -;; -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. -;; - -;;; Commentary: -;; - -;;; Code: -;; -(eval-when-compile (require 'cl)) - -(require 'elmo) -(require 'elmo-map) -(require 'mime-edit) - -(defcustom elmo-nmz-default-index-path "~/Mail" - "*Default index path for namazu. -If the value is a list, all elements are used as index paths for namazu." - :type 'directory - :group 'elmo) - -(defcustom elmo-nmz-prog "namazu" - "*Program name of namazu." - :type 'string - :group 'elmo) - -(defcustom elmo-nmz-charset 'iso-2022-jp - "*Charset for namazu argument." - :type 'symbol - :group 'elmo) - -(defcustom elmo-nmz-args '("--all" "--list" "--late") - "*Argument list for namazu to list matched files." - :type '(repeat string) - :group 'elmo) - -(defcustom elmo-nmz-index-alias-alist nil - "*Alist of ALIAS and INDEX-PATH." - :type '(repeat (cons (string :tag "Alias Name") - (choice (directory :tag "Index Path") - (repeat (directory :tag "Index Path"))))) - :group 'elmo) - -(defvar elmo-nmz-use-drive-letter (if (memq system-type - '(OS/2 emx windows-nt)) t nil) - "*If non-nil, do a drive letter conversion (e.g. /a|/ => a:/).") - -;;; "namazu search" -(eval-and-compile - (luna-define-class elmo-nmz-folder - (elmo-map-folder) (pattern index-path)) - (luna-define-internal-accessors 'elmo-nmz-folder)) - -(luna-define-method elmo-folder-initialize ((folder - elmo-nmz-folder) - name) - (when (> (length name) 0) - (with-temp-buffer - (insert "[" name) - (goto-char (point-min)) - (forward-sexp) - (elmo-nmz-folder-set-pattern-internal folder - (buffer-substring - (+ 1 (point-min)) - (- (point) 1))) - (let ((index (buffer-substring (point) (point-max)))) - (elmo-nmz-folder-set-index-path-internal - folder - (cond ((cdr (assoc index elmo-nmz-index-alias-alist))) - ((eq (length index) 0) - elmo-nmz-default-index-path) - (t - index)))))) - folder) - -(luna-define-method elmo-folder-expand-msgdb-path ((folder - elmo-nmz-folder)) - (expand-file-name - (elmo-replace-string-as-filename - (elmo-folder-name-internal folder)) - (expand-file-name "nmz" elmo-msgdb-directory))) - -(defun elmo-nmz-msgdb-create-entity (msgdb folder number) - "Create msgdb entity for the message in the FOLDER with NUMBER." - (let ((location (expand-file-name (elmo-map-message-location folder number))) - entity uid) - (setq entity (elmo-msgdb-create-message-entity-from-file - (elmo-msgdb-message-entity-handler msgdb) number location)) - (unless (or (elmo-message-entity-field entity 'to) - (elmo-message-entity-field entity 'cc) - (not (string= (elmo-message-entity-field entity 'subject) - elmo-no-subject))) - (elmo-message-entity-set-field entity 'subject location) - (setq uid (nth 2 (file-attributes location))) - (elmo-message-entity-set-field entity 'from - (concat - (user-full-name uid) - " <"(user-login-name uid) "@" - (system-name) ">"))) - entity)) - -(luna-define-method elmo-folder-msgdb-create ((folder elmo-nmz-folder) - numlist flag-table) - (let ((new-msgdb (elmo-make-msgdb)) - entity mark i percent num) - (setq num (length numlist)) - (setq i 0) - (message "Creating msgdb...") - (while numlist - (setq entity - (elmo-nmz-msgdb-create-entity - new-msgdb folder (car numlist))) - (when entity - (elmo-msgdb-append-entity new-msgdb entity '(new unread))) - (when (> num elmo-display-progress-threshold) - (setq i (1+ i)) - (setq percent (/ (* i 100) num)) - (elmo-display-progress - 'elmo-folder-msgdb-create "Creating msgdb..." - percent)) - (setq numlist (cdr numlist))) - (message "Creating msgdb...done") - new-msgdb)) - -(luna-define-method elmo-folder-message-file-p ((folder elmo-nmz-folder)) - t) - -(luna-define-method elmo-message-file-name ((folder elmo-nmz-folder) - number) - (elmo-map-message-location folder number)) - -(luna-define-method elmo-folder-message-make-temp-file-p - ((folder elmo-nmz-folder)) - t) - -(luna-define-method elmo-folder-diff ((folder elmo-nmz-folder)) - (cons nil nil)) - -(luna-define-method elmo-folder-message-make-temp-files ((folder - elmo-nmz-folder) - numbers - &optional - start-number) - (let ((temp-dir (elmo-folder-make-temporary-directory folder)) - (cur-number (if start-number 0))) - (dolist (number numbers) - (elmo-copy-file - (elmo-message-file-name folder number) - (expand-file-name - (int-to-string (if start-number (incf cur-number) number)) - temp-dir))) - temp-dir)) - -(luna-define-method elmo-map-message-fetch ((folder elmo-nmz-folder) - location strategy - &optional section unseen) - (when (file-exists-p location) - (prog1 - (insert-file-contents-as-binary (expand-file-name location)) - (unless (or (std11-field-body "To") - (std11-field-body "Cc") - (std11-field-body "Subject")) - (let (charset guess uid) - (erase-buffer) - (set-buffer-multibyte t) - (insert-file-contents (expand-file-name location)) - (setq charset (detect-mime-charset-region (point-min) - (point-max))) - (goto-char (point-min)) - (setq guess (mime-find-file-type location)) - (setq uid (nth 2 (file-attributes location))) - (insert "From: " (concat (user-full-name uid) - " <"(user-login-name uid) "@" - (system-name) ">") "\n") - (insert "Subject: " location "\n") - (insert "Content-Type: " - (concat (nth 0 guess) "/" (nth 1 guess)) - "; charset=" (upcase (symbol-name charset)) - "\nMIME-Version: 1.0\n\n") - (encode-mime-charset-region (point-min) (point-max) charset) - (set-buffer-multibyte nil)))))) - -(luna-define-method elmo-map-folder-list-message-locations - ((folder elmo-nmz-folder)) - (let (bol locations) - (with-temp-buffer - (apply 'call-process elmo-nmz-prog nil t t - (append elmo-nmz-args - (list - (encode-mime-charset-string - (elmo-nmz-folder-pattern-internal folder) - elmo-nmz-charset)) - (if (listp (elmo-nmz-folder-index-path-internal folder)) - (mapcar - 'expand-file-name - (elmo-nmz-folder-index-path-internal folder)) - (list - (expand-file-name - (elmo-nmz-folder-index-path-internal folder)))))) - (goto-char (point-min)) - (while (not (eobp)) - (beginning-of-line) - ;; convert url to file path. - (when (looking-at "^file://") - (replace-match "")) - (when (and elmo-nmz-use-drive-letter - (looking-at "^/\\([A-Za-z]\\)|/")) - (replace-match "\\1:/") - (beginning-of-line)) - (setq bol (point)) - (end-of-line) - (setq locations (cons (buffer-substring bol (point)) locations)) - (forward-line 1)) - (nreverse locations)))) - -(luna-define-method elmo-folder-exists-p ((folder elmo-nmz-folder)) - (elmo-nmz-folder-pattern-internal folder)) - -(luna-define-method elmo-folder-have-subfolder-p ((folder elmo-nmz-folder)) - (null (elmo-nmz-folder-pattern-internal folder))) - -(luna-define-method elmo-folder-list-subfolders ((folder elmo-nmz-folder) - &optional one-level) - (mapcar (lambda (name) (elmo-recover-string-from-filename name)) - (directory-files (expand-file-name "nmz" elmo-msgdb-directory) - nil - (concat - "^" - (regexp-quote - (elmo-folder-prefix-internal folder)))))) - -(require 'product) -(product-provide (provide 'elmo-nmz) (require 'elmo-version)) - -;;; elmo-nmz.el ends here diff --git a/elmo/elmo-search.el b/elmo/elmo-search.el index 3110249..fe4f5ea 100644 --- a/elmo/elmo-search.el +++ b/elmo/elmo-search.el @@ -94,6 +94,13 @@ Returns non-nil if fetching was succeed.") :param param (cdr spec)))) +(defun elmo-search-register-engine (name class &rest properties) + (let ((cell (assq name elmo-search-engine-alist)) + (spec (cons class properties))) + (if cell + (setcdr cell spec) + (setq elmo-search-engine-alist + (cons (cons name spec) elmo-search-engine-alist))))) ;; ELMO search folder (eval-and-compile @@ -341,6 +348,7 @@ If the value is a list, all elements are used as index paths for namazu." (mapcar 'expand-file-name index) (expand-file-name index)))) + ;; grep (defun elmo-search-grep-target (engine) (let ((dirname (expand-file-name (elmo-search-engine-param-internal engine))) diff --git a/elmo/elmo.el b/elmo/elmo.el index 88a380d..d71f2a5 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -1772,7 +1772,7 @@ Return a hashtable for newsgroups." (elmo-define-folder ?| 'pipe) (elmo-define-folder ?. 'maildir) (elmo-define-folder ?' 'internal) -(elmo-define-folder ?\[ 'nmz) +(elmo-define-folder ?\[ 'search) (elmo-define-folder ?@ 'shimbun) ;;; Obsolete variables. @@ -1812,6 +1812,13 @@ Return a hashtable for newsgroups." 'elmo-msgdb-directory) (elmo-define-obsolete-variable 'elmo-global-flag-list 'elmo-global-flags) +(elmo-define-obsolete-variable 'elmo-nmz-default-index-path + 'elmo-search-namazu-default-index-path) +(elmo-define-obsolete-variable 'elmo-nmz-index-alias-alist + 'elmo-search-namazu-index-alias-alist) +(elmo-define-obsolete-variable 'elmo-nmz-use-drive-letter + 'elmo-search-use-drive-letter) + ;; Obsolete functions. ;; 2001-12-11: *-dir -> *-directory