From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#27427: 26.0.50; Native line numbers lead to display error in company-mode popup Date: Wed, 21 Jun 2017 05:18:38 +0300 Message-ID: <00f59a24-2d80-ca47-b6f3-3d219aa5aa3f@yandex.ru> References: <611468a0-3115-813a-7347-d0c06e155831@web.de> <83vanrx5uo.fsf@gnu.org> <362a7d18-7f05-2e99-f8b3-41c353cf234f@yandex.ru> <83h8zawvih.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1498011551 1366 195.159.176.226 (21 Jun 2017 02:19:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 21 Jun 2017 02:19:11 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:54.0) Gecko/20100101 Thunderbird/54.0 Cc: alexanderm@web.de, 27427@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 21 04:19:07 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dNVEY-0008Li-V8 for geb-bug-gnu-emacs@m.gmane.org; Wed, 21 Jun 2017 04:19:07 +0200 Original-Received: from localhost ([::1]:51449 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNVEc-00008V-DZ for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Jun 2017 22:19:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNVEX-00008M-Cb for bug-gnu-emacs@gnu.org; Tue, 20 Jun 2017 22:19:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNVEU-0007aW-8L for bug-gnu-emacs@gnu.org; Tue, 20 Jun 2017 22:19:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55975) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dNVEU-0007aO-4L for bug-gnu-emacs@gnu.org; Tue, 20 Jun 2017 22:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dNVET-0001Le-P5 for bug-gnu-emacs@gnu.org; Tue, 20 Jun 2017 22:19:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 Jun 2017 02:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27427 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27427-submit@debbugs.gnu.org id=B27427.14980115295164 (code B ref 27427); Wed, 21 Jun 2017 02:19:01 +0000 Original-Received: (at 27427) by debbugs.gnu.org; 21 Jun 2017 02:18:49 +0000 Original-Received: from localhost ([127.0.0.1]:58652 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dNVEH-0001LE-Gr for submit@debbugs.gnu.org; Tue, 20 Jun 2017 22:18:49 -0400 Original-Received: from mail-wr0-f182.google.com ([209.85.128.182]:35163) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dNVEF-0001L0-GC for 27427@debbugs.gnu.org; Tue, 20 Jun 2017 22:18:47 -0400 Original-Received: by mail-wr0-f182.google.com with SMTP id y25so75525246wrd.2 for <27427@debbugs.gnu.org>; Tue, 20 Jun 2017 19:18:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=b1J2yZQRfDnrIKk7fmbjOP4ceAW5pU2FsSAvtlcbDqo=; b=atOvBi+6zkQAfJvfRwVEfGAHmArmS/5Yb2fyaVQR0KqzjZxkAQ7KGWEkb4gv6jMvyM lrMUPB1KLVO+2XFIIgKaansOzLBORUlEKbVzAD7sqWFwiJBnvcJMAcwWeez3wlWK3QCt 2/T2cU9WUlEBaUi4dHcQZOVMyVFPD7GluCkdw+M51BiWleX6VCzQtmIlJjl0sZRjn2me xQ1j7ASzuQ6K+jsNV7V3BugDTRWKWat62r0Q2Pt45XAhWC1vwZYW9OFz2aSWgdFwUudc D1Uid7S17Lu94nsrwsHR81OQozRcZt41ShKifBL7rkUfwWaZdb1/4VAYIDy2DRJiHOG2 mv8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=b1J2yZQRfDnrIKk7fmbjOP4ceAW5pU2FsSAvtlcbDqo=; b=HBXojvhQyFq+QRaw2mlphwvN3dgxsSyVC22zqsPZOdJglQokNtjSsSWEBCp4Ni5xCZ BDI4NEmjHVUgK7JCGxrtJACrFup8Z8uqdMW7Z5b/TxZesRXjcPLr152bEoIYKeDHAcy3 8BMS17YHsprP7PkfzPnM1KpwWwn9plmLTJdpa1Vl0LQB9n9/PsZD+YGOYjVS8nmZv2wl awVTny4xPREcCzJ0nJZ8TuxixJnDTFNHTmNjmNMu8udvP5ARlhk7H65pG3xCaWfBcDbP kmDdtqcMbsPObIPOiOXO7yIKhpkvV6QQ+EC/Gh7JT/UVmoupurpi22L6vMc5b14GK0Il HAlw== X-Gm-Message-State: AKS2vOzrWjTq9VduBvYiGhgub7OfEPMSuBXt1aDLrP8k7XkY8Vt/vjKR G3DLDdPyyuFoAutuXZE= X-Received: by 10.28.47.79 with SMTP id v76mr4714753wmv.34.1498011521525; Tue, 20 Jun 2017 19:18:41 -0700 (PDT) Original-Received: from [192.168.1.3] ([185.105.174.193]) by smtp.googlemail.com with ESMTPSA id v13sm14441964wmd.5.2017.06.20.19.18.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jun 2017 19:18:40 -0700 (PDT) In-Reply-To: <83h8zawvih.fsf@gnu.org> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:133791 Archived-At: On 6/20/17 6:04 PM, Eli Zaretskii wrote: >> With (setq line-prefix "..."), >> >> (car (posn-col-row (posn-at-point))) suddenly returns 3 at bol. > > I guess you think this result is incorrect, but I don't think I > understand why. posn-col-row returns the horizontal window-relative > coordinate in units of the frame's canonical column width, so it is > expected that its value at BOL will be non-zero when there's a > line-prefix displayed there. From where I'm standing, it points to a design flaw in how line-prefix is implemented. Or at least it hints that the native line numbering shouldn't use it, and should use fringe or margin (like linum and nlinum do), or something like them that's considered to be outside of the window by the display engine. > Can you tell how this value is used in company-mode? I think the key > to my understanding why this change interferes with company-mode is in > that direction. We've discussed it before, but here's a reminder. Company draws popup by taking a number of lines that the popup would cover, collecting them into strings, modifying those strings to "draw" the popup on top of them. These operations use the "current row" and "current column" results, respectively. Then, it (without going into nuance) puts an overlay over the said buffer lines, makes it `invisible', and puts a strings consisting of concatenation of those modified lines on the overlay's `display' property. When the position at bol is interpreted as "column 3", all lines of the rectangle are rendered starting with the fourth character of each line. Somehow, the result turns out to be uneven, and the first line of the overlay doesn't get affected by line-prefix (so the popup there ends up at the proper horizontal position), but the rest are affected, and they're displaced three columns to the right. >> We do support line-prefix when it's assigned via text property. > > If you do support the line-prefix property, why are there problems > with line-prefix the variable? The effect on display is the same, > AFAIU. The way we support the property is impossible to translate to the variable. For each line, we take the value of `line-prefix', prepend it to the line text, and the popup overlay (the one that covers all of the affected lines) gets the `line-prefix' property set to "".