all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Romanos Skiadas <rom.skiad@gmail.com>
To: 28533@debbugs.gnu.org
Subject: bug#28533: 26.0.60; Native line numbers move with show-paren-mode enabled
Date: Sat, 23 Sep 2017 09:49:03 +0100	[thread overview]
Message-ID: <429d60e7-7b38-aa85-679f-3aaff4424756@gmail.com> (raw)
In-Reply-To: <83h8vtc3jf.fsf@gnu.org>

> But why in private email?
Because I keep accidentally pressing C-r on thunderbird instead of C-R. 
This is the third time this week I've done this that I know of, sorry. 
Thanks for taking the time to explain all these things to me. Feel free 
to close the bug now if you haven't already.
>>>> If you think it is a WONTFIX kind of deal, I'm ok with closing it. As
>>>> far as I can tell the customizations you suggested are not somewhere in
>>>> the docs. Should they added in NEWS and in any other relevant documentation?
>>> Not sure what you mean: the variables I mentioned are AFAIK documented
>>> in the Emacs manual.
>> They are documented, but using them in a way to circumvent this problem
>> is not. I might be wrong, so if that is the case let me know. A mention
>> in the display-numbers-mode docstring along the lines of "if you fold
>> lines in the buffer set such and such variable to X value" would be useful.
> I added that now to the Emacs manual.
Thanks, I saw that.
>
>>> Org mode has special needs when non-relative line numbers are
>>> displayed, and the solution should IMO be in Org, not in Emacs core,
>> There are other ways to hide line numbers, such as
>> set-selective-display, which can be used in any mode. There other are
>> minor modes that do that too like evil & origami.
> they should all adapt, if their users use line-number display a lot.
>
>>> because solving that in core would mean significant run-time penalties
>> How significant?
> Very significant: they would require doing each redisplay cycle twice.
>
> You must understand the problem to see the difficulty: the display
> engine calculates the space needed for line-number display just once,
> at the beginning, when it is about to display the first line, and then
> reuses the result of that calculation for all the subsequent lines.
> It estimates the maximum number of lines that can be visible in the
> window to do that, but it cannot know in advance how many lines will
> be hidden from display without displaying them first.  So it would
> need to display twice.  This is what linum-mode did, and that's the
> reason why it was so slow.  I don't think it's right to bring that
> slowdown back, when reasonable solutions exist on the Lisp level.
I see. Thanks for explaining.
> , that is good.
>
>> on the other hand, solving it in core means that every
>> mode that folds buffers won't have to solve it themselves or ask their
>> users to solve it.
> Yes, and why is that a problem?  Many modes already have
> accommodations for popular minor modes, including linum-mode.  Why
> cannot they accommodate this new feature as well?
>
> Solving everything in the core has a price, and good engineering
> doesn't punish everyone on behalf of the needs of a few.  Let those
> few pay the price in adapting.
Fair point.
>
>> Also, on the point of what Emacs calculates as the minimum width, I
>> checked with other editors (gedit, the one that starts with V and ends
>> with IM) and they calculate the size of the width to be the one of the
>> last line in their buffers.
> That's what display-line-numbers-width-start does in Emacs.  But it
> does that once, when the buffer is first created.  Counting all the
> lines in the buffer upon each redisplay cycle would be prohibitively
> slow in large buffers, so Emacs doesn't do that.  However, if you
> customize display-line-numbers-grow-only as well, you will have the
> best of all worlds.
>
>> So if the last line is 1234 the width is 4 regardless of where you
>> are in the buffer. The problem wouldn't show up if Emacs calculated
>> the width this way, would it? This way of calculating things has the
>> added benefit that if you scroll up the buffer when line ~100 is at
>> the bottom the text doesn't suddenly shift right by one, which I
>> find really annoying.
> If this annoys you, you should set display-line-numbers-grow-only
> non-nil.
Ah, thanks.






      parent reply	other threads:[~2017-09-23  8:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-20 20:14 bug#28533: 26.0.60; Native line numbers move with show-paren-mode enabled Romanos Skiadas
2017-09-20 20:42 ` Romanos Skiadas
2017-09-21  9:11 ` Eli Zaretskii
2017-09-21 21:11   ` Romanos Skiadas
2017-09-22  7:22     ` Eli Zaretskii
     [not found]       ` <985db77a-8f22-34c8-a60c-45fe2c2999ea@gmail.com>
     [not found]         ` <83h8vtc3jf.fsf@gnu.org>
2017-09-23  8:49           ` Romanos Skiadas [this message]

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=429d60e7-7b38-aa85-679f-3aaff4424756@gmail.com \
    --to=rom.skiad@gmail.com \
    --cc=28533@debbugs.gnu.org \
    /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.