emacs-devel
[Top][All Lists]
Advanced

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

Re: Changing line widths in the Emacs source code


From: Tim Cross
Subject: Re: Changing line widths in the Emacs source code
Date: Mon, 14 Sep 2020 10:08:08 +1000

As a vision impaired coder, I prefer the 80 column width as it allows me to have larger fonts and still see the whole line on a large monitor. However, a more important data point might be the impact wider lines would have for code examples and samples in blogs, ebooks and other formats. Such things are typically formatted for reading and are usually formatted for 80 characters (or less). With longer source code lines, either smaller fonts or re-formatting would be required. 

Probably the most important data points against increased size is the ability to display windows 'side by side' and the growth in mobile/laptop environments, which typically have much smaller screens than desktops. 

I am against this change.



On Mon, 14 Sep 2020 at 07:24, Göktuğ Kayaalp <self@gkayaalp.com> wrote:
On 2020-09-13 23:52 +03, Stefan Monnier <monnier@iro.umontreal.ca> 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))

=> "On average 34.588839 chars per line excluding indentation (21235 lines)"

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))

=> "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".

--
İ. Göktuğ Kayaalp / @cadadr / <https://www.gkayaalp.com/>
pgp:   024C 30DD 597D 142B 49AC 40EB 465C D949 B101 2427



--
regards,

Tim

--
Tim Cross


reply via email to

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