From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#20322: 25.0.50; indent-tabs-mode should default to nil Date: Tue, 21 Apr 2015 01:09:28 +0300 Message-ID: <55357918.7030808@yandex.ru> References: <861tjn3069.fsf@yandex.ru> <552D20B6.8030005@yandex.ru> <83mw2abul3.fsf@gnu.org> <552D34BC.4090806@yandex.ru> <83h9sibt0q.fsf@gnu.org> <552D7796.2090109@yandex.ru> <552D9204.3000604@yandex.ru> <552DC816.3030002@yandex.ru> <553513B4.6040509@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1429567828 13362 80.91.229.3 (20 Apr 2015 22:10:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 20 Apr 2015 22:10:28 +0000 (UTC) Cc: 20322@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Apr 21 00:10:13 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YkJtM-0006pA-Ni for geb-bug-gnu-emacs@m.gmane.org; Tue, 21 Apr 2015 00:10:12 +0200 Original-Received: from localhost ([::1]:55480 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkJtL-0000CR-Jc for geb-bug-gnu-emacs@m.gmane.org; Mon, 20 Apr 2015 18:10:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkJtH-0000AC-A2 for bug-gnu-emacs@gnu.org; Mon, 20 Apr 2015 18:10:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YkJtD-0008WQ-NT for bug-gnu-emacs@gnu.org; Mon, 20 Apr 2015 18:10:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44167) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkJtD-0008Vp-JJ for bug-gnu-emacs@gnu.org; Mon, 20 Apr 2015 18:10:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YkJtC-0003AL-SM for bug-gnu-emacs@gnu.org; Mon, 20 Apr 2015 18:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Apr 2015 22:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20322 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20322-submit@debbugs.gnu.org id=B20322.142956778112138 (code B ref 20322); Mon, 20 Apr 2015 22:10:02 +0000 Original-Received: (at 20322) by debbugs.gnu.org; 20 Apr 2015 22:09:41 +0000 Original-Received: from localhost ([127.0.0.1]:33943 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YkJsq-00039h-JH for submit@debbugs.gnu.org; Mon, 20 Apr 2015 18:09:41 -0400 Original-Received: from mail-wg0-f42.google.com ([74.125.82.42]:36359) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YkJso-00039U-B9 for 20322@debbugs.gnu.org; Mon, 20 Apr 2015 18:09:39 -0400 Original-Received: by wgsk9 with SMTP id k9so193857384wgs.3 for <20322@debbugs.gnu.org>; Mon, 20 Apr 2015 15:09:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=nH0EnZw9iNhg03LOpMaholxBWaZUNYUDublS4G0hUdE=; b=gxJ8MFiSpfurQHSJxKT9e8TVtfn9Pbyg2pE8mD+Du6QBAgvwgfnYoz53V+YOMjjl3i 4AhJGght6/vz+HDIKVQsZkuNi96DjNI32PGvH43iXeGjqygPPxJSokIt5NmNxeBaDX+T KTdmoVjZQ3tmqtPbdlArnnBxgEQISAduZzj4Tpafyt6y/7FzsloFBK7FDJ71r//B9qMD +15VQgEHk9hxYcMQ7ZXd99xyg4nPAIGko3gzIXnbxzXGMmh8X+cHPTG71DB1YIaAOTZQ W8vt3PLlLrYvu5kp71Y/mNlFimu93adYgQHMYkp9xPbaAanHTyHgSkbLMwRgOrmLi1vl 8gKQ== X-Received: by 10.194.200.8 with SMTP id jo8mr34073527wjc.64.1429567772757; Mon, 20 Apr 2015 15:09:32 -0700 (PDT) Original-Received: from [192.168.1.2] ([82.102.93.54]) by mx.google.com with ESMTPSA id cf12sm29018573wjb.10.2015.04.20.15.09.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Apr 2015 15:09:31 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:36.0) Gecko/20100101 Thunderbird/36.0 In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:101787 Archived-At: On 04/20/2015 10:26 PM, Stefan Monnier wrote: > Ah, so the units are lines? Indeed, then this can be strongly biased if > people use smaller tab-width than 8. > > It seems it would make more sense to count files (or projects), where > each file gets to be counted either as SPC or as TAB depending on > whether it has more lines that use TAB than lines that use either spaces. That sounds better, but still would discount the JavaScript files with less than 4 levels of nesting (unless we only count each project once; but I think the project size is important, too). And in our case, any hunks which didn't include this level of nesting (see the caveat at the bottom). Here's updated counts (in number of files), produced by parsing the log (one you can download here: http://dropcanvas.com/3mwn1): C: tabs => 17422, spaces => 6509 C++: tabs => 7366, spaces => 17155 JS: tabs => 30100, spaces => 73370 Java: tabs => 66922, spaces => 38243 Elisp: tabs => 515, spaces => 1465 (The ratio for C became even more tab-favored, but others seem to have moved towards spaces). Script: File.open("print.log", "r") do |file| results = Hash[%w(c cpp js java el).map { |ext| [ext, {tabs: 0, spaces: 0}]}] file_re = /\.(#{results.keys.join("|")}): spaces ([0-9]+), tabs ([0-9]+)$/ file.each_line do |line| if line =~ file_re ext = $~[1] spaces = $~[2].to_i tabs = $~[3].to_i ext_results = results[ext] if spaces > tabs ext_results[:spaces] += 1 elsif spaces < tabs ext_results[:tabs] += 1 end end end puts results end > This way, the bias only affects a file at a time, which should be > insignificant if we assume that those files should use a consistent > style (i.e. either 99% TABs or 99% SPC). CAVEAT: The above was still only the result of the diffs analysis, and didn't examine the files in their entirety (the original run took more than 8 hours here, and downloading the actual files is bound to take an order of magnitude more, just for January 1st). But to get a feeling for the margin of error, here's the result of running a modified script, which sorted all "spaces 0, tabs 0" files into the "spaces" bucket: C: tabs => 17422, spaces => 16683 C++: tabs => 7366, spaces => 44641 JS: tabs => 30100, spaces => 143709 Java: tabs => 66922, spaces => 98886 Elisp: tabs => 515, spaces => 2423 So yeah, it seems C programmers favored tabs either way that day. The Java programmers, however, are undecided.