<<< Date Index >>>     <<< Thread Index >>>

Re: [PATCH] new fmtpipe updates



I caught your second followup where you okayed fmtpipe.3 just as I was
about to send this reply to your first.  I've trimmed away most of my
reply, but there's a further idea I had that might be attractive.

> That doesn't sound quite right. If the arguments are unquoted, mutt
> will no longer do its own if-else expansion, because each term is
> being fed to the formatter independently. So you're really back to
> doing your own quoting. I tried running my regular status_format

I agree that not quoting them might produce undesirable results, but
I don't see any real drawback to imposing the requirement that you
quote them where context or spacing are important.  (This is a common
obligation in muttrc files anyway, and in general it'll be moderate to
advanced users using this feature.)

I like that it makes the scripts vastly easier to code correctly without
any significant cost in the muttrc -- I think the script is the harder
part of the whole thing to get right already.


Another approach comes to mind -- a hybrid, sort of like crontab's way
of using '%' to separate command args from stdin.  We could appropriate
"<<" for this:

set status_format="status-filter.sh %f <<%r %f %.6s %4l [%M/%m] %> 
N:%?n?%04n&none? D:%?d?%04d%&none?|"

In this example, what comes before << would be treated as in fmtpipe.3,
and what comes after fed via stdin.  Then you could choose which way
works best, and arguments may not even be necessary.


I'll do the patch cleanup and fix the trailing \| issue.  Let me know
if I should add in this new thing too.

-- 
 -D.    dgc@xxxxxxxxxxxx        NSIT    University of Chicago