[Top][All Lists]

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

Re: Native line numbers, final testing

From: Eli Zaretskii
Subject: Re: Native line numbers, final testing
Date: Mon, 10 Jul 2017 20:02:28 +0300

> From: Yuri Khan <address@hidden>
> Date: Mon, 10 Jul 2017 14:09:00 +0700
> Cc: "address@hidden" <address@hidden>, Emacs developers <address@hidden>
> >> Why not just right-align line numbers?
> >
> > I don't think I understand the idea, please elaborate.  E.g., what
> > will be to the left of the leftmost digit?
> A “specified space” of width equal to the difference of the pixel
> widths of the line numbers area and the current line number?

A.k.a. a "stretch glyph" of a suitably computed width.  Yes, this
would work, but it would require a thorough rewrite of the
number-generating code: where now we determine how many decimal places
we need, and then the pixel width follows from that, the modified code
will need to do it the other way around.  That will bring additional
complications with producing a blank field instead of a number (e.g.,
beyond EOB), with handling text-scale-adjust and friends, etc.

So I'd prefer not to go that way, unless strictly necessary.  If the
solution I just posted, with using a fixed-pitch font for numbers, is
good enough, let's not rush to make more radical changes for the
benefit of what I consider a niche use case wrt to line-number

> If Emacs does not have a notion of right-aligned text output, that
> is. Which would be surprising in an application that supports RTL,
> but what do I know.

We are talking about coding at the same level at which these
alignments are implemented, i.e. where text layout is generated.  Any
text alignment we need on this level must be implemented via
pixel-width calculations; there's no support for that on lower levels.
That is how RTL lines are laid out, because the screen is still drawn
left-to-right even when we display RTL text (since anything else would
be extremely inefficient).

reply via email to

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