unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Paul Rankin <hello@paulwrankin.com>, Dmitry Gutov <dgutov@yandex.ru>
Cc: 28855@debbugs.gnu.org
Subject: 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	[thread overview]
Message-ID: <83po9nf58h.fsf@gnu.org> (raw)
In-Reply-To: <1508125091.3713406.1139815176.12F59A69@webmail.messagingengine.com> (message from Paul Rankin on Mon, 16 Oct 2017 13:38:11 +1000)

> From: Paul Rankin <hello@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.





  reply	other threads:[~2017-10-16 16:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-16  3:38 bug#28855: 26.0.90; display-line-numbers-mode does not respect (line|wrap)-prefix '(space :align-to N) text property Paul Rankin
2017-10-16 16:05 ` Eli Zaretskii [this message]
2017-10-17  0:47   ` Paul Rankin
2017-10-17  2:44     ` Eli Zaretskii
2017-10-17  4:04       ` Eli Zaretskii
2017-10-17  4:32         ` Paul Rankin
2017-10-17  5:49           ` Eli Zaretskii
2017-10-17  7:17             ` Paul Rankin
2017-10-18  9:29   ` Dmitry Gutov
2017-10-18 16:47     ` Eli Zaretskii
2017-10-18 17:44       ` martin rudalics
2017-10-18 17:55         ` Eli Zaretskii
2017-10-20  9:40           ` Eli Zaretskii
2017-10-18 18:05         ` Eli Zaretskii
2017-10-18 18:34           ` martin rudalics
2017-10-18 18:44             ` Eli Zaretskii
2017-10-18 23:58           ` Alex
2017-10-19  3:26             ` Eli Zaretskii
2017-10-19  5:54               ` Alex
2017-10-20  7:03                 ` Eli Zaretskii
2017-10-18 22:52       ` Dmitry Gutov

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83po9nf58h.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=28855@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=hello@paulwrankin.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).