From: epg <> Date: Tue, 6 Sep 2005 19:16:49 +0000 (+0000) Subject: ($SCAN_P_FOLDER, $SCAN_P_MESSAGE, $SCAN_P_FROM): New configurable X-Git-Url: https://diplodocus.org/git/minc/commitdiff_plain/4d17046cb16343ec273773cf3a93772f1c8ca2a7 ($SCAN_P_FOLDER, $SCAN_P_MESSAGE, $SCAN_P_FROM): New configurable 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. --- diff --git a/minc b/minc index 52c9014..34f50ef 100755 --- a/minc +++ b/minc @@ -185,6 +185,9 @@ marked unseen. 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; @@ -540,16 +543,16 @@ sub filter_mail { 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"; } + # 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->();