[darcs-devel] Question about encoding of hunks

Tommy Pettersson ptp at lysator.liu.se
Sun Jan 8 14:09:20 PST 2006


On Wed, Dec 28, 2005 at 09:25:12PM +0100, Juliusz Chroboczek wrote:
> > I can't for the life of me figure 
> > out where the logic for encoding hunks is.  e.g., where does darcs 
> > determine it will insert a '$' when the line has blank characters at 
> > the end, and when will it insert '[$]'?
> 
> Printer.lhs.  Beware, it's horribly polymorphic and nastily second order.

Well, the [$] thing functions are in ColourPrinter.lhs.  It's a
package of Printers (functions that transforms Printables
to Docs) on top of the simpler Printers in Printer.lhs.
The code that decides to print something usually chooses one
of the available Printers depending on what for it's printing.
The different printers are responsible for doing different
kinds of decorations.  The more advanced Printers usually
just do "their" stuff and calls simpler Printers for the rest.
They also look at environment variables and adjust (or simply
disable) their decorations based on those.


-- 
Tommy Pettersson <ptp at lysator.liu.se>




More information about the darcs-devel mailing list