unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Alp Aker <alptekin.aker@gmail.com>
Cc: 18417@debbugs.gnu.org, dgutov@yandex.ru
Subject: bug#18417: 24.3.93; posn-at-point confused by fill-column-indicator
Date: Tue, 09 Sep 2014 17:38:24 +0300	[thread overview]
Message-ID: <8338c0c10f.fsf@gnu.org> (raw)
In-Reply-To: <CACxch4rNSrMXZAm9h_AB+p0k+hpAE3+p_RWHV=zyXxM_GEOVKQ@mail.gmail.com>

> Date: Sun, 7 Sep 2014 23:11:35 -0400
> From: Alp Aker <alptekin.aker@gmail.com>
> Cc: Dmitry <dgutov@yandex.ru>, 18417@debbugs.gnu.org
> 
> > The recipe in effect invokes undefined behavior in posn-at-point,
> > because fci-mode uses a zero-length (a.k.a. "empty") overlay to
> > place, in a very convoluted way, a stretch of whitespace followed
> > by an image, before the newline.
> [snip]
> > Since the buffer position of the newline is not "covered" by the
> > empty overlay, Emacs happily stops when it reaches the newline,
> > oblivious to the fact that on the way it produced the stretch
> > glyph of a very large width.
> 
> I'm not sure it's due to the overlay having zero length. Here's a minimal
> recipe that provokes the same behavior using a overlay of length 1 (covering
> the newline):

You are right, the length of the overlay is not the issue here.  I
mentioned that for completeness, but my wording could indeed mislead
into thinking that the zero length is the culprit.

The actual problem is that overlays with before-strings and
after-strings never "cover" (as in "conceal" or "hide") anything.  The
buffer contents is still there, so Emacs gives you the coordinates of
the buffer position on the display, not of the first glyph produced
from the overlay string.

Btw, the same will happen with cursor positioning if you remove the
'cursor' property from the overlay string, and for the same reason.





      reply	other threads:[~2014-09-09 14:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-06  9:43 bug#18417: 24.3.93; posn-at-point confused by fill-column-indicator Dmitry
2014-09-07 17:22 ` Eli Zaretskii
2014-09-07 18:55   ` Dmitry Gutov
2014-09-07 19:43     ` Eli Zaretskii
2014-09-07 19:52       ` Alp Aker
2014-09-07 19:56         ` Eli Zaretskii
2014-09-08  3:11   ` Alp Aker
2014-09-09 14:38     ` Eli Zaretskii [this message]

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=8338c0c10f.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=18417@debbugs.gnu.org \
    --cc=alptekin.aker@gmail.com \
    --cc=dgutov@yandex.ru \
    /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).