|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
Tabs vs. Spaces: please explainOk, this is not about the tabs vs. spaces debate itself. But the fact that there is a debate (some prefer to call it a holy war) means that there are those who prefer spaces and those who prefer tabs, both in no small amount). The sensible thing to do for Tidy then, would be to support _both_. However, the documentation states: "Tidy never outputs tabs". I sense some bitterness in that very short powerfull statement, like it was a pro-spaces programmer who was fed up with the whole discussion. However, it is not that simple. Like I said, it would be very good to support both, and would make _everyone_ more happy. So, what's the deal? Is Tidy developed by a pro-spaces only team of programmers? 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. Thank you very much. PS. I'd do it myself, but as you can probably guess, I use HTMLTidy because I'm a web programmer, so I can't program C or C++ |
|
|
Re: Tabs vs. Spaces: please explainOn Tue, Dec 20, 2005 at 11:44:46AM +0100, Michiel van Oosterhout wrote: > > Ok, this is not about the tabs vs. spaces debate itself. But the fact > that there is a debate (some prefer to call it a holy war) means that > there are those who prefer spaces and those who prefer tabs, both in no > small amount). The sensible thing to do for Tidy then, would be to > support _both_. > > However, the documentation states: "Tidy never outputs tabs". > ... Can't you postprocess it to add tabs? Fro example, on Unix/Linux the command 'unexpand' will turn the right numbers of spaces to tabs: tidy ... | unexpand Presumeably the same sort of things are possible on other operating systems. -- --- Geoff Richards -------------><-------------- http://ungwe.org/ --- "I tried to fling my shadow at the moon, The while my blood leapt with a wordless song." -- Theodore Roethke |
|
|
|
|
|
|
|
|
Re: Tabs vs. Spaces: please explainI agree with Michael that a param like indent-type would be nice. Indenting is an important part of formatting and we are restricted to use spaces. If you want to replace them tabs you have to use another formatter tool otherwise it will replaces all spaces (space groups) not only which are for indent or write a script for this. But why should you do this when you have a formatter program?
|
|
|
Re: Tabs vs. Spaces: please explainOn 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. |
| Free embeddable forum powered by Nabble | Forum Help |