]> diplodocus.org Git - minc/commitdiff
($SCAN_P_FOLDER, $SCAN_P_MESSAGE, $SCAN_P_FROM): New configurable
authorepg <>
Tue, 6 Sep 2005 19:16:49 +0000 (19:16 +0000)
committerepg <>
Tue, 6 Sep 2005 19:16:49 +0000 (19:16 +0000)
globals, the proportion each field should take in the scan lines.

(filter_mail): Use these new globals instead of instead of hard-coded
defaults, and move the loading of .minc before the use of these
globals so the user can change them.

minc

diff --git a/minc b/minc
index 52c9014..34f50ef 100755 (executable)
--- a/minc
+++ b/minc
@@ -185,6 +185,9 @@ marked unseen.
 
 our @FILTERS;
 our (@start_hooks, @stop_hooks, @filter_hooks, @post_store_hooks);
 
 our @FILTERS;
 our (@start_hooks, @stop_hooks, @filter_hooks, @post_store_hooks);
+our $SCAN_P_FOLDER = 0.1;
+our $SCAN_P_MESSAGE = 0.0625;
+our $SCAN_P_FROM = 0.175;
 
 my $mh;
 my $logfile;
 
 my $mh;
 my $logfile;
@@ -540,16 +543,16 @@ sub filter_mail {
     my $msgnum;
     my %folders;
 
     my $msgnum;
     my %folders;
 
-    # XXX lame names and hard-coded proportions.
-    my $nf = int($COLUMNS * 0.1);
-    my $nm = int($COLUMNS * 0.0625);
-    my $nF = int($COLUMNS * 0.175);
-    my $ns = $COLUMNS - $nf - $nm - $nF - 3;
-
     if (-f "$HOME/.minc") {
         require "$HOME/.minc";
     }
 
     if (-f "$HOME/.minc") {
         require "$HOME/.minc";
     }
 
+    # XXX lame names
+    my $nf = int($COLUMNS * $SCAN_P_FOLDER);
+    my $nm = int($COLUMNS * $SCAN_P_MESSAGE);
+    my $nF = int($COLUMNS * $SCAN_P_FROM);
+    my $ns = $COLUMNS - $nf - $nm - $nF - 3;
+
     my %batons;
     for my $hook (@start_hooks) {
         my ($handle, @baton) = $hook->();
     my %batons;
     for my $hook (@start_hooks) {
         my ($handle, @baton) = $hook->();