From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov 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 16:30:25 +0300 Message-ID: <5586BC71.3080608@yandex.ru> References: <868ubgld8y.fsf@yandex.ru> <83mvzvjz3w.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1434893502 30418 80.91.229.3 (21 Jun 2015 13:31:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 21 Jun 2015 13:31:42 +0000 (UTC) Cc: 20847@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 21 15:31:31 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 1Z6fLP-0003Li-1o for geb-bug-gnu-emacs@m.gmane.org; Sun, 21 Jun 2015 15:31:31 +0200 Original-Received: from localhost ([::1]:36339 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z6fLO-0000j0-9G for geb-bug-gnu-emacs@m.gmane.org; Sun, 21 Jun 2015 09:31:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58503) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z6fLK-0000iv-Ch for bug-gnu-emacs@gnu.org; Sun, 21 Jun 2015 09:31:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z6fL9-0008QR-Mm for bug-gnu-emacs@gnu.org; Sun, 21 Jun 2015 09:31:26 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51672) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z6fL9-0008QM-JR for bug-gnu-emacs@gnu.org; Sun, 21 Jun 2015 09:31:15 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z6fL7-0006i1-Lv for bug-gnu-emacs@gnu.org; Sun, 21 Jun 2015 09:31:14 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Jun 2015 13:31:08 +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.143489345225766 (code B ref 20847); Sun, 21 Jun 2015 13:31:08 +0000 Original-Received: (at 20847) by debbugs.gnu.org; 21 Jun 2015 13:30:52 +0000 Original-Received: from localhost ([127.0.0.1]:53118 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z6fKh-0006hS-S6 for submit@debbugs.gnu.org; Sun, 21 Jun 2015 09:30:49 -0400 Original-Received: from mail-wi0-f176.google.com ([209.85.212.176]:38467) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z6fKV-0006h5-BD for 20847@debbugs.gnu.org; Sun, 21 Jun 2015 09:30:37 -0400 Original-Received: by wibdq8 with SMTP id dq8so53399449wib.1 for <20847@debbugs.gnu.org>; Sun, 21 Jun 2015 06:30:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=xupmVhHQxavpAmIDaMJkIQu7BGgU8cTCXbf/YfHi2YY=; b=rPUaRaFNDYkQpVAPdjctU7mXucOn+t0tU87H5JmBhRpk21OVIxwiIUqGSVmVG08Kuy flgkiodyf0SgLyZjlX0YWRVjgUu3jusAqmBwNFMiiQEUHKg5nfoUEVByaxp2ZxjR38Py r4wtdUu/aGCNNT28fvrf5czB/Kpd2LxlgbEpL6ABA+9tvdnqVL/wwrYHRXdnROlxTBNY dNL5ZDW7vENBkz16RTpodSogl+iJ06dVrB+dromm8hlPrBPe9l4VAzARs4EpBvgz+x/m yAS6i63TiGL9nPn+Wf407dtPHDP8ym4cO6SZ6U+brDscUytY0/xEX6FGh1LZZMpxjNYK 1V1w== X-Received: by 10.180.95.10 with SMTP id dg10mr23597058wib.41.1434893429824; Sun, 21 Jun 2015 06:30:29 -0700 (PDT) Original-Received: from [192.168.1.2] ([82.102.93.54]) by mx.google.com with ESMTPSA id q9sm12445769wiz.23.2015.06.21.06.30.29 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Jun 2015 06:30:29 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0 In-Reply-To: <83mvzvjz3w.fsf@gnu.org> 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:104170 Archived-At: On 06/19/2015 10:07 PM, Eli Zaretskii wrote: Hi Eli, sorry for the late reply. > . There's no 'cursor' property on the overlay string that Company > creates for its "tooltip" of completions. Or at least I couldn't > find that property: I tried both "M-x describe-text-properties" and > looking at the overlay string in GDB -- I see no 'cursor' property, > certainly not on the newline that starts the string. If indeed > there is such a property there, please tell how to see it. I'm sorry, my memory of that code was unclear. `cursor' is currently used only under certain rare condition, but see the end of `company--replacement-string', where it's applied. Even if remove the "when" condition to put it on all the time, the behavior doesn't change. By the way, since we're now discussing the changes to Company code, let's use the master version from git@github.com:company-mode/company-mode.git. Thus, the scenario changes from installing it from ELPA, to cloning the repo, adding the dir to `load-path' and `(require 'company)'. > . In any case, you cannot put the 'cursor' property on a newline and > hope it to work: the newline doesn't leave any glyphs on display, > certainly not when the cursor is displayed on the fringe. So the > display engine doesn't know you've put the 'cursor' property there. Which character should I put this property on in this situation, then? The other odd thing is that the cursor is displayed in the margin opposite the last completion (there are 2 or 3 of them), but the overlay is actually of fixed size (10). So the cursor margin position doesn't correspond to the value of point, nor either of the overlay bounds. > . The overlay string generated by Company in this case is > problematic: it puts a newline at the end of each screen line, and > that removes the last character of each screen line from display. > I don't understand why you need to insert newlines when the > original text lines were one long continued line. This is a bug in > Company. It's a workaround I felt forced to take for the bug#18285. Since you've vetoed my suggestion to prioritize `invisible' over `display', the natural solution is to generally start the overlay a bit earlier. It also simplifies some logic in the code, because sometimes we have to do this anyway (when the popup is displayed below the last line, and it has no trailing newline). Although this reason is less important. > (Any > idea why Company's post-command-hook calls sit-for, thus forcing > redisplay?) The current Company master has no `sit-for' calls, but both problems are still there.