[Top][All Lists]

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

Re: Native display of line numbers

From: Eli Zaretskii
Subject: Re: Native display of line numbers
Date: Sun, 18 Jun 2017 17:54:31 +0300

> From: Yuri Khan <address@hidden>
> Date: Sun, 18 Jun 2017 18:03:18 +0700
> Cc: Emacs developers <address@hidden>
> On Sat, Jun 17, 2017 at 10:12 PM, Eli Zaretskii <address@hidden> wrote:
> > I came up with an implementation of a native
> > display of line numbers.  You can find it in the scratch/line-numbers
> > branch of the Emacs repository.
> It is nice to have native line numbers. They work with a non-default
> background, correctly handle line wrapping, and even when their face
> is customized to a smaller size. (In a larger size, their tops get
> truncated, but that’s firmly in the “don’t to that, then” territory.)

Hmm... that ought to work.  Something's amiss, I'll take a look.

I agree that it's a strange thing to do, but bitter experience has
taught me that for every strange customization there's a more-or-less
valid use case out there, so it's better to have the code follow the
expectations than have bug reports ;-)

> But now we have three facilities that can display auxiliary
> information around the buffer text: margin, fringe, and line numbers,
> all with their own unique limitations:
> * The margin’s limitation is that its overall background is defined by
> the default face. Fragments of text are displayed in the margin can
> specify their own background, but the space where nothing is displayed
> is always the same color as the buffer. Also, overlay performance.

(You can write in the margins using 'display' text properties you put
on buffer text or on line-prefix strings.)

> * The fringe can only display bitmaps, only monochrome bitmaps, and
> only bitmaps at native display resolution. Which makes all bitmaps
> that are designed for low resolution displays unreadably tiny on a
> HiDPI display.
> * And the line numbers area only displays line numbers.
> The relative ordering of the margin and fringe can be customized with
> ‘fringes-outside-margins’ but line numbers are always inside both of
> those. That means a line number area with a non-default background
> color will visually divide the display. Also, the line wrapping
> indicator in the fringe is visually separated from the wrapped line.
> IMO, it should be possible to put the fringe, and maybe the margin,
> inside line numbers.

That would AFAIU require a change in basic design of the screen
layout: it currently assumes only 3 areas, the 2 margins and the text

But I'm not sure I understand the motivation: is it due to the
background issues with the margins?  If so, fixing that might be much

reply via email to

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