From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?B?R8O2a3R1xJ8=?= Kayaalp Newsgroups: gmane.emacs.devel Subject: Re: Changing line widths in the Emacs source code Date: Mon, 14 Sep 2020 00:23:33 +0300 Message-ID: <87mu1ts756.fsf@gkayaalp.com> References: <87tuw1x016.fsf@gnus.org> <20200913142210.GA4285@ACM> <87d02pmsi7.fsf@t510.orion.oneofus.la> <87o8m9sadk.fsf@gkayaalp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33021"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.2.0; emacs 28.0.50 Cc: =?utf-8?B?R8O2a3R1xJ8=?= Kayaalp , Alan Mackenzie , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Sep 13 23:24:11 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kHZTm-0008Ry-H9 for ged-emacs-devel@m.gmane-mx.org; Sun, 13 Sep 2020 23:24:10 +0200 Original-Received: from localhost ([::1]:39962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kHZTl-0008ND-Ir for ged-emacs-devel@m.gmane-mx.org; Sun, 13 Sep 2020 17:24:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50870) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHZTJ-0007yQ-M6 for emacs-devel@gnu.org; Sun, 13 Sep 2020 17:23:41 -0400 Original-Received: from relay12.mail.gandi.net ([217.70.178.232]:44213) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHZTH-0003qd-Ei for emacs-devel@gnu.org; Sun, 13 Sep 2020 17:23:41 -0400 Original-Received: from localhost (unknown [31.177.204.112]) (Authenticated sender: self@gkayaalp.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 6C8CF200002; Sun, 13 Sep 2020 21:23:35 +0000 (UTC) In-reply-to: Received-SPF: none client-ip=217.70.178.232; envelope-from=self@gkayaalp.com; helo=relay12.mail.gandi.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/13 17:23:36 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:255577 Archived-At: On 2020-09-13 23:52 +03, Stefan Monnier wrote: > So, ~8 columns of indentation, which leaves ~72 columns of actual text. > Since most lines don't extend all the way to the 80th column, that means > most lines stick within the 55-60 optimum. Much less, actually: (let ((spaces '(0)) (line-count 1)) (with-current-buffer "org.el.gz" (goto-char (point-min)) (while (not (looking-at "\\'")) (push (- (line-end-position) (save-excursion (back-to-indentation) (point))) spaces) (cl-incf line-count) ;; beginning of next line (goto-char (1+ (line-end-position))))) (message "On average %f chars per line excluding indentation (%d lines)" (/ (apply #'+ spaces) (float line-count)) line-count)) =3D> "On average 34.588839 chars per line excluding indentation (21235 line= s)" So around a comfy 35 chars of code per line. Also: (let ((spaces '(0)) (line-count 1)) (with-current-buffer "org.el.gz" (goto-char (point-min)) (while (not (looking-at "\\'")) (push (- (line-end-position) (line-beginning-position)) spaces) (cl-incf line-count) ;; beginning of next line (goto-char (1+ (line-end-position))))) (message "On average %f chars per line (%d lines)" (/ (apply #'+ spaces) (float line-count)) line-count)) =3D> "On average 37.766847 chars per line (21235 lines)" Your average line is 38 chars long, indentation included. If anybody wants to replicate this, this is from a build of Emacs from "931b9f5953013c1e8844d0c723411b87ccfedb1a". -- =C4=B0. G=C3=B6ktu=C4=9F Kayaalp / @cadadr / pgp: 024C 30DD 597D 142B 49AC 40EB 465C D949 B101 2427