[Mew-dist 08241] Re: namazu.el for mew
Hideyuki SHIRAI ( 白井秀行 )
shirai at example.com
1999年 3月 23日 (火) 20:21:21 JST
im-111 で mew-namazu を試していただける方は、以下のパッチでお願
いします。(__)
--
ほんの少しだけ賢くなった? 白井
--- imls.in.orig Tue Mar 23 18:37:00 1999
+++ imls.in Tue Mar 23 20:19:06 1999
@@ -29,7 +29,7 @@
use vars qw($Prog $EXPLANATION @OptConfig
@servers
$opt_form $opt_jissafe $opt_width $opt_thread @opt_src
- $opt_indent $opt_grep $opt_delimiter $opt_casefold
+ $opt_indent $opt_grep $opt_namazu $opt_delimiter $opt_casefold
$opt_verbose $opt_debug $opt_quiet $opt_help $opt_buffer);
##
@@ -64,6 +64,7 @@
'thread;b;;' => 'Make threads',
'indent;i;;' => "Width of thread indent",
'grep;s;;' => "Grep pattern for vscan",
+ 'namazu;b;;' => "Use namazu for vscan",
'casefold;b;on;' => 'Case sensitivity'.
"\n\t\t(This option affects both fieldname and pattern.)",
'delimiter;s;\n\n|\n----\n;' => 'Mail header delimiter',
@@ -102,7 +103,11 @@
} elsif ($opt_grep) {
require IM::Folder && import IM::Folder;
require IM::Grep && import IM::Grep;
- &vscan();
+ if ($opt_namazu){
+ &vscan_namazu(@ARGV);
+ } else {
+ &vscan();
+ }
exit $EXIT_SUCCESS;
} else {
if (scalar(@opt_src) != 1) {
@@ -376,6 +381,39 @@
foreach ( @messages ) {
if ( -f "$folder_dir/$_" ) {
my %Head = &get_header("$folder_dir/$_");
+ $Head{'pnum'} = $Head{'number:'};
+ $Head{'number:'} = $num;
+ disp_msg(\%Head, $opt_grep);
+ $num++;
+ }
+ }
+ }
+}
+
+
+###
+### vscan_namazu
+###
+sub vscan_namazu (@) {
+ my $num = shift;
+ my $nmzidx;
+
+ $num = 1 if($num eq 'all');
+
+ binmode(STDOUT);
+ foreach (@opt_src) {
+ my ($nmzidx, $ranges) = (/([^:]+)(?::)?(.*)?/);
+ my @messages = ();
+
+ open( NMZ, "namazu -aeS \"$opt_grep\" $nmzidx|")
+ || im_err( "namazu error\n");
+ @messages = sort {$a <=> $b} <NMZ>;
+ close( NMZ );
+
+ foreach ( @messages ) {
+ chop;
+ if ( -f $_ ) {
+ my %Head = &get_header($_);
$Head{'pnum'} = $Head{'number:'};
$Head{'number:'} = $num;
disp_msg(\%Head, $opt_grep);
Mew-dist メーリングリストの案内