GNU bug report logs -
#42039
27.0.91; (posn-x-y (posn-at-point)) inconsistent with display-line-numbers-mode
Previous Next
Reported by: Dmitry Gutov <dgutov <at> yandex.ru>
Date: Thu, 25 Jun 2020 13:30:02 UTC
Severity: normal
Found in version 27.0.91
Done: Dmitry Gutov <dgutov <at> yandex.ru>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On 25.06.2020 20:42, Eli Zaretskii wrote:
> The bug-report buffer doesn't use an overlay, it uses a display
> property string. Do you have an example with an overlay where this
> problem happens, or is it limited to display strings?
Good question. It doesn't happen with just any overlay, so here's a full
example:
1. Create an overlay, e.g.
(setq o (make-overlay (point) (1+ (point))))
The buffer contents seem unimportant. It can cover some text, or a
newline, or multiple lines. But it should start at bol (if it doesn't
start at bol, the result will also be unexpected, but not 0).
So the buffer text can just be a bunch of newlines, for the sake of this
example.
2. Put a display string on it that (important!) ends with a newline:
(overlay-put o 'display "abc\ndef\n")
3. Eval
(car (posn-x-y (posn-at-point (overlay-start o))))
It will evaluate to 0 even if display-line-numbers-mode is enabled.
This bug report was last modified 5 years and 22 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.