[darcs-devel] darcs patch: introduce escape levels for output to terminal

David Roundy droundy at abridgegame.org
Sat Apr 2 04:22:33 PST 2005


On Fri, Apr 01, 2005 at 01:27:00PM -0500, ptp at lysator.liu.se wrote:
> David Roundy wrote:
> > Have you sent this patch? I'm still catching up on my email from last
> > week... I agree that extending the DARCS_TRUST_ISPRINT scheme sounds like a
> > good idea for now.
> 
> I'm sending it now.  I hoped to come up with something better
> by this week, but I didn't get the time to.
> 
> I will keep looking into it and see if I can improve it.
> At least I will document it in the manual if you think
> it's good.

I think I'd be more comfortable if we didn't expose numeric escape levels
to the user, especially since there are only two levels that have any
meaning at the moment.

Could we come up with separate environment variables such as

DARCS_ESCAPE_UNPRINTABLE_OR_NONASCII (== level 0)
DARCS_ESCAPE_UNPRINTABLE (== level 0 + DARCS_TRUST_ISPRINT)
DARCS_ESCAPE_UNPRINTABLE_ASCII (== level 5)
DARCS_ESCAPE_NOTHING (== level 9)

I have a feeling that something like that would be more clear.  You'd still
have to look it up, but if someone said in an email "Try defining
DARCS_ESCAPE_NOTHING", I think it'd be more obvious what it does than
"Define DARCS_ESCAPE_LEVEL=9".  The downside is that my interface would not
so clearly expose the hierarchy.

And actually it's seeming pretty unclear.  Perhaps we want something more
like a mix-and-match approach.

DARCS_DONT_ESCAPE_PRINTABLE_NONASCII
DARCS_DONT_ESCAPE_NONASCII
DARCS_DONT_ESCAPE_ASCII

Then the escape levels would be:

0: (Nothing defined)
0 + DARCS_TRUST_ISPRINT: DARCS_DONT_ESCAPE_PRINTABLE_NONASCII
5: DARCS_DONT_ESCAPE_NONASCII
9: DARCS_DONT_ESCAPE_NONASCII + DARCS_DONT_ESCAPE_ASCII

with perhaps another alias

DARCS_DONT_ESCAPE_ANYTHING

equivalent to

DARCS_DONT_ESCAPE_NONASCII + DARCS_DONT_ESCAPE_ASCII

I think I'll not take your patch at the moment, and wait for something
along these lines.
-- 
David Roundy
http://www.darcs.net




More information about the darcs-devel mailing list