GNU bug report logs - #28855
26.0.90; display-line-numbers-mode does not respect (line|wrap)-prefix '(space :align-to N) text property

Previous Next

Package: emacs;

Reported by: Paul Rankin <hello <at> paulwrankin.com>

Date: Mon, 16 Oct 2017 03:39:01 UTC

Severity: normal

Found in version 26.0.90

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Alex <agrambot <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: martin rudalics <rudalics <at> gmx.at>, 28855 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca, johnw <at> gnu.org, dgutov <at> yandex.ru
Subject: bug#28855: 26.0.90; display-line-numbers-mode does not respect (line|wrap)-prefix '(space :align-to N) text property
Date: Wed, 18 Oct 2017 17:58:03 -0600
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Date: Wed, 18 Oct 2017 19:44:50 +0200
>> From: martin rudalics <rudalics <at> gmx.at>
>> CC: 28855 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>, 
>>  John Wiegley <johnw <at> gnu.org>
>> 
>> If someone wants the current behavior, we could add
>> a "special element" like 'line-number-display-start' such that
>> 
>> :align-to 0
>> 
>> would behave like
>> 
>> :align-to (+ line-number-display-start (line-number-display-width t))
>> 
>> for LTR text.
>
> Actually, it's the other way around: the current behavior is that
> :align-to always starts counting from the window edge, even if line
> numbers are displayed, so the effect of ":align-to N" is as if N has
> been reduced by the screen space used for displaying the numbers.

By "window edge" do you mean the edge of the text area? Since AFAICT
there's no current way to specify alignment relative to the window
edges. This is what the 2nd part of Bug#28771 is about.

> The changes I'm about to install make :align-to work as you described
> above, i.e. start measuring the offset from where the line-number
> display ends.

What about starting the measurement from after the line-prefix attribute
as well? Then there can be a new element for pixel specs that one can
use to display relative to line numbers, if one so wishes.

> After the change, if someone wants to always measure the offset from
> the window edge, they could/should use
>
>   :align-to (+ left-fringe left-fringe N)

> > Unless ‘fringes-outside-margins’ is non-nil and there's a left margin.
> For that, there's left-margin that can play the same role.

If there's a distinct element for line-numbers, then you don't have to
worry about what elements are on the left, or what order they're in.




This bug report was last modified 7 years and 218 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.