all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Yuri Khan <yuri.v.khan@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Native display of line numbers
Date: Mon, 19 Jun 2017 18:51:04 +0300	[thread overview]
Message-ID: <831sqgx9g7.fsf@gnu.org> (raw)
In-Reply-To: <CAP_d_8Wd6=LUrfJS_N=b-LY3h_e+3HYCxvvoaLvjypZq7QB_Mg@mail.gmail.com> (message from Yuri Khan on Mon, 19 Jun 2017 12:32:19 +0700)

> From: Yuri Khan <yuri.v.khan@gmail.com>
> Date: Mon, 19 Jun 2017 12:32:19 +0700
> Cc: Emacs developers <emacs-devel@gnu.org>
> 
> How much is too much is subjective.

Fair enough.

> > OK, and what's your point?  That the line number display is not ideal?
> > I agree, but I think the alternatives are much worse.  E.g., switching
> > the order can only work on TTY frames and when the fringes are
> > disabled,
> 
> I do not understand this limitation. Could you please elaborate?

Sure.  The basic restriction (well, unless the geometry of the display
canvas is redesigned) is that what is collectively called "display
elements" -- character glyphs, images, stretches of whitespace,
xwidgets, etc. -- can appear in one of 3 areas of the display: the
left margin, text area, and the right margin.  The order of these 3
areas is fixed, left to right (although one or both of the margins
could be empty).  Each one of the 3 areas is contiguous, so e.g. you
cannot place the fringe in the middle of the text area, as that will
disrupt layout calculations.

The line numbers in my implementation are in the text area, before the
actual line.  On TTY frames, the left-truncation indicator is also in
the text area before the actual line.  It is injected there by the
display engine in a way that is very similar to my implementation of
the line numbers.  So on TTY frames, I could in principle insert the
line number before the truncation indicator.  But that cannot be done
on GUI frames, because the indicator is on the fringe, and cannot be
moved to be to the right of the line numbers, as long as we want the
line numbers to be in the text area, not in the margin.

So if we want consistency between the GUI and TTY frames, the
left-truncation indicator should be to the left of the line numbers on
TTY frames as well.

> > I'm sure people who like line numbers will get
> > used to the arrangement of indicators soon enough; I did.  Especially
> > since long lines are rare in source code buffers, at least IME.
> 
> Depends on what we call long lines. I run Emacs in two windows
> side-by-side on a 24″ monitor, so for me everything exceeding ≈100
> columns is a long line. My teammates sometimes break this limit, and
> some teams in the company I work for have a 120-column coding
> standard.

IME, lines longer than 80 columns are frowned upon in many coding
standards.  It's certainly so in Emacs and on my daytime job.  And
even if such long lines are allowed, I presume most of the lines are
way shorter, at least in some popular languages.

I'm not saying long lines never happen, I'm saying this is a clear
80-20 situation, and IMO we should favor the majority.

> > Experience shows that using the margins for such pervasive modes is
> > trouble in itself, because there are modes which want to use the
> > margins for their own purposes.  We still don't have a satisfactory
> > solution for those problems.
> 
> The problem here is that there isn’t a defined protocol for sharing
> the margin. There was a discussion in 2015-12 on that matter.
> 
> https://lists.gnu.org/archive/html/emacs-devel/2015-12/msg00066.html

Indeed we discussed this more than once, but the problem is still
unsolved, and AFAIR we were unable to even reach a consensus, let
alone design the solution.  Which to me means the problem is really
hard to solve.  Working around hard problems is a good engineering
practice.



  reply	other threads:[~2017-06-19 15:51 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-17 15:12 Native display of line numbers Eli Zaretskii
2017-06-17 16:41 ` Stefan Monnier
2017-06-17 18:25   ` Eli Zaretskii
2017-06-17 21:25     ` Stefan Monnier
2017-06-18 14:21       ` Eli Zaretskii
2017-06-17 16:52 ` Kaushal Modi
2017-06-17 17:20   ` Kaushal Modi
2017-06-17 17:42     ` Eli Zaretskii
2017-06-17 17:41   ` Eli Zaretskii
2017-06-17 21:16     ` Stefan Monnier
2017-06-18  4:27     ` Kaushal Modi
2017-06-18 14:40       ` Eli Zaretskii
2017-06-17 20:27 ` Alan Mackenzie
2017-06-17 21:26   ` Stefan Monnier
2017-06-18  2:35   ` Eli Zaretskii
2017-06-18 11:42     ` Alan Mackenzie
2017-06-18 12:16       ` Colin Baxter
2017-06-18 15:06       ` Eli Zaretskii
2017-06-18 15:47         ` Alan Mackenzie
2017-06-18 16:11           ` Eli Zaretskii
2017-06-18 20:19             ` Alan Mackenzie
2017-06-19  2:28               ` Eli Zaretskii
2017-06-17 20:47 ` Sébastien Le Callonnec
2017-06-18  2:38   ` Eli Zaretskii
2017-06-18 10:51     ` Sébastien Le Callonnec
2017-06-17 21:32 ` Mathias Dahl
2017-06-17 22:12   ` James Nguyen
2017-06-18 14:31     ` Eli Zaretskii
2017-06-19  2:25       ` James Nguyen
2017-06-19 15:32         ` Eli Zaretskii
2017-06-19 16:33           ` James Nguyen
2017-06-18 14:28   ` Eli Zaretskii
2017-06-18 14:42     ` Andreas Schwab
2017-06-18  8:44 ` martin rudalics
2017-06-18  8:58   ` martin rudalics
2017-06-18 14:46   ` Eli Zaretskii
2017-06-19  2:39     ` Eli Zaretskii
2017-06-19  8:04       ` martin rudalics
2017-06-19 15:13         ` Eli Zaretskii
2017-06-18 11:03 ` Yuri Khan
2017-06-18 14:54   ` Eli Zaretskii
2017-06-18 16:54     ` Yuri Khan
2017-06-18 19:00       ` Eli Zaretskii
2017-06-19  5:32         ` Yuri Khan
2017-06-19 15:51           ` Eli Zaretskii [this message]
2017-06-24 10:32     ` Eli Zaretskii
2017-06-18 19:41 ` Daniele Nicolodi
2017-06-18 20:04   ` Eli Zaretskii
2017-06-18 20:48     ` Daniele Nicolodi
2017-06-19  2:31       ` Eli Zaretskii
2017-06-19  3:07         ` Daniele Nicolodi
2017-06-19 15:03           ` Eli Zaretskii
2017-06-19  2:44       ` Clément Pit-Claudel
2017-06-19  4:15         ` Eli Zaretskii
2017-06-19  4:30           ` Clément Pit-Claudel
2017-06-18 22:20 ` Scott Jaderholm
2017-06-19  2:34   ` Eli Zaretskii
2017-06-19  5:49     ` Scott Jaderholm
2017-06-19 16:56 ` Stephen Leake
2017-06-19 17:11   ` Eli Zaretskii
2017-06-19 18:43     ` Stephen Leake
2017-06-19 19:32       ` Eli Zaretskii
2017-06-19 18:39 ` Alan Mackenzie
2017-06-19 19:28   ` Eli Zaretskii
2017-06-19 19:38     ` Alan Mackenzie
2017-06-19 19:51       ` Eli Zaretskii
2017-06-22 15:02 ` Filipe Silva
2017-06-22 15:38   ` Eli Zaretskii
2017-06-22 15:46     ` Filipe Silva
2017-06-23 16:23     ` Stefan Monnier
2017-06-23 21:04       ` Eli Zaretskii
2017-06-23 21:24         ` Stefan Monnier
2017-06-24  7:18           ` Eli Zaretskii
2017-06-22 16:27   ` Yuri Khan
2017-06-22 16:56     ` Stephen Berman
2017-06-23 11:10     ` Filipe Silva
2017-06-23 11:17       ` Filipe Silva
  -- strict thread matches above, loose matches on Subject: below --
2017-06-17 23:44 Joseph Garvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=831sqgx9g7.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=yuri.v.khan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.