Mail Archives: djgpp/2000/04/13/19:22:57
As I mentioned in a previous post though (is this a duplicate? I seem to remember
reading this a while ago), I agree with Eli because if you use RHIDE, and
autoindent, it uses a mixture of tabs and spaces. When you move files from
machine to machine (that all have different settings) that have been autoindented
in this way, it becomes a real pain.
Andrew
Richard Slobod wrote:
> [reposted, as it doesn't seem to have gone through the first time]
>
> Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote:
> >
> >On Mon, 10 Apr 2000, Richard Slobod wrote:
> >
> >> Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote:
> >>
> >> >You took a trivial example. Try a real-life program, and you'll see
> >> >what I mean. The problem happens because indentation uses blanks and
> >> >spaces together. Tabs change their size, but blanks don't.
> >>
> >> Huh? If you indent with tabs, then you indent with tabs, not a mixture of
> >> tabs and spaces.
> >
> >It depends on the indenting style. If every indentation level is 2
> >columns deep, then the 4th level will use a tab, the 5th will use a tab
> >and a space, etc.
>
> But if you were messing around with the tab size you obviously wouldn't
> indent like that; you'd make every indent level a tab and just set the tab
> width to your desired indent size.
>
> >Using a tab for each level wastes the line width too quickly, IMHO.
>
> Not if you set the tab size smaller. That was my original point: if you
> indent with tabs, you can have the indents as wide or as narrow as you wish.
>
> >> Could you post an example of what you're talking about?
> >
> >This is from the DJGPP library (file name fflush.c):
>
> [fairly lengthy code listing snipped]
>
> But that code was clearly formatted with the inherent assumption that tabs
> are exactly equivalent to eight spaces; someone using a nonstandard tab size
> simply wouldn't have written it that way.
>
> Mixing tabs and spaces in this way will indeed cause parts of the code to be
> misaligned where that assumption is false, but that's not an issue if you
> consistently indent with tabs only. (For that matter, IMHO, if you want
> something that's guaranteed to be exactly eight spaces wide, it's safest to
> simply use eight spaces. Admittedly, that will increase the file size a
> bit.)
- Raw text -