emacs-devel
[Top][All Lists]
Advanced

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

Re: Native display of line numbers: visual line-counting


From: Joseph Garvin
Subject: Re: Native display of line numbers: visual line-counting
Date: Sat, 24 Jun 2017 14:03:27 -0500

For my own use of relative line numbers (speech recognition controlled programming) what's important is that the line numbering matches the number of times I'd press the up/down arrow keys or C-p/C-n to move my cursor to the labeled line. The whole reason for me to use the feature is to make it easier by eyeballing to predict where the cursor will land after I say "up 4", "down 7", etc. So I don't care at all about the numbering matching physical lines in the file.

This isn't the case with any of the relative line number packages I've tried so far with visual line mode so it'd be awesome to have a reliable mode available. I actually filed a bug against one of the packages awhile back:

https://github.com/Fanael/relative-line-numbers/issues/6



On Jun 24, 2017 1:15 PM, "Eli Zaretskii" <address@hidden> wrote:
So a few people requested this feature, and I started thinking about
its implementation.  Immediately I bumped into several issues that I'm
not sure how to resolve, since I don't really understand how this will
be used in Emacs.

First, this makes sense only for relative line numbers, right?  If not
I don't really understand what would be the definition of "visually
counted first line shown in a window".  If everyone agrees, it would
mean that the current line will have the number of zero, right?  or do
people still want to see the "physical line number" for the current
line in this case?

Next, the only use case which I fully understand is the one with
some of the lines folded, as in Org or Outline modes.  More
accurately, the case where text is not displayed because it was made
invisible by the 'invisible' property of some kind -- these lines are
not to be counted under this mode.

But that is not the only case where what is displayed does not
correspond to buffer text 1:1.  Some text on the screen might come
from display properties or from before- and after-strings.  These can
include embedded newlines, and this contribute to "visual lines" Emacs
displays.  Are these lines to be counted or not?  Should Emacs display
something for their "line numbers" or not?

We need to resolve all these and possibly other subtleties before the
feature can be implemented.  Ideas and opinions are welcome.

TIA


reply via email to

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