unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry <dgutov@yandex.ru>
To: 18504@debbugs.gnu.org
Subject: bug#18504: 24.3.93; posn-at-point intermittently returns wrong value for a valid buffer position
Date: Fri, 19 Sep 2014 04:56:04 +0400	[thread overview]
Message-ID: <86mw9wfmxn.fsf@yandex.ru> (raw)

(Not a regression, same in Emacs 24.3).

I've been trying to understand what triggers this and create a smaller
repro case, but so far had no luck. So we'll use the company package.

1. git clone https://github.com/company-mode/company-mode.git

2. cd company-mode; git checkout foofoofoo

(Note that the last commit in this branch adds a `message' call that
outputs a multiline string. This doesn't seem to be mandatory, but makes
reproduction easier).

3. emacs -L . -Q

4. (require 'company)
M-x global-company-mode
;; Pick another binding if you're in tty
(global-set-key (kbd "C-/") 'company-complete-common)

5. Type `C-o' several times, so that there are a few empty lines under
the current one.

6. Type `  a'. Again not mandatory, but I've had better odds of
reproduction with this line content.

7. Quickly and repeatedly mash `C-/' and `C-g', a lot.

You'll see the popup appearing under the current line and column, but
sometimes noticeably displaced to the right (like by 15 columns). If it
doesn't happen, try mashing the keys in different rhythms, faster or
slower, and kind of simultaneously (not alternating).

After you've seen it, eval (setq bidi-display-reordering nil).

Mash the keys again, now the popup will occasionally be displayed below
its intended position, by 11 lines or so.

If you add some debugging output to `company--col-row', you'll see that,
for the same value of POS, (posn-at-point pos) returns in these odd
moments "position objects" with very different X and Y coordinates.

This bug is most likely related to the `company-pseudo-tooltip-overlay'
now being positioned starting with the end of the current line (before
the newline), because if I add a space after the current point, I can't
reproduce it anymore. This was at one point suggested by Eli
(http://lists.gnu.org/archive/html/emacs-devel/2014-08/msg00328.html),
or at least hinted at.

I'd be happy to help debugging this further, if someone tells me how.

In GNU Emacs 24.3.93.3 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8)
 of 2014-09-05 on axl
Repository revision: 117482 monnier@iro.umontreal.ca-20140904161426-2072ebabqpyhaadw
Windowing system distributor `The X.Org Foundation', version 11.0.11501000
System Description:	Ubuntu 14.04.1 LTS





             reply	other threads:[~2014-09-19  0:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-19  0:56 Dmitry [this message]
2014-09-19  6:21 ` bug#18504: 24.3.93; posn-at-point intermittently returns wrong value for a valid buffer position 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
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=86mw9wfmxn.fsf@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=18504@debbugs.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).