On Mon, Apr 02, 2001 at 12:14:13PM +0200, Andre Poenitz wrote:
> > function(param1 p1, param2 p2, ...
> >          paramx px, paramy py)
> > {
> > ...
> > }
> > 
> > Try to indent this with tabs and set tab-width to 4 or to 8!
> 
> In my own stuff I use in such cases real spaces starting from the position
> below the 'f' in function to the 'p' in paramx.
> 
> If the block is intended, both lines get the same amount of tabs at the
> beginning. This way it looks the same with any tab size.

Yes!

Repeat after me the following mantra:

Tabs for indentation, spaces for alignment.

Then the tab stop can be set to each user's preferences, but the
alignment will still work.

(e.g)

<tab> function(param p1, param2 p2,
<tab> <spaces> param px, paramy pay)
<tab> {
<tab> <tab> body of code..


IMO, there are two sane approaches:

a) Standardise on a tab size (for LyX code) which everyone can cope
with, and use only spaces. No tabs.

b) Tabs for indentation, spaces for alignment, as above.

For a clear discussion, see

http://www.jwz.org/doc/tabs-vs-spaces.html

Jules

Reply via email to