[Top][All Lists]

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

Re: tabs vs. spaces in source code

From: Carl Sorensen
Subject: Re: tabs vs. spaces in source code
Date: Sat, 25 Jul 2009 11:26:49 -0600

On 7/25/09 10:58 AM, "Mark Polesky" <address@hidden> wrote:

> ...tabs in the source code...
> Werner Lemberg wrote:
>> I dislike them, too, but there are many editors which handle
>> them just fine.  I don't see a problem here.
> But would you be *opposed* to a strict no-tab rule?
> Carl Sorensen wrote:
>> The last communication we had about it, Han-Wen was
>> conditionally in favor and Jan was opposed.
> Are you sure? What do mean by "conditionally"?
> And it looks like Jan was also okay with it:

No, Jan was not in favor of it unless it became a standard for GNU coding.
Hence the comment on "first making it a standard" (i.e., a GNU standard)
and "sending a patch to emacs-devel".

The current standard is to let tabs and spaces be handled as emacs handles

> Does anyone have a script to automate such a process across
> multiple files? I'm not too clever with such things (I don't know
> python either). The best I can do is this (using jEdit):
> 1) save a "tabs2spaces" macro:
>    textArea.selectAll();
>    textArea.tabsToSpaces();
> 2) bind it to a keyboard shortcut (<ALT>-1 is available)
> 3) open file; <ALT>-1; close file; repeat.

vim has settings that will convert tabs to spaces; all one would need to do
would be to open the file and save it; vim would take care of the conversion

> There are 78 files in the scm folder, it wouldn't take that long
> at all. But probably one of you knows a better way (batch-style).
> Let me know. I don't want to waste time if I don't have to.
> Also, can we list all of the possible situations where we need to
> retain tabs? Ian mentioned .make files; the last time this came up
> Patrick McCarty mentioned something about demarcating syllables in
> lyrics, which I don't think I understand. (Patrick, can you give
> an example?)
> Are there any other tabs that need to stay?
> I'm looking at this:
> /notation-appendices.itely#l500
> But even in such cases, as long as my tab-width matches the
> tab-widths in the source, tabs2spaces should be fine. Is it
> correct to say that git (or savannah) translates all tabs to 8
> spaces without exception?

No, this is not correct.  tabs go to the nearest 8-space column.

So if you type two spaces followed by a tab, you'll be in column 8, not in
column 10.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]