From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Newsgroups: gmane.emacs.bugs 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 Message-ID: <86mw9wfmxn.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1411088845 31390 80.91.229.3 (19 Sep 2014 01:07:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 19 Sep 2014 01:07:25 +0000 (UTC) To: 18504@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 19 03:07:20 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XUmfQ-0000Bt-1F for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Sep 2014 03:07:20 +0200 Original-Received: from localhost ([::1]:55185 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUmfP-00074z-Fe for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Sep 2014 21:07:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56442) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUmfH-00071p-VL for bug-gnu-emacs@gnu.org; Thu, 18 Sep 2014 21:07:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUmfD-0005Bb-JS for bug-gnu-emacs@gnu.org; Thu, 18 Sep 2014 21:07:11 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53382) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUmfD-0005B4-HH for bug-gnu-emacs@gnu.org; Thu, 18 Sep 2014 21:07:07 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XUmaI-0008Cf-BB for bug-gnu-emacs@gnu.org; Thu, 18 Sep 2014 21:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 19 Sep 2014 01:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18504 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.141108849031485 (code B ref -1); Fri, 19 Sep 2014 01:02:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Sep 2014 01:01:30 +0000 Original-Received: from localhost ([127.0.0.1]:44942 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUmZl-0008Bk-Uz for submit@debbugs.gnu.org; Thu, 18 Sep 2014 21:01:30 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53943) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUmZh-0008Bc-4o for submit@debbugs.gnu.org; Thu, 18 Sep 2014 21:01:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUmZR-0003ef-5P for submit@debbugs.gnu.org; Thu, 18 Sep 2014 21:01:24 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:55668) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUmZR-0003b5-2g for submit@debbugs.gnu.org; Thu, 18 Sep 2014 21:01:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54844) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUmUk-0005QE-Fk for bug-gnu-emacs@gnu.org; Thu, 18 Sep 2014 20:56:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUmUg-0002Vo-1P for bug-gnu-emacs@gnu.org; Thu, 18 Sep 2014 20:56:18 -0400 Original-Received: from mail-lb0-x232.google.com ([2a00:1450:4010:c04::232]:36524) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUmUf-0002VK-Pz for bug-gnu-emacs@gnu.org; Thu, 18 Sep 2014 20:56:13 -0400 Original-Received: by mail-lb0-f178.google.com with SMTP id c11so2200930lbj.23 for ; Thu, 18 Sep 2014 17:56:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:mime-version:content-type; bh=06bvG6DefsvwBZsB4i5HWL0yr7C0SalD9hjAni4XUfk=; b=h6U/Fn7qG02Cm8ucUZyuVrYut+HKPVjln44SYHcJP6UvrKmobe/5RIXFJisGnim68l InxwbXwPptXyjX7c0l3pKkPo31MBSwMyhx1+qFgzjvA6jg/WK+RuM6DreLWWdceH5+xP oLNvcv5WfZRHbr5nfK+nD6cyVIB/C05ch1WIw6nBSjtGZXX/7M7XfqQYsZ5F+NTlHHRF mz1w89wsGsa8JbsyMa/QpjLbXvzrx73zLf2FmrBxcJxMH2xm/zTvj/Vivxw6fnGuHvcH HhOwulDUb3lh2GdKl/yFR+j7pQ03y0baXJw6YpuZCBtmp5AFVXJLAjvF2zoE1NT4GxeY xdKg== X-Received: by 10.153.5.9 with SMTP id ci9mr3053914lad.75.1411088167347; Thu, 18 Sep 2014 17:56:07 -0700 (PDT) Original-Received: from axl ([178.252.98.87]) by mx.google.com with ESMTPSA id jp17sm100476lab.18.2014.09.18.17.56.05 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 18 Sep 2014 17:56:06 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:93492 Archived-At: (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