From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#38563: 27.0.50; Company popup renders with newlines (?) inheriting the bg properties of the character at next line's bol Date: Fri, 13 Dec 2019 10:22:55 +0200 Message-ID: <83h8248wio.fsf@gnu.org> References: <4c2a9d55-57d1-4c19-fe20-4ccf61d20d68@yandex.ru> <83o8weaiem.fsf@gnu.org> <4220b126-0511-d6ee-521d-d79f463ab6ee@yandex.ru> <8336dpaiee.fsf@gnu.org> <2203b03e-5558-1fe1-788a-4006602626f2@yandex.ru> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="268493"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 38563@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 13 09:24:14 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ifgFA-0017hG-D0 for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Dec 2019 09:24:12 +0100 Original-Received: from localhost ([::1]:42172 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ifgF8-0000ef-Mc for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Dec 2019 03:24:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42895) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ifgF1-0000eL-SY for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2019 03:24:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ifgF0-00072x-Pj for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2019 03:24:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55230) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ifgEz-00072F-UC for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2019 03:24:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ifgEz-0003mc-QO for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2019 03:24:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Dec 2019 08:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38563 X-GNU-PR-Package: emacs Original-Received: via spool by 38563-submit@debbugs.gnu.org id=B38563.157622538914481 (code B ref 38563); Fri, 13 Dec 2019 08:24:01 +0000 Original-Received: (at 38563) by debbugs.gnu.org; 13 Dec 2019 08:23:09 +0000 Original-Received: from localhost ([127.0.0.1]:32970 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ifgE8-0003lV-R1 for submit@debbugs.gnu.org; Fri, 13 Dec 2019 03:23:09 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:51059) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ifgE6-0003kz-QO for 38563@debbugs.gnu.org; Fri, 13 Dec 2019 03:23:08 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:51536) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ifgE1-0005Jg-Hj; Fri, 13 Dec 2019 03:23:01 -0500 Original-Received: from [176.228.60.248] (port=1221 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ifgE0-0002cQ-N2; Fri, 13 Dec 2019 03:23:01 -0500 In-reply-to: <2203b03e-5558-1fe1-788a-4006602626f2@yandex.ru> (message from Dmitry Gutov on Fri, 13 Dec 2019 00:13:37 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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: 209.51.188.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:173251 Archived-At: > Cc: 38563@debbugs.gnu.org > From: Dmitry Gutov > Date: Fri, 13 Dec 2019 00:13:37 +0200 > > On 12.12.2019 13:32, Eli Zaretskii wrote: > > The "character at next bol" sounds strange, since the display engine > > has no look-ahead -- it never examines characters on the next line > > while displaying the current line. But it all starts making sense > > when you recall that Company mode puts its overlay on that next line. > > So the "inherited" face is not on the next line, it is at the position > > where the Company overlay is set. IOW, it's the "underlying face" for > > the overlay string. > > Yeah, OK. Now that you mentioned the 'default' face, I remembered: it's > used there exactly so that we don't inherit the background from the > "underlying face". That's no longer "good enough", see below. > > Should be fixed now, please test. > > It looks fixed in the whitespace-mode example, but not in the other one. > > Just call M-x company-complete-common on the "Author:" line in a LogEdit > buffer to reproduce. (I've tested common d7efe98951). That's not a bug: the face on that thin line on whose first character you put the tooltip overlay has a non-nil :extend attribute, so Company will have to explicitly say ':extend nil' in its face(s) to countermand that. Recall that a string from a display property merges into its face all the attributes from the "underlying" face, so with the current :extend machinery it is no longer enough just to specify a background color in the display string's face, as you did before. Btw, if you used 'default instead of '(default), I think that would have avoided the issue as well, because the default face gets a special treatment in this context. > By the way, I kind of wonder why the fix added more lines than it > deleted. ??? I added a condition under which not to merge a face, so how can I avoid adding a few lines? The addition is 7 lines of code, including a small refactoring, all the rest is comments. > Before, this feature just worked. Was that simply by accident? > Or were the changes brought in by :extend major enough? Previously, whether a face's background was extended to EOL was determined only by the background color of the newline; now the :extend attribute determines that independently of the background color.