Spacing issues

Vincent Lefevre vincent-opdarw at vinc17.org
Sat Feb 10 18:58:38 PST 2007


On 2007-02-09 11:39:20 -0600, Ryan Schmidt wrote:
> I assume that's due to the stupid setting available in emacs or vi or  
> whatever editor it is that actually encourages that behavior. The one  
> where they've said "We want to indent to 4-space tabs. However, the  
> editor is configured to print 8 spaces for a tab. Therefore, when we  
> want to indent one level, we will use 4 spaces, and when we want to  
> indent 2 levels, we will use one tab, and when we want to indent  
> three levels, we will use one tab and then 4 spaces." And so forth.  
> I'm convinced such an editor setting exists somewhere, because I have  
> seen this nonsense in other projects too, even to the extreme of 2- 
> space indentation. (Indent sequence: 2 spaces, 4 spaces, 6 spaces,  
> one tab, one tab and 2 spaces, etc.)

A mix of tabs and spaces is bad since it won't look right in diffs,
for instance. Moreover, using tabs only is also a bad choice since
one can't align columns and a 8-column space is often too much for
a single indentation (even though some editors could be configured
to use fewer columns, this is not the case of terminals and web
browsers). And tabs are often not preserved in copy-paste. So, I'd
say: let's use spaces only.

> >>Using only spaces seems not so good to me, because
> >>
> >>- spaces uses 2 or 4 times as much disk space as a tab
> >
> >Do you honestly believe this is a problem? I'm sure I can spare the  
> >few extra kB it might take.
> 
> No, not really a problem. I would accept extra disk space if this  

and compared to all the other files on a disk (in particular videos,
images, binaries), one shouldn't noticed the difference.

> solution brought significant advantages, but I'm saying it brings  
> drawbacks.

I disagree. See above.

> Now I'm curious: What editor do other people use to edit their  
> portfiles?

Emacs. One can use: (setq indent-tabs-mode nil) to disable tabs in
indentation.

-- 
Vincent Lefèvre <vincent at vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)



More information about the macports-dev mailing list