[PATCH 1 of 6] C modules: don't mix tabs and spaces
mdounin at mdounin.ru
Thu Aug 27 09:45:20 CDT 2009
On Thu, Aug 27, 2009 at 04:04:07PM +0200, Nicolas Dumazet wrote:
> 2009/8/27 Maxim Dounin <mdounin at mdounin.ru>:
> >> Use tabs seems it is apparently the standard.
> > I believe it's linux kernel style which is used for C code. Matt
> > wrote about it some time ago.
> I probably haven't been around for long enough ;)
> > [...]
> >> @@ -253,7 +253,7 @@
> >> pos = (struct pos *)calloc(bn ? bn : 1, sizeof(struct pos));
> >> /* we can't have more matches than lines in the shorter file */
> >> l.head = l.base = (struct hunk *)malloc(sizeof(struct hunk) *
> >> - ((an<bn ? an:bn) + 1));
> >> + ((an<bn ? an:bn) + 1));
> > Here is a good illustration why tabs shouldn't be used to pad
> > continuation lines (are you using tabwidth=4 in your editor? try
> > default - 8). Even if tabs used for indenting.
> Yuck. Looks ugly indeed.
> I think it's a good illustration of why we should avoid at all cost
> mixing tabs and
> spaces. Either pick all-spaces, either pick all-tabs.
> Using spaces for continuation lines is not the magic solution: if the
> previous line is indented using tabs,
> then the overall render still depends on editor-specific
> tabwidth/tabexpand value
No, as long as you use tabs for indent and spaces to pad. E.g.
<tab> very long
do not depend on editor settings. With any tab width overral view
remains consistent. And it's how it is used now.
More information about the Mercurial-devel