From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#20847: [display engine] 25.0.50; company-mode popup makes point jump to an entirely different location Date: Sun, 21 Jun 2015 22:23:09 +0300 Message-ID: <83a8vsj276.fsf@gnu.org> References: <868ubgld8y.fsf@yandex.ru> <83mvzvjz3w.fsf@gnu.org> <83wpyyiond.fsf@gnu.org> <5586C2A8.1020904@yandex.ru> <83h9q1hv0t.fsf@gnu.org> <5586FD0F.8090300@yandex.ru> <83d20oj4wo.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1434914662 24076 80.91.229.3 (21 Jun 2015 19:24:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 21 Jun 2015 19:24:22 +0000 (UTC) Cc: 20847@debbugs.gnu.org To: dgutov@yandex.ru Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 21 21:24:12 2015 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 1Z6kqg-0000zp-Q2 for geb-bug-gnu-emacs@m.gmane.org; Sun, 21 Jun 2015 21:24:11 +0200 Original-Received: from localhost ([::1]:37103 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z6kqf-00042K-VH for geb-bug-gnu-emacs@m.gmane.org; Sun, 21 Jun 2015 15:24:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53868) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z6kqb-00041T-JN for bug-gnu-emacs@gnu.org; Sun, 21 Jun 2015 15:24:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z6kqY-0001yy-CR for bug-gnu-emacs@gnu.org; Sun, 21 Jun 2015 15:24:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52141) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z6kqY-0001yl-9h for bug-gnu-emacs@gnu.org; Sun, 21 Jun 2015 15:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z6kqY-00080C-1n for bug-gnu-emacs@gnu.org; Sun, 21 Jun 2015 15:24:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Jun 2015 19:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20847 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20847-submit@debbugs.gnu.org id=B20847.143491461430720 (code B ref 20847); Sun, 21 Jun 2015 19:24:01 +0000 Original-Received: (at 20847) by debbugs.gnu.org; 21 Jun 2015 19:23:34 +0000 Original-Received: from localhost ([127.0.0.1]:53587 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z6kq5-0007zP-Ra for submit@debbugs.gnu.org; Sun, 21 Jun 2015 15:23:34 -0400 Original-Received: from mtaout24.012.net.il ([80.179.55.180]:52321) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z6kq2-0007zA-Ma for 20847@debbugs.gnu.org; Sun, 21 Jun 2015 15:23:32 -0400 Original-Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0NQB008006NYOS00@mtaout24.012.net.il> for 20847@debbugs.gnu.org; Sun, 21 Jun 2015 22:14:54 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NQB008356SU4B10@mtaout24.012.net.il>; Sun, 21 Jun 2015 22:14:54 +0300 (IDT) In-reply-to: <83d20oj4wo.fsf@gnu.org> X-012-Sender: halo1@inter.net.il 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:104187 Archived-At: > Date: Sun, 21 Jun 2015 21:24:39 +0300 > From: Eli Zaretskii > Cc: 20847@debbugs.gnu.org > > > >> - The bug only manifests after the step 9 (backspacing), whereas the > > >> whole explanation seems to apply to the step 6 as well. Yet, point stays > > >> in place there. > > > > > > Like I said, I didn't investigate that. I think some redisplay > > > optimization is responsible. If it's important to have the same > > > (mis)behavior in both cases, I can look into that. > > > > Couldn't the same optimization have a reason to be enabled in both > > cases? It might be worth investigating, at least. > > I will see what I can do. The reason is that there's an invisible property on buffer text. When redisplay fails to place the cursor where it belongs, i.e. on the line that ends with "hel", it looks for alternative strategies. One of those is for a use case where point is at the beginning of invisible text that is before the 1st character displayed in the screen line. In that case, we put cursor where the invisible text ends. Of course, the code which handles that was not written for when the same text also has an overlay string, so it misbehaves. I can make the code bypass this in the case in point, but the result will be that cursor will be displayed at the end of the first screen line, which is hardly better. So I think we should try telling the display engine where to put the cursor via the 'cursor' property on buffer text, as proposed earlier.