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


Message #8 received at 28855 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Paul Rankin <hello <at> paulwrankin.com>, Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 28855 <at> debbugs.gnu.org
Subject: Re: bug#28855: 26.0.90;
 display-line-numbers-mode does not respect (line|wrap)-prefix '(space
 :align-to N) text property
Date: Mon, 16 Oct 2017 19:05:18 +0300
> From: Paul Rankin <hello <at> paulwrankin.com>
> Date: Mon, 16 Oct 2017 13:38:11 +1000
> 
> display-line-numbers-mode does not respect line-prefix or wrap-prefix text properties when set as '(space :align-to N).
> 
> To reproduce:
> 
> 1. emacs -Q
> 3. type some text in *scratch* buffer
> 2. M-: (put-text-property (line-beginning-position) (line-end-position) 'line-prefix '(space :align-to 2))
> 3. M-x display-line-numbers-mode
> 
> Expected results:
> 
> Line numbers should be displayed before line-prefix (and/or wrap-prefix) space of 2 columns.
> 
> Actual results:
> 
> Line numbers eat the line-prefix and wrap-prefix space, effectively aligning the text back to 0.

Right, :align-to still counts from the window edge, even when line
numbers are displayed, whereas you expected it to count from the end
of the line-number display.

When this was briefly discussed during development, we decided not to
change the reported window dimensions and geometry, including those of
the text area, to account for the screen estate taken by the
line-number display.  But maybe :align-to should be an exception, when
used to align buffer text (as opposed to header-line or mode-line)?
Though I'm bothered whether some users of :align-to may not want this
automatic offset.  :align-to is a very popular feature; does anyone
know or imagine why a Lisp program would NOT like such an offset?

What do people think?  Dmitry, what about company-mode popups, for
example?

It should be a very easy change to offset the origin for every use of
:align-to for buffer text: it's basically a single line of code in a
single place.  But if some applications won't want that, we will
probably need an entirely new attribute, which is much less nice, IMO.




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.