Re: Tabs vs. Spaces: please explain

On 2005-12-20 11:44 +0100, Michiel van Oosterhout wrote:

> However, the documentation states: "Tidy never outputs tabs".
> [...] Like I said, it would be very good to support both, and
> would make _everyone_ more happy. [...] Is anyone going to add
> some kind of indent-with: tabs|spaces option? Is this even
> possible? It's ok if the Tidy programmers would say no to tabs
> (I'd be very disappointed), but at least _explain_ it to me.

Perhaps because then someone would ask "if we have 9 spaces,
couldn't Tidy output a tab and a space ?" and they'd have to add
yet another option and write the accompanying documentation.

Piping the output of tidy into

  unexpand -t 1 | sed 's/^ /\t/'
  
will turn each leading space into a tab. Works for me with GNU
unexpand and GNU sed. The "\t" bit is not portable. If it doesn't
work with your version of sed, try entering a literal tab instead
(you may have to hit ^V first).

-- 
André Majorel <URL:http://www.teaser.fr/~amajorel/>
Do not use this account for regular correspondence.
See the URL above for contact information.

Received on Wednesday, 15 February 2006 05:25:16 UTC