From: Eli Zaretskii <eliz@gnu.org>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 18504@debbugs.gnu.org
Subject: bug#18504: 24.3.93; posn-at-point intermittently returns wrong value for a valid buffer position
Date: Sat, 20 Sep 2014 10:13:42 +0300 [thread overview]
Message-ID: <83mw9uzrvd.fsf@gnu.org> (raw)
In-Reply-To: <541C8526.8010204@yandex.ru>
> Date: Fri, 19 Sep 2014 23:33:58 +0400
> From: Dmitry Gutov <dgutov@yandex.ru>
> CC: 18504@debbugs.gnu.org
>
> posn at nil #1 (#<window 16 on *scratch*> 206 (0 . 270) 0 nil 206 (0 .
> 15) nil (0 . 0) (9 . 18))
> posn at nil #2 (#<window 16 on *scratch*> 206 (0 . 270) 0 nil 206 (0 .
> 15) nil (0 . 0) (0 . 0))
> foofoo
> foo
> posn at 195 #1 (#<window 16 on *scratch*> 206 (0 . 270) 0 nil 206 (0 .
> 15) nil (0 . 0) (0 . 0))
> posn at 195 #2 (#<window 16 on *scratch*> 206 (0 . 270) 0 nil 206 (0 .
> 15) nil (0 . 0) (0 . 0))
> <...>
> foofoo
> foo
> posn at nil #1 (#<window 16 on *scratch*> 206 (0 . 270) 0 nil 206 (0 .
> 15) nil (0 . 0) (0 . 0))
> posn at nil #2 (#<window 16 on *scratch*> 206 (0 . 270) 0 nil 206 (0 .
> 15) nil (0 . 0) (0 . 0))
> foofoo
> foo
> posn at 195 #1 (#<window 16 on *scratch*> 206 (0 . 270) 0 nil 206 (0 .
> 15) nil (0 . 0) (0 . 0))
> posn at 195 #2 (#<window 16 on *scratch*> 206 (0 . 270) 0 nil 206 (0 .
> 15) nil (0 . 0) (0 . 0))
> <...>
>
> Point is indeed at 195. Note that the last element is sometimes
> different between `posn-at-point' invocations ((9 . 18) vs (0 . 0)), but
> sometimes not (both pairs of zeros)).
This happens when posn-at-point is called with the company-mode
overlay still (or already?) in place at that position. That overlay
has the invisible property, so it hides the buffer text starting at
the position with which you call posn-at-point. Therefore,
posn-at-point returns information about the first visible buffer
position after the overlay string.
So I think you need to make sure inside company--col-row that the
overlay is popped down, before you call posn-at-point. Evidently, in
some scenarios it isn't. The buffer position returned by
posn-at-point can serve as your control variable: if it is different
from the position that is the argument to company--col-row, you have
this situation.
next prev parent reply other threads:[~2014-09-20 7:13 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-19 0:56 bug#18504: 24.3.93; posn-at-point intermittently returns wrong value for a valid buffer position Dmitry
2014-09-19 6:21 ` Eli Zaretskii
2014-09-19 10:25 ` Dmitry Gutov
2014-09-19 13:12 ` Eli Zaretskii
2014-09-19 13:29 ` Dmitry Gutov
2014-09-19 13:35 ` Eli Zaretskii
2014-09-19 13:46 ` Dmitry Gutov
2014-09-19 14:00 ` Eli Zaretskii
2014-09-19 14:06 ` Dmitry Gutov
2014-09-19 14:21 ` Eli Zaretskii
2014-09-19 19:33 ` Dmitry Gutov
2014-09-20 7:13 ` Eli Zaretskii [this message]
2014-09-23 18:39 ` Dmitry Gutov
2014-09-23 19:16 ` Eli Zaretskii
2014-09-19 14:54 ` Eli Zaretskii
2014-09-19 17:52 ` Dmitry Gutov
2014-09-19 19:35 ` Eli Zaretskii
2014-09-19 19:38 ` 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=83mw9uzrvd.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=18504@debbugs.gnu.org \
--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).