From unknown Tue Jun 24 13:52:58 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#18504 <18504@debbugs.gnu.org> To: bug#18504 <18504@debbugs.gnu.org> Subject: Status: 24.3.93; posn-at-point intermittently returns wrong value for a valid buffer position Reply-To: bug#18504 <18504@debbugs.gnu.org> Date: Tue, 24 Jun 2025 20:52:58 +0000 retitle 18504 24.3.93; posn-at-point intermittently returns wrong value for= a valid buffer position reassign 18504 emacs submitter 18504 Dmitry severity 18504 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 18 21:01:30 2014 Received: (at submit) by debbugs.gnu.org; 19 Sep 2014 01:01:30 +0000 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 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 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 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 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 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 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 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 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) 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) From: Dmitry To: bug-gnu-emacs@gnu.org Subject: 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> MIME-Version: 1.0 Content-Type: text/plain 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-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) (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 From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 19 02:21:18 2014 Received: (at 18504) by debbugs.gnu.org; 19 Sep 2014 06:21:18 +0000 Received: from localhost ([127.0.0.1]:45080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUrZF-0001Ir-KG for submit@debbugs.gnu.org; Fri, 19 Sep 2014 02:21:17 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:47615) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUrZB-0001Ig-V5 for 18504@debbugs.gnu.org; Fri, 19 Sep 2014 02:21:15 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NC400900XJ12L00@a-mtaout20.012.net.il> for 18504@debbugs.gnu.org; Fri, 19 Sep 2014 09:21:12 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NC4009ULXNC1T10@a-mtaout20.012.net.il>; Fri, 19 Sep 2014 09:21:12 +0300 (IDT) Date: Fri, 19 Sep 2014 09:21:16 +0300 From: Eli Zaretskii Subject: Re: bug#18504: 24.3.93; posn-at-point intermittently returns wrong value for a valid buffer position In-reply-to: <86mw9wfmxn.fsf@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Message-id: <83ha041677.fsf@gnu.org> References: <86mw9wfmxn.fsf@yandex.ru> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18504 Cc: 18504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Dmitry > Date: Fri, 19 Sep 2014 04:56:04 +0400 > > I'd be happy to help debugging this further, if someone tells me how. I have no idea, since the recipe includes too many factors, and the problem is intermittent and timing dependent. Need a simpler recipe. Sorry. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 19 06:25:15 2014 Received: (at 18504) by debbugs.gnu.org; 19 Sep 2014 10:25:15 +0000 Received: from localhost ([127.0.0.1]:45194 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUvNK-00007T-LE for submit@debbugs.gnu.org; Fri, 19 Sep 2014 06:25:14 -0400 Received: from mail-lb0-f173.google.com ([209.85.217.173]:36206) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUvNH-000071-0l for 18504@debbugs.gnu.org; Fri, 19 Sep 2014 06:25:12 -0400 Received: by mail-lb0-f173.google.com with SMTP id 10so1120696lbg.32 for <18504@debbugs.gnu.org>; Fri, 19 Sep 2014 03:25:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=vsZsWewi/5/I6ki0d2bsNPUL11KtXqvmYkNYamTf7jY=; b=owCXlzIhFOLNHOnfbujV95gHIY+a33jCT/xTIKrvjtnHM+no8+ECN497mX2Y9Zykqb xLufHOCy9cMgvi6KokzoVeGvPIuIHCqusNVS7RLJD+hZnvTYLeJhS2Mn8BovVoavGbEA No83ml3uX8FUme9g9LP0a1LgQ4+jsdSbBn6MWuGvIjKdhEosDot1bvuq5SjiQoOT6wkU jfG4F4rHhd1X8P185JWl/ntzXezqkTw1EdTnPzBnGIQ3+YHwAC/rItfTX1/sLfuCssQG X6N5vRzJN45u1OMi8DJzwAgBON/qx+JkpTIgQdQ7rciwN3EfeoCLdqVrQdlhy9JNtGnu yNYQ== X-Received: by 10.112.75.233 with SMTP id f9mr2243214lbw.102.1411122309689; Fri, 19 Sep 2014 03:25:09 -0700 (PDT) Received: from [192.168.1.3] ([178.252.98.87]) by mx.google.com with ESMTPSA id cm9sm460947lbb.39.2014.09.19.03.25.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Sep 2014 03:25:08 -0700 (PDT) Message-ID: <541C0481.3050101@yandex.ru> Date: Fri, 19 Sep 2014 14:25:05 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18504: 24.3.93; posn-at-point intermittently returns wrong value for a valid buffer position References: <86mw9wfmxn.fsf@yandex.ru> <83ha041677.fsf@gnu.org> In-Reply-To: <83ha041677.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18504 Cc: 18504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 09/19/2014 10:21 AM, Eli Zaretskii wrote: > I have no idea, since the recipe includes too many factors, and the > problem is intermittent and timing dependent. Need a simpler recipe. That's too bad. Wouldn't setting a conditional breakpoint help? For example, when the return value is right, returned position's X coordinate is non-zero. However, when the bug manifests, and `bidi-display-reordering' is nil, the X coordinate of the returned position is zero. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 19 09:12:26 2014 Received: (at 18504) by debbugs.gnu.org; 19 Sep 2014 13:12:26 +0000 Received: from localhost ([127.0.0.1]:45254 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUxz6-0005X7-Vt for submit@debbugs.gnu.org; Fri, 19 Sep 2014 09:12:25 -0400 Received: from mtaout27.012.net.il ([80.179.55.183]:35122) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUxz3-0005Wv-63 for 18504@debbugs.gnu.org; Fri, 19 Sep 2014 09:12:23 -0400 Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0NC500N00FVNRD00@mtaout27.012.net.il> for 18504@debbugs.gnu.org; Fri, 19 Sep 2014 16:06:43 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NC500OQ5GF71R10@mtaout27.012.net.il>; Fri, 19 Sep 2014 16:06:43 +0300 (IDT) Date: Fri, 19 Sep 2014 16:12:12 +0300 From: Eli Zaretskii Subject: Re: bug#18504: 24.3.93; posn-at-point intermittently returns wrong value for a valid buffer position In-reply-to: <541C0481.3050101@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Gutov Message-id: <83a95v21qr.fsf@gnu.org> References: <86mw9wfmxn.fsf@yandex.ru> <83ha041677.fsf@gnu.org> <541C0481.3050101@yandex.ru> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18504 Cc: 18504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Fri, 19 Sep 2014 14:25:05 +0400 > From: Dmitry Gutov > CC: 18504@debbugs.gnu.org > > On 09/19/2014 10:21 AM, Eli Zaretskii wrote: > > > I have no idea, since the recipe includes too many factors, and the > > problem is intermittent and timing dependent. Need a simpler recipe. > > That's too bad. Indeed. But it's impossible to debug what you described, at least I don't know how to do that, not without a recipe that can reliably trigger the problem. > Wouldn't setting a conditional breakpoint help? Conditional breakpoint where? With these issues, the only way to find the bug is to step through the offending code _before_ it produces the wrong values. So we need a condition that happens at the beginning of that code, not where it produces the final wrong results. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 19 09:29:42 2014 Received: (at 18504) by debbugs.gnu.org; 19 Sep 2014 13:29:42 +0000 Received: from localhost ([127.0.0.1]:45262 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUyFp-0005wY-21 for submit@debbugs.gnu.org; Fri, 19 Sep 2014 09:29:41 -0400 Received: from mail-lb0-f171.google.com ([209.85.217.171]:55926) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUyFl-0005wK-0F for 18504@debbugs.gnu.org; Fri, 19 Sep 2014 09:29:37 -0400 Received: by mail-lb0-f171.google.com with SMTP id l4so3182212lbv.30 for <18504@debbugs.gnu.org>; Fri, 19 Sep 2014 06:29:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=KFO5wHpbKFb51g2xy4T9szkARbLgQ4a/e4Aut0fSd7Y=; b=kcmeGnUI0lLn09IBxNRRLUkPE6bcHqfi48RuDyOoylOUj0jzqGorI2gx5uYn+nczU7 zDu8javVSglHSXNheIkXeSrHMUTlb8VfCuEQdNjdg3y4WU618xJQlifCSg/351wVZtMa 6LNz/qkyLLJ8c+ZhwR0MwwJrJxzG4lHdPPoHftBHW2vKr7g3FSzGzahDg6BmZLYgALje 30X1zZfLyILDahbIKpjIzZxygh6maox1IKqRK+M6QbhWnLDJg3BbEh4yfL6cx2Kjm4wx 5M6uH2zDUtAeGWHD67uOjOzHQGji8TVCuB+gx9wZ4vWtZvk8XoOo1Hjlkg1Qg9bl1huJ pkVw== X-Received: by 10.112.163.103 with SMTP id yh7mr6396428lbb.73.1411133375676; Fri, 19 Sep 2014 06:29:35 -0700 (PDT) Received: from [192.168.1.3] ([178.252.98.87]) by mx.google.com with ESMTPSA id n7sm621335lae.47.2014.09.19.06.29.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Sep 2014 06:29:34 -0700 (PDT) Message-ID: <541C2FBB.3030008@yandex.ru> Date: Fri, 19 Sep 2014 17:29:31 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18504: 24.3.93; posn-at-point intermittently returns wrong value for a valid buffer position References: <86mw9wfmxn.fsf@yandex.ru> <83ha041677.fsf@gnu.org> <541C0481.3050101@yandex.ru> <83a95v21qr.fsf@gnu.org> In-Reply-To: <83a95v21qr.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18504 Cc: 18504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 09/19/2014 05:12 PM, Eli Zaretskii wrote: >> Wouldn't setting a conditional breakpoint help? > > Conditional breakpoint where? In the "call a function" routine, maybe? If the function is "posn-at-point", and if its returned X coord is zero, halt! Doing it in Elisp doesn't seem to produce the desired result, because edebug doesn't exactly stop Emacs in place. > With these issues, the only way to find the bug is to step through the > offending code _before_ it produces the wrong values. So we need a > condition that happens at the beginning of that code, not where it > produces the final wrong results. If `posn-at-point' is itself stateless (and doesn't modify any relevant caches), why not call it again at that point? From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 19 09:35:29 2014 Received: (at 18504) by debbugs.gnu.org; 19 Sep 2014 13:35:29 +0000 Received: from localhost ([127.0.0.1]:45266 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUyLP-00065V-VF for submit@debbugs.gnu.org; Fri, 19 Sep 2014 09:35:28 -0400 Received: from mtaout28.012.net.il ([80.179.55.184]:34542) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUyLL-00065J-Js for 18504@debbugs.gnu.org; Fri, 19 Sep 2014 09:35:24 -0400 Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il (HyperSendmail v2007.08) id <0NC500000HLOJ200@mtaout28.012.net.il> for 18504@debbugs.gnu.org; Fri, 19 Sep 2014 16:34:25 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout28.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NC500LPYHPDQA30@mtaout28.012.net.il>; Fri, 19 Sep 2014 16:34:25 +0300 (IDT) Date: Fri, 19 Sep 2014 16:35:15 +0300 From: Eli Zaretskii Subject: Re: bug#18504: 24.3.93; posn-at-point intermittently returns wrong value for a valid buffer position In-reply-to: <541C2FBB.3030008@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Gutov Message-id: <837g0z20oc.fsf@gnu.org> References: <86mw9wfmxn.fsf@yandex.ru> <83ha041677.fsf@gnu.org> <541C0481.3050101@yandex.ru> <83a95v21qr.fsf@gnu.org> <541C2FBB.3030008@yandex.ru> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18504 Cc: 18504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Fri, 19 Sep 2014 17:29:31 +0400 > From: Dmitry Gutov > CC: 18504@debbugs.gnu.org > > On 09/19/2014 05:12 PM, Eli Zaretskii wrote: > > >> Wouldn't setting a conditional breakpoint help? > > > > Conditional breakpoint where? > > In the "call a function" routine, maybe? If the function is > "posn-at-point", and if its returned X coord is zero, halt! And then do what? The damage was already done, and the debugger cannot tell you how the code got to that wrong result post-factum. Btw, why is it important what happens when the user types C-g, i.e. if she abandons the completion? Or does the problem happen without C-g as well? > > With these issues, the only way to find the bug is to step through the > > offending code _before_ it produces the wrong values. So we need a > > condition that happens at the beginning of that code, not where it > > produces the final wrong results. > > If `posn-at-point' is itself stateless (and doesn't modify any relevant > caches), why not call it again at that point? Because it will most probably produce the correct result. But you can try that yourself: insert a second call under the conditions that you know are evidence of the problem. If that is repeatable, i.e. if that second call always produces the wrong result, then I have what I need. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 19 09:47:05 2014 Received: (at 18504) by debbugs.gnu.org; 19 Sep 2014 13:47:06 +0000 Received: from localhost ([127.0.0.1]:45270 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUyWf-0006NF-D7 for submit@debbugs.gnu.org; Fri, 19 Sep 2014 09:47:05 -0400 Received: from mail-la0-f42.google.com ([209.85.215.42]:41412) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUyWc-0006N4-Nf for 18504@debbugs.gnu.org; Fri, 19 Sep 2014 09:47:03 -0400 Received: by mail-la0-f42.google.com with SMTP id hz20so3202405lab.15 for <18504@debbugs.gnu.org>; Fri, 19 Sep 2014 06:47:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=Y32YN4HLa94llrzKmEo7OqgHT7Mp9SzUMypACxp8pkk=; b=C1CbSZQxs7h3jJxL9W33hVOHsDc+JQPPjSMLWAx7NFgt3zBSs/rshQ5IESiahqznSF QutyFRv/CI8G7wM/1cuo+4MQGXDw7wIWKfpsGcXXKoPwzgB+4bWPD0nQsYWNQQeSbbiq cM8Bxnms0ZtndczvyP0AVWPO68gMuu+/xeRGqvi91A02YHQsTHED+NEnwOnivySd+DfI 2Rp3o5OJsdyDuvHAOoyjPdMtTK4dou4kaBqYswdPvPydsFOBsSOVwTYJ2pSaX3QktRZS ABUCAxNMEBTv0zVvPggze/G2QLg+XHFsadtyQS4W109sl+Vt2ejzNzbdVPByasX/CETf ORvg== X-Received: by 10.152.26.133 with SMTP id l5mr7246263lag.4.1411134421553; Fri, 19 Sep 2014 06:47:01 -0700 (PDT) Received: from [192.168.1.3] ([178.252.98.87]) by mx.google.com with ESMTPSA id f9sm649920lbh.14.2014.09.19.06.46.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Sep 2014 06:47:00 -0700 (PDT) Message-ID: <541C33D1.6020707@yandex.ru> Date: Fri, 19 Sep 2014 17:46:57 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18504: 24.3.93; posn-at-point intermittently returns wrong value for a valid buffer position References: <86mw9wfmxn.fsf@yandex.ru> <83ha041677.fsf@gnu.org> <541C0481.3050101@yandex.ru> <83a95v21qr.fsf@gnu.org> <541C2FBB.3030008@yandex.ru> <837g0z20oc.fsf@gnu.org> In-Reply-To: <837g0z20oc.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18504 Cc: 18504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 09/19/2014 05:35 PM, Eli Zaretskii wrote: > Btw, why is it important what happens when the user types C-g, i.e. if > she abandons the completion? Or does the problem happen without C-g > as well? I'm not quite sure how we get to that point, to be honest. The code gets called from `company-post-command' (which is in post-command-hook), but this-command is nil when that happens. >> If `posn-at-point' is itself stateless (and doesn't modify any relevant >> caches), why not call it again at that point? > > Because it will most probably produce the correct result. > > But you can try that yourself: insert a second call under the > conditions that you know are evidence of the problem. If that is > repeatable, i.e. if that second call always produces the wrong result, > then I have what I need. It is. Try this: diff --git a/company.el b/company.el index fdf09f7..01a3cb5 100644 --- a/company.el +++ b/company.el @@ -782,7 +782,13 @@ means that `company-mode' is always turned on except in `message-mode' buffers." (cons (+ col (window-hscroll)) row))) (defun company--col-row (&optional pos) - (company--posn-col-row (posn-at-point pos))) + (let ((posn (posn-at-point pos))) + ;; Completion should be invoked at column > 1. + (when (zerop (car (posn-x-y posn))) + (message "company--col-row zero!") + (message "then:") + (message "%s" (posn-x-y (posn-at-point pos)))) + (company--posn-col-row posn))) (defun company--row (&optional pos) (cdr (company--col-row pos))) I get: company--col-row zero! then: (0 . 198) From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 19 10:00:20 2014 Received: (at 18504) by debbugs.gnu.org; 19 Sep 2014 14:00:20 +0000 Received: from localhost ([127.0.0.1]:45923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUyjS-0006q7-Vf for submit@debbugs.gnu.org; Fri, 19 Sep 2014 10:00:19 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:36076) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUyjP-0006px-Vd for 18504@debbugs.gnu.org; Fri, 19 Sep 2014 10:00:17 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NC500900IA3ZX00@a-mtaout22.012.net.il> for 18504@debbugs.gnu.org; Fri, 19 Sep 2014 17:00:13 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NC5009FIIWDFXA0@a-mtaout22.012.net.il>; Fri, 19 Sep 2014 17:00:13 +0300 (IDT) Date: Fri, 19 Sep 2014 17:00:06 +0300 From: Eli Zaretskii Subject: Re: bug#18504: 24.3.93; posn-at-point intermittently returns wrong value for a valid buffer position In-reply-to: <541C33D1.6020707@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Gutov Message-id: <834mw31zix.fsf@gnu.org> References: <86mw9wfmxn.fsf@yandex.ru> <83ha041677.fsf@gnu.org> <541C0481.3050101@yandex.ru> <83a95v21qr.fsf@gnu.org> <541C2FBB.3030008@yandex.ru> <837g0z20oc.fsf@gnu.org> <541C33D1.6020707@yandex.ru> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18504 Cc: 18504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Fri, 19 Sep 2014 17:46:57 +0400 > From: Dmitry Gutov > CC: 18504@debbugs.gnu.org > > On 09/19/2014 05:35 PM, Eli Zaretskii wrote: > > > Btw, why is it important what happens when the user types C-g, i.e. if > > she abandons the completion? Or does the problem happen without C-g > > as well? > > I'm not quite sure how we get to that point, to be honest. ??? Your recipe includes fast presses on C-/ and C-g. Or did I misunderstand? > --- a/company.el > +++ b/company.el > @@ -782,7 +782,13 @@ means that `company-mode' is always turned on > except in `message-mode' buffers." > (cons (+ col (window-hscroll)) row))) > > (defun company--col-row (&optional pos) > - (company--posn-col-row (posn-at-point pos))) > + (let ((posn (posn-at-point pos))) > + ;; Completion should be invoked at column > 1. > + (when (zerop (car (posn-x-y posn))) > + (message "company--col-row zero!") > + (message "then:") > + (message "%s" (posn-x-y (posn-at-point pos)))) > + (company--posn-col-row posn))) > > (defun company--row (&optional pos) > (cdr (company--col-row pos))) > > I get: > > company--col-row zero! > then: > (0 . 198) Thanks, but with what sequence of commands do you get that? From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 19 10:06:55 2014 Received: (at 18504) by debbugs.gnu.org; 19 Sep 2014 14:06:55 +0000 Received: from localhost ([127.0.0.1]:45932 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUypq-00070T-Kg for submit@debbugs.gnu.org; Fri, 19 Sep 2014 10:06:54 -0400 Received: from mail-la0-f53.google.com ([209.85.215.53]:61093) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUypo-00070K-A5 for 18504@debbugs.gnu.org; Fri, 19 Sep 2014 10:06:53 -0400 Received: by mail-la0-f53.google.com with SMTP id ge10so3144495lab.40 for <18504@debbugs.gnu.org>; Fri, 19 Sep 2014 07:06:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=LrmXlKMUcc7eAmuYUt0PuMB+L+ojzKwBk4JQmF9LJ+8=; b=fDnOjHX6cW7yaSESMWS+O/N3zN+8CA8D4Fhd/BSV4c/SwgJrpZwsdtAJGwbz4xSJW9 4b3FZ89hbbLlUBfE9paduWc/37ihcG0Y+eXdeS0VZ7c03DvcMIG1Cg+rIcOeDW8J7FhB dha20XfYRPOGrdnITw6wQqESrkJNXnyTIRSpM2iGFxI/RTnmDoOxBbRrMzt2McxLzqTI WvKhE5PC8bJ0PxuUNAnr4RdUIcbZGEj2yOYB0SAHweXnPCzBVLrU20ebEYstDamwgU/5 PeUUX2PTN9RAsvpfIUwkGvoqA/YxeVrVbsggN+RBq3H9j0DG/0JIIq75O2Oce6NyxtKH R91g== X-Received: by 10.152.21.6 with SMTP id r6mr7228226lae.6.1411135611351; Fri, 19 Sep 2014 07:06:51 -0700 (PDT) Received: from [192.168.1.3] ([178.252.98.87]) by mx.google.com with ESMTPSA id xh2sm671000lbb.7.2014.09.19.07.06.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Sep 2014 07:06:50 -0700 (PDT) Message-ID: <541C3877.2010107@yandex.ru> Date: Fri, 19 Sep 2014 18:06:47 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18504: 24.3.93; posn-at-point intermittently returns wrong value for a valid buffer position References: <86mw9wfmxn.fsf@yandex.ru> <83ha041677.fsf@gnu.org> <541C0481.3050101@yandex.ru> <83a95v21qr.fsf@gnu.org> <541C2FBB.3030008@yandex.ru> <837g0z20oc.fsf@gnu.org> <541C33D1.6020707@yandex.ru> <834mw31zix.fsf@gnu.org> In-Reply-To: <834mw31zix.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18504 Cc: 18504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 09/19/2014 06:00 PM, Eli Zaretskii wrote: >> I'm not quite sure how we get to that point, to be honest. > > ??? Your recipe includes fast presses on C-/ and C-g. Or did I > misunderstand? Yes. I'm not sure how we get there code-wise, though. >> I get: >> >> company--col-row zero! >> then: >> (0 . 198) > > Thanks, but with what sequence of commands do you get that? Same as previously described, no change there. Just make sure to (setq bidi-display-reordering nil). When it's t, `posn-at-point' (likewise intermittently) returns a differentl wrong value. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 19 10:21:20 2014 Received: (at 18504) by debbugs.gnu.org; 19 Sep 2014 14:21:20 +0000 Received: from localhost ([127.0.0.1]:45937 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUz3o-0007M8-4y for submit@debbugs.gnu.org; Fri, 19 Sep 2014 10:21:20 -0400 Received: from mtaout21.012.net.il ([80.179.55.169]:36543) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUz3l-0007Lz-GV for 18504@debbugs.gnu.org; Fri, 19 Sep 2014 10:21:18 -0400 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0NC500C00JQ0KB00@a-mtaout21.012.net.il> for 18504@debbugs.gnu.org; Fri, 19 Sep 2014 17:21:15 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NC500C8CJVFI760@a-mtaout21.012.net.il>; Fri, 19 Sep 2014 17:21:15 +0300 (IDT) Date: Fri, 19 Sep 2014 17:21:07 +0300 From: Eli Zaretskii Subject: Re: bug#18504: 24.3.93; posn-at-point intermittently returns wrong value for a valid buffer position In-reply-to: <541C3877.2010107@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Gutov Message-id: <8338bn1yjw.fsf@gnu.org> References: <86mw9wfmxn.fsf@yandex.ru> <83ha041677.fsf@gnu.org> <541C0481.3050101@yandex.ru> <83a95v21qr.fsf@gnu.org> <541C2FBB.3030008@yandex.ru> <837g0z20oc.fsf@gnu.org> <541C33D1.6020707@yandex.ru> <834mw31zix.fsf@gnu.org> <541C3877.2010107@yandex.ru> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18504 Cc: 18504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Fri, 19 Sep 2014 18:06:47 +0400 > From: Dmitry Gutov > CC: 18504@debbugs.gnu.org > On 09/19/2014 06:00 PM, Eli Zaretskii wrote: > > >> I'm not quite sure how we get to that point, to be honest. > > > > ??? Your recipe includes fast presses on C-/ and C-g. Or did I > > misunderstand? > > Yes. I'm not sure how we get there code-wise, though. So I'm asking again: why does it matter what happens after a C-g, i.e. after the user abandons the completion? > >> I get: > >> > >> company--col-row zero! > >> then: > >> (0 . 198) > > > > Thanks, but with what sequence of commands do you get that? > > Same as previously described, no change there. Just make sure to (setq > bidi-display-reordering nil). Can you show the full value of posn-at-point in that case? From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 19 10:54:18 2014 Received: (at 18504) by debbugs.gnu.org; 19 Sep 2014 14:54:19 +0000 Received: from localhost ([127.0.0.1]:45955 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUzZh-0008Df-TS for submit@debbugs.gnu.org; Fri, 19 Sep 2014 10:54:18 -0400 Received: from mtaout23.012.net.il ([80.179.55.175]:46606) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XUzZf-0008DP-8t for 18504@debbugs.gnu.org; Fri, 19 Sep 2014 10:54:16 -0400 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0NC500200KMF7Y00@a-mtaout23.012.net.il> for 18504@debbugs.gnu.org; Fri, 19 Sep 2014 17:54:13 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NC50026KLED4E90@a-mtaout23.012.net.il>; Fri, 19 Sep 2014 17:54:13 +0300 (IDT) Date: Fri, 19 Sep 2014 17:54:05 +0300 From: Eli Zaretskii Subject: Re: bug#18504: 24.3.93; posn-at-point intermittently returns wrong value for a valid buffer position In-reply-to: <541C3877.2010107@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Gutov Message-id: <831tr71x0y.fsf@gnu.org> References: <86mw9wfmxn.fsf@yandex.ru> <83ha041677.fsf@gnu.org> <541C0481.3050101@yandex.ru> <83a95v21qr.fsf@gnu.org> <541C2FBB.3030008@yandex.ru> <837g0z20oc.fsf@gnu.org> <541C33D1.6020707@yandex.ru> <834mw31zix.fsf@gnu.org> <541C3877.2010107@yandex.ru> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18504 Cc: 18504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Fri, 19 Sep 2014 18:06:47 +0400 > From: Dmitry Gutov > CC: 18504@debbugs.gnu.org > > On 09/19/2014 06:00 PM, Eli Zaretskii wrote: > > >> I'm not quite sure how we get to that point, to be honest. > > > > ??? Your recipe includes fast presses on C-/ and C-g. Or did I > > misunderstand? > > Yes. I'm not sure how we get there code-wise, though. > > >> I get: > >> > >> company--col-row zero! > >> then: > >> (0 . 198) > > > > Thanks, but with what sequence of commands do you get that? > > Same as previously described, no change there. Just make sure to (setq > bidi-display-reordering nil). When it's t, `posn-at-point' (likewise > intermittently) returns a differentl wrong value. I tried that, but the probability of getting the problem is too low on my system. I see it maybe once in many hundreds of attempts. What I did see is that the coordinates returned in that case are for the end of buffer (or maybe the last visible glyph in the window, if EOB is beyond that). So the first thing I'd try to do is print the argument POS you pass to posn-at-point in those cases -- could it be t or some other incorrect/unexpected value? From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 19 13:52:39 2014 Received: (at 18504) by debbugs.gnu.org; 19 Sep 2014 17:52:39 +0000 Received: from localhost ([127.0.0.1]:46014 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XV2MI-0005G5-H7 for submit@debbugs.gnu.org; Fri, 19 Sep 2014 13:52:38 -0400 Received: from mail-la0-f44.google.com ([209.85.215.44]:32858) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XV2MF-0005Fw-2F for 18504@debbugs.gnu.org; Fri, 19 Sep 2014 13:52:35 -0400 Received: by mail-la0-f44.google.com with SMTP id q1so3592831lam.17 for <18504@debbugs.gnu.org>; Fri, 19 Sep 2014 10:52:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=VTDszAC4uJR1y3RXLWY5iMa88/17qdsKRlWN3nBDuZQ=; b=CUWWPGxrF1XXg0l2fUZXjKgkKh5TAsLYScgJ3960w8A7uqh1iD/5PC2rUhEVuNYtf9 1TSYxV7Wd2Wd/rLxW89kgjgw6hzjMJ7A7LM5hHPPXnTT1ugoPx1UZKDtx1py0+z9v1X+ zqwwNJfHvAUbx1Gdf0/GHJN4twndG/akGUdWNgkISh3kwtTWzHGdk3mMEmdbGOhxOfA6 0hnqfezRcs8noHII1k3Jx1OD4un4enfy3JG1gVaOCgiA97O+y8liq7lqYBux69c59Z09 f4YnL2txJFToKl1gIs++1wi8tR8g86OHWFQJofed4aT05UHhbRvBemb/5Jp9fEGmxTu1 9yVA== X-Received: by 10.112.146.103 with SMTP id tb7mr8167472lbb.26.1411149153518; Fri, 19 Sep 2014 10:52:33 -0700 (PDT) Received: from [192.168.1.3] ([178.252.98.87]) by mx.google.com with ESMTPSA id qr9sm858256lbb.11.2014.09.19.10.52.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Sep 2014 10:52:32 -0700 (PDT) Message-ID: <541C6D5D.7030309@yandex.ru> Date: Fri, 19 Sep 2014 21:52:29 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18504: 24.3.93; posn-at-point intermittently returns wrong value for a valid buffer position References: <86mw9wfmxn.fsf@yandex.ru> <83ha041677.fsf@gnu.org> <541C0481.3050101@yandex.ru> <83a95v21qr.fsf@gnu.org> <541C2FBB.3030008@yandex.ru> <837g0z20oc.fsf@gnu.org> <541C33D1.6020707@yandex.ru> <834mw31zix.fsf@gnu.org> <541C3877.2010107@yandex.ru> <831tr71x0y.fsf@gnu.org> In-Reply-To: <831tr71x0y.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18504 Cc: 18504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 09/19/2014 06:54 PM, Eli Zaretskii wrote: > I tried that, but the probability of getting the problem is too low on > my system. I see it maybe once in many hundreds of attempts. Have you tried that with the foofoofoo branch? The message output raises the odds on my machine considerably (1 in 5-10 attempts). > What I did see is that the coordinates returned in that case are for > the end of buffer (or maybe the last visible glyph in the window, if > EOB is beyond that). Have you tried adding more lines at the end of the buffer? Even in a tall window, and with eob far away, the incorrect value is only off by ~10 lines here. Which, incidentally, is close to how many lines the popup overlay takes up. > So the first thing I'd try to do is print the > argument POS you pass to posn-at-point in those cases -- could it be t > or some other incorrect/unexpected value? Nope. POS is always the same. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 19 15:34:09 2014 Received: (at 18504) by debbugs.gnu.org; 19 Sep 2014 19:34:10 +0000 Received: from localhost ([127.0.0.1]:46043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XV3wX-0007iF-Bh for submit@debbugs.gnu.org; Fri, 19 Sep 2014 15:34:09 -0400 Received: from mail-lb0-f172.google.com ([209.85.217.172]:33632) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XV3wR-0007i2-7W for 18504@debbugs.gnu.org; Fri, 19 Sep 2014 15:34:07 -0400 Received: by mail-lb0-f172.google.com with SMTP id p9so3143480lbv.17 for <18504@debbugs.gnu.org>; Fri, 19 Sep 2014 12:34:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=fWdjCwljGYaJfhpwFC2d9SPAra+JyMzuqgTsjZY/PX0=; b=zKiq+zCSbRO9o2mZd5LElTrGavh2wfIXNLex95bK3Dj0h1+2qIeqR1PBUcVEjPtMot 7M0v/ght87aYLWS6xMiekLNszs8zSA8c9453Jbz3PQoU5z+SygAGIhJNofWz6wzp01eh 6aOBWZPG2KWuxI2Xe1dMX6DoLRNR3V0zdp6Yze4VAAUDX1K9H8iOw4ebVbBrFX178aCQ YYVPo5P2odPzSXEp5EIe4lrr3RIcHq5qw+wOKkPmGZX5TwNZByR+orvCk1lmovoMwELz QB+eqdg3sL1zzxggKNaCT3kCN+vZIiB/mjxJazcEtMqwJ10VRfxlIUkIO8jUgODo0MZB MsHw== X-Received: by 10.152.198.204 with SMTP id je12mr9124117lac.52.1411155241740; Fri, 19 Sep 2014 12:34:01 -0700 (PDT) Received: from [192.168.1.3] ([178.252.98.87]) by mx.google.com with ESMTPSA id rl6sm935997lac.17.2014.09.19.12.33.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Sep 2014 12:34:00 -0700 (PDT) Message-ID: <541C8526.8010204@yandex.ru> Date: Fri, 19 Sep 2014 23:33:58 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18504: 24.3.93; posn-at-point intermittently returns wrong value for a valid buffer position References: <86mw9wfmxn.fsf@yandex.ru> <83ha041677.fsf@gnu.org> <541C0481.3050101@yandex.ru> <83a95v21qr.fsf@gnu.org> <541C2FBB.3030008@yandex.ru> <837g0z20oc.fsf@gnu.org> <541C33D1.6020707@yandex.ru> <834mw31zix.fsf@gnu.org> <541C3877.2010107@yandex.ru> <8338bn1yjw.fsf@gnu.org> In-Reply-To: <8338bn1yjw.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18504 Cc: 18504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 09/19/2014 06:21 PM, Eli Zaretskii wrote: >> Yes. I'm not sure how we get there code-wise, though. > > So I'm asking again: why does it matter what happens after a C-g, > i.e. after the user abandons the completion? 1. I'm not 100% sure yet if the problem happens after C-/ or C-g. Just that both need to be pressed at least once. 2. Apparently, one of the last C-g presses (probably the last one) calls `keyboard-quit' instead of `company-abort', which in the command, bound in `company-active-map', that aborts completion. So, I haven't wrapped my head around it yet, but on the odd chance I won't manage to do that before Emacs 24.4 release and it's not actually a bug in company-mode, maybe it's worth investigating whether `posn-at-point' behaves improperly anyway, first. >> Same as previously described, no change there. Just make sure to (setq >> bidi-display-reordering nil). > > Can you show the full value of posn-at-point in that case? With this code: diff --git a/company.el b/company.el index fdf09f7..5c901c6 100644 --- a/company.el +++ b/company.el @@ -782,7 +782,12 @@ means that `company-mode' is always turned on except in `message-mode' buffers." (cons (+ col (window-hscroll)) row))) (defun company--col-row (&optional pos) - (company--posn-col-row (posn-at-point pos))) + (message "foofoo\nfoo") + (let ((posn (posn-at-point pos))) + (when (zerop (car (posn-x-y posn))) + (message "posn at %s #1 %s" pos posn) + (message "posn at %s #2 %s" pos (posn-at-point pos))) + (company--posn-col-row posn))) (defun company--row (&optional pos) (cdr (company--col-row pos))) I get the following output: <...> foofoo foo posn at nil #1 (# 206 (0 . 270) 0 nil 206 (0 . 15) nil (0 . 0) (9 . 18)) posn at nil #2 (# 206 (0 . 270) 0 nil 206 (0 . 15) nil (0 . 0) (0 . 0)) foofoo foo posn at 195 #1 (# 206 (0 . 270) 0 nil 206 (0 . 15) nil (0 . 0) (0 . 0)) posn at 195 #2 (# 206 (0 . 270) 0 nil 206 (0 . 15) nil (0 . 0) (0 . 0)) <...> foofoo foo posn at nil #1 (# 206 (0 . 270) 0 nil 206 (0 . 15) nil (0 . 0) (0 . 0)) posn at nil #2 (# 206 (0 . 270) 0 nil 206 (0 . 15) nil (0 . 0) (0 . 0)) foofoo foo posn at 195 #1 (# 206 (0 . 270) 0 nil 206 (0 . 15) nil (0 . 0) (0 . 0)) posn at 195 #2 (# 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)). From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 19 15:36:03 2014 Received: (at 18504) by debbugs.gnu.org; 19 Sep 2014 19:36:03 +0000 Received: from localhost ([127.0.0.1]:46058 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XV3yN-0007lk-1f for submit@debbugs.gnu.org; Fri, 19 Sep 2014 15:36:03 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:52268) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XV3yJ-0007lF-Ve for 18504@debbugs.gnu.org; Fri, 19 Sep 2014 15:36:01 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NC500D00XYO7400@a-mtaout22.012.net.il> for 18504@debbugs.gnu.org; Fri, 19 Sep 2014 22:35:57 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NC500CKMYFXU570@a-mtaout22.012.net.il>; Fri, 19 Sep 2014 22:35:57 +0300 (IDT) Date: Fri, 19 Sep 2014 22:35:44 +0300 From: Eli Zaretskii Subject: Re: bug#18504: 24.3.93; posn-at-point intermittently returns wrong value for a valid buffer position In-reply-to: <541C6D5D.7030309@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Gutov Message-id: <83r3z7z9m7.fsf@gnu.org> References: <86mw9wfmxn.fsf@yandex.ru> <83ha041677.fsf@gnu.org> <541C0481.3050101@yandex.ru> <83a95v21qr.fsf@gnu.org> <541C2FBB.3030008@yandex.ru> <837g0z20oc.fsf@gnu.org> <541C33D1.6020707@yandex.ru> <834mw31zix.fsf@gnu.org> <541C3877.2010107@yandex.ru> <831tr71x0y.fsf@gnu.org> <541C6D5D.7030309@yandex.ru> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18504 Cc: 18504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Fri, 19 Sep 2014 21:52:29 +0400 > From: Dmitry Gutov > CC: 18504@debbugs.gnu.org > > On 09/19/2014 06:54 PM, Eli Zaretskii wrote: > > > I tried that, but the probability of getting the problem is too low on > > my system. I see it maybe once in many hundreds of attempts. > > Have you tried that with the foofoofoo branch? Of course. > > So the first thing I'd try to do is print the > > argument POS you pass to posn-at-point in those cases -- could it be t > > or some other incorrect/unexpected value? > > Nope. POS is always the same. I sometimes see nil there. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 19 15:38:25 2014 Received: (at 18504) by debbugs.gnu.org; 19 Sep 2014 19:38:25 +0000 Received: from localhost ([127.0.0.1]:46062 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XV40e-0007p9-R0 for submit@debbugs.gnu.org; Fri, 19 Sep 2014 15:38:25 -0400 Received: from mail-la0-f54.google.com ([209.85.215.54]:55683) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XV40d-0007p1-2R for 18504@debbugs.gnu.org; Fri, 19 Sep 2014 15:38:23 -0400 Received: by mail-la0-f54.google.com with SMTP id ge10so3783612lab.13 for <18504@debbugs.gnu.org>; Fri, 19 Sep 2014 12:38:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=+L06JpV4fVu3bOcqA0/eicdFIx5sq229dHWnaSLiCaA=; b=RHlJpjAzvYPZaAifmFTHBxX+w89YQ6TbguUOyGvwYErKkt4klmHtpUisHd9asu8Yvf HqyrF7D3kN5npO/g/E/fFigLiKcW2+LY9wBxBAF8EMqfFWoOYE/5ebN6JV9PWDCnBqiI E9nj21bJCUkgwzVqIuhkG+5O7ht81r9pceGoaNZZAGjFUMRw4lPDaI543iujgPDG4llq fRPGKN1PdwLvA/aNgv/kY4q6TrZ1S9JnBvvOEW5crmLWPX1s+NwPGDz5+opSF/Xznfde y4Y8TvJbkB8HKuwMgRgUBUDz+4UGTrM/raCwaoH2+E1lNcFmmK9JykS6fDV9bxeIo09y KkZA== X-Received: by 10.152.121.8 with SMTP id lg8mr5086907lab.98.1411155501783; Fri, 19 Sep 2014 12:38:21 -0700 (PDT) Received: from [192.168.1.3] ([178.252.98.87]) by mx.google.com with ESMTPSA id v13sm941352laz.10.2014.09.19.12.38.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Sep 2014 12:38:20 -0700 (PDT) Message-ID: <541C862A.708@yandex.ru> Date: Fri, 19 Sep 2014 23:38:18 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18504: 24.3.93; posn-at-point intermittently returns wrong value for a valid buffer position References: <86mw9wfmxn.fsf@yandex.ru> <83ha041677.fsf@gnu.org> <541C0481.3050101@yandex.ru> <83a95v21qr.fsf@gnu.org> <541C2FBB.3030008@yandex.ru> <837g0z20oc.fsf@gnu.org> <541C33D1.6020707@yandex.ru> <834mw31zix.fsf@gnu.org> <541C3877.2010107@yandex.ru> <831tr71x0y.fsf@gnu.org> <541C6D5D.7030309@yandex.ru> <83r3z7z9m7.fsf@gnu.org> In-Reply-To: <83r3z7z9m7.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18504 Cc: 18504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 09/19/2014 11:35 PM, Eli Zaretskii wrote: >> Nope. POS is always the same. > > I sometimes see nil there. True (there are two code paths that call the function, and one of them without the optional argument): but it just means "value of point", which is the same. And anyway the bug gets triggered in both situations, with nil, and with integer equal to point. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 20 03:14:02 2014 Received: (at 18504) by debbugs.gnu.org; 20 Sep 2014 07:14:02 +0000 Received: from localhost ([127.0.0.1]:46249 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XVErp-00080B-6W for submit@debbugs.gnu.org; Sat, 20 Sep 2014 03:14:01 -0400 Received: from mtaout25.012.net.il ([80.179.55.181]:39279) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XVErm-000801-1d for 18504@debbugs.gnu.org; Sat, 20 Sep 2014 03:13:59 -0400 Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0NC600200U99XV00@mtaout25.012.net.il> for 18504@debbugs.gnu.org; Sat, 20 Sep 2014 10:08:52 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NC6003R1UISFU00@mtaout25.012.net.il>; Sat, 20 Sep 2014 10:08:52 +0300 (IDT) Date: Sat, 20 Sep 2014 10:13:42 +0300 From: Eli Zaretskii Subject: Re: bug#18504: 24.3.93; posn-at-point intermittently returns wrong value for a valid buffer position In-reply-to: <541C8526.8010204@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Gutov Message-id: <83mw9uzrvd.fsf@gnu.org> References: <86mw9wfmxn.fsf@yandex.ru> <83ha041677.fsf@gnu.org> <541C0481.3050101@yandex.ru> <83a95v21qr.fsf@gnu.org> <541C2FBB.3030008@yandex.ru> <837g0z20oc.fsf@gnu.org> <541C33D1.6020707@yandex.ru> <834mw31zix.fsf@gnu.org> <541C3877.2010107@yandex.ru> <8338bn1yjw.fsf@gnu.org> <541C8526.8010204@yandex.ru> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18504 Cc: 18504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Fri, 19 Sep 2014 23:33:58 +0400 > From: Dmitry Gutov > CC: 18504@debbugs.gnu.org > > posn at nil #1 (# 206 (0 . 270) 0 nil 206 (0 . > 15) nil (0 . 0) (9 . 18)) > posn at nil #2 (# 206 (0 . 270) 0 nil 206 (0 . > 15) nil (0 . 0) (0 . 0)) > foofoo > foo > posn at 195 #1 (# 206 (0 . 270) 0 nil 206 (0 . > 15) nil (0 . 0) (0 . 0)) > posn at 195 #2 (# 206 (0 . 270) 0 nil 206 (0 . > 15) nil (0 . 0) (0 . 0)) > <...> > foofoo > foo > posn at nil #1 (# 206 (0 . 270) 0 nil 206 (0 . > 15) nil (0 . 0) (0 . 0)) > posn at nil #2 (# 206 (0 . 270) 0 nil 206 (0 . > 15) nil (0 . 0) (0 . 0)) > foofoo > foo > posn at 195 #1 (# 206 (0 . 270) 0 nil 206 (0 . > 15) nil (0 . 0) (0 . 0)) > posn at 195 #2 (# 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. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 23 14:39:57 2014 Received: (at 18504-done) by debbugs.gnu.org; 23 Sep 2014 18:39:57 +0000 Received: from localhost ([127.0.0.1]:50225 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XWV0H-0005WN-2V for submit@debbugs.gnu.org; Tue, 23 Sep 2014 14:39:57 -0400 Received: from mail-lb0-f169.google.com ([209.85.217.169]:64499) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XWV0C-0005WB-VG for 18504-done@debbugs.gnu.org; Tue, 23 Sep 2014 14:39:53 -0400 Received: by mail-lb0-f169.google.com with SMTP id b12so9351084lbj.28 for <18504-done@debbugs.gnu.org>; Tue, 23 Sep 2014 11:39:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=LKDE4j5HNXhEsfur1+CYnJjOheIu7Z/pnK0HvamqbfY=; b=xjiyzC1GR+d/EanUD6yfGeMBgKL8TprkXKJjVoQp5u5JMCLEoLfo45Dw/a0hlOhNDA 9x+joSSdZT1sJbRfdS59/aG0TUE1rAwM+2s1Skb0KaVSU2FgioC2MPJzFxDszkFd3F76 FKsyOQhEi1gYt86D098agPTBvCKjNV9YdGUBW+oLet6eHh7Yo9WBNkTSBzGIhQjsuhW8 jK3XkVaVFpF1HkCE0kWUW1BP9UrcNyonS2Nzphl++Bo910WEunjJWtYFdLyUOxpBNTiO 982QLPrbjrdfKNTO9g/ALcGD1PyJN4/gehvw7es78xxGDR8gDSaMDPaSqVq0yjrVWif3 ffAw== X-Received: by 10.152.43.99 with SMTP id v3mr1399970lal.13.1411497591356; Tue, 23 Sep 2014 11:39:51 -0700 (PDT) Received: from [192.168.1.3] ([178.252.98.87]) by mx.google.com with ESMTPSA id pc7sm5057083lbb.5.2014.09.23.11.39.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Sep 2014 11:39:50 -0700 (PDT) Message-ID: <5421BE75.5020206@yandex.ru> Date: Tue, 23 Sep 2014 22:39:49 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18504: 24.3.93; posn-at-point intermittently returns wrong value for a valid buffer position References: <86mw9wfmxn.fsf@yandex.ru> <83ha041677.fsf@gnu.org> <541C0481.3050101@yandex.ru> <83a95v21qr.fsf@gnu.org> <541C2FBB.3030008@yandex.ru> <837g0z20oc.fsf@gnu.org> <541C33D1.6020707@yandex.ru> <834mw31zix.fsf@gnu.org> <541C3877.2010107@yandex.ru> <8338bn1yjw.fsf@gnu.org> <541C8526.8010204@yandex.ru> <83mw9uzrvd.fsf@gnu.org> In-Reply-To: <83mw9uzrvd.fsf@gnu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 18504-done Cc: 18504-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 09/20/2014 11:13 AM, Eli Zaretskii wrote: > 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. I see, thanks. But does the fact that we get a different return value with different values of bidi-display-reordering, look right to you? > 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. Yes, seems to be a bug with the way we set the "current" keymap when completion is performed (the popup is displayed only during that time). Thank you for confirming, I'm looking into it. > 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. Ok. I can just directly check if the overlay has the `invisible' property set to t or not, though. We keep a reference to the overlay. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 23 15:16:25 2014 Received: (at 18504) by debbugs.gnu.org; 23 Sep 2014 19:16:25 +0000 Received: from localhost ([127.0.0.1]:50253 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XWVZZ-0006Ss-7M for submit@debbugs.gnu.org; Tue, 23 Sep 2014 15:16:25 -0400 Received: from mtaout21.012.net.il ([80.179.55.169]:39862) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XWVZW-0006Si-Aq for 18504@debbugs.gnu.org; Tue, 23 Sep 2014 15:16:23 -0400 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0NCD00500C4I0V00@a-mtaout21.012.net.il> for 18504@debbugs.gnu.org; Tue, 23 Sep 2014 22:16:19 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NCD004ZQC77ZS30@a-mtaout21.012.net.il>; Tue, 23 Sep 2014 22:16:19 +0300 (IDT) Date: Tue, 23 Sep 2014 22:16:14 +0300 From: Eli Zaretskii Subject: Re: bug#18504: 24.3.93; posn-at-point intermittently returns wrong value for a valid buffer position In-reply-to: <5421BE75.5020206@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Gutov Message-id: <83wq8uw3k1.fsf@gnu.org> References: <86mw9wfmxn.fsf@yandex.ru> <83ha041677.fsf@gnu.org> <541C0481.3050101@yandex.ru> <83a95v21qr.fsf@gnu.org> <541C2FBB.3030008@yandex.ru> <837g0z20oc.fsf@gnu.org> <541C33D1.6020707@yandex.ru> <834mw31zix.fsf@gnu.org> <541C3877.2010107@yandex.ru> <8338bn1yjw.fsf@gnu.org> <541C8526.8010204@yandex.ru> <83mw9uzrvd.fsf@gnu.org> <5421BE75.5020206@yandex.ru> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18504 Cc: 18504@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Tue, 23 Sep 2014 22:39:49 +0400 > From: Dmitry Gutov > CC: 18504-done@debbugs.gnu.org > > On 09/20/2014 11:13 AM, Eli Zaretskii wrote: > > > 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. > > I see, thanks. But does the fact that we get a different return value > with different values of bidi-display-reordering, look right to you? You are not supposed to change the value of bidi-display-reordering. This variable exists only for debugging. So what happens when it is nil is "undefined behavior" ;-) From unknown Tue Jun 24 13:52:58 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 22 Oct 2014 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator