unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 42039@debbugs.gnu.org
Subject: bug#42039: 27.0.91; (posn-x-y (posn-at-point)) inconsistent with display-line-numbers-mode
Date: Thu, 25 Jun 2020 21:35:59 +0300	[thread overview]
Message-ID: <4a6ef653-c9f0-0215-cfec-c04bc6a8f88e@yandex.ru> (raw)
In-Reply-To: <83o8p7rqhx.fsf@gnu.org>

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.





  reply	other threads:[~2020-06-25 18:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-25 13:29 bug#42039: 27.0.91; (posn-x-y (posn-at-point)) inconsistent with display-line-numbers-mode Dmitry Gutov
2020-06-25 14:18 ` Dmitry Gutov
2020-06-25 17:42 ` Eli Zaretskii
2020-06-25 18:35   ` Dmitry Gutov [this message]
2020-06-25 19:13     ` Eli Zaretskii
2020-06-26 12:04 ` Eli Zaretskii
2020-06-26 12:55   ` Dmitry Gutov
2020-06-26 13:37     ` Eli Zaretskii
2020-06-26 16:00       ` 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=4a6ef653-c9f0-0215-cfec-c04bc6a8f88e@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=42039@debbugs.gnu.org \
    --cc=eliz@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 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).