indenting with tabs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Setting spacing = 8 and making the program use tabs across the board,
As Samuel suggested,
is a thought that I also had, independently, and I like it,
for the reason you gave (people can change their tab settings as they like),
and, if I ever do want to "hear" the indent level,
I just list the line and listen to the tabs,
instead of having a mix of tabs and spaces, or many spaces.
And it's easy to search for /^<tab>}/ to jump to the end of the block that you
are in the middle of - not having to count out spaces etc.

And I agree also,
if(foo) bar();
should stay on one line, but indent seems incapable of doing that.
Sigh.
I guess that's something I'll have to give up as part of the compromise.

A downer on tabs if you go 5 or 6 levels in,
is that even a modest line gets cut into many pieces by the 80 column limit,
and that's pretty goofy.
I know, I know, properly structured code doesn't go
5 or 6 levels in, I know, but the code that I write in a hurry,
that I'm not paid to write, sometimes does that.
That's just the way it is.

Another problem with the tabs, assuming the sighted person might have the
freedom to change the spacing thereof, is that tabs are also used
in the middle of a line, to push a short comment off to the right.
This will get mucked up if the user changes tab = 4 for a lesser indent.
Well, you know, I don't think people change their tab settings
very often, so I'm not going to worry about that.
The benefits of single-char tabs on the left kinda win the day, I think.

So here is my revised .indent.pro file for comment.
I would like to get this right, or at least reasonably satisfactory
to a wide majority, then get on with my life.
As you see, I had no luck getting -ci0 to work.
That's the second "problem" with indent in only 20 minutes.
Guess everyone just runs indent -gnu and doesn't check these things out.
Well, with its faults, it's still the best program for the job,
kinda like democracy.

// leave blanklines alone!
-nsob
-ncdb
-nbad
-nbap
-nbbb
// Measure levels of indenting - use 8 spaces = one tab
// The sighted user can set tab to anything he likes,
// and I don't have to listen to a mix of tabs and spaces, or many spaces,
// if I want to discern the indent level.
-ut
-ts8
-i8
-bli0
-cbi0
-nlp
// I really want -ci0, but that doesn't work!
// So I'm settling for ci3, which acts like -lp when an if statement
// is involved, and those are the ones that are usually long anyways.
-ci3
-ip0
-pi0
-cli0
-di2
// Braces are set by the coding standards of the linux kernel
-br
-brs
-cdw
-ce
-bs
// Breaking long lines.
-l80
-hnl
-psl
-nbbo
// Inserting spaces - usually I don't want it
-nprs
-npcs
-ncs
// can't prevent the space in switch (x)
-nsaf
-nsai
-nsaw
// the space in while(x--) ; is a good thing
-ss

Karl Dahlke


[Index of Archives]     [Linux for the Blind]     [Fedora]     [Kernel List]     [Red Hat Install]     [Red Hat Watch List]     [Red Hat Development]     [Gimp]     [Yosemite News]     [Big List of Linux Books]