bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#20322: 25.0.50; indent-tabs-mode should default to nil


From: Dmitry Gutov
Subject: bug#20322: 25.0.50; indent-tabs-mode should default to nil
Date: Mon, 20 Apr 2015 17:56:52 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:36.0) Gecko/20100101 Thunderbird/36.0

On 04/15/2015 07:19 AM, Stefan Monnier wrote:

For most major modes, you don't need to convince me (because I just
don't know that language enough to have an opinion), but in any case
if the decision is based on such analysis (which could make sense), then
I think it's worth making the analysis correct, indeed.

Looking into this more, your suggestion favors tabs, a lot.

Since (as I can tell from looking at all "tabs vs spaces" blog posts, discussions, etc, and from recalling my petulant youth), the prevailing approach is to use one tab per indent level, whereas /^ {8}/ matches 1-4 indent levels, depending on the language and project (but usually 2 for Java and 4 for JS), we skip a lot of space-indented lines.

Keeping this in mind, here's some results. I've ran through all 2015-01-01 diffs (which is admittedly not the best date; as far as bias in concerned), and counted the "added" lines matching either regexp.

Doing this for the rest of the January would take a few more days, and I'm not sure if that's really valuable, considering the above.

C:     tabs => 1241263, spaces =>   636266
C++:   tabs =>  466087, spaces =>   926052
JS:    tabs => 8430336, spaces => 11739058
Java:  tabs => 7620803, spaces =>  1509610
Elisp: tabs =>  150071, spaces =>   185015

You can look at the implementation here: https://gist.github.com/dgutov/addc25762453c5a205ea

To run it locally, one would also need to download the files for January, from https://www.githubarchive.org/ (it comes out to ~460MB per day), and a persistent Internet connection to actually download the diffs.

If anyone wants, I can also post the fairly verbose (as you can see from the script) log from the current run. It's 15MB gzipped.





reply via email to

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