unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 38563@debbugs.gnu.org
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	[thread overview]
Message-ID: <83h8248wio.fsf@gnu.org> (raw)
In-Reply-To: <2203b03e-5558-1fe1-788a-4006602626f2@yandex.ru> (message from Dmitry Gutov on Fri, 13 Dec 2019 00:13:37 +0200)

> Cc: 38563@debbugs.gnu.org
> From: Dmitry Gutov <dgutov@yandex.ru>
> 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.





  reply	other threads:[~2019-12-13  8:22 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-11  1:13 bug#38563: 27.0.50; Company popup renders with newlines (?) inheriting the bg properties of the character at next line's bol Dmitry Gutov
2019-12-11 17:20 ` Eli Zaretskii
2019-12-11 21:47   ` Dmitry Gutov
2019-12-12 11:32     ` Eli Zaretskii
2019-12-12 22:13       ` Dmitry Gutov
2019-12-13  8:22         ` Eli Zaretskii [this message]
2019-12-13  9:30           ` Eli Zaretskii
2019-12-13 10:31             ` Eli Zaretskii
2019-12-13 12:00               ` Dmitry Gutov
2019-12-13 10:17           ` Dmitry Gutov
2019-12-13 14:12             ` Eli Zaretskii
2019-12-13 15:04               ` Dmitry Gutov
2019-12-13 15:32                 ` Eli Zaretskii
2019-12-13 23:10                   ` Dmitry Gutov
2019-12-14  8:13                     ` Eli Zaretskii
2019-12-15 22:26                       ` Dmitry Gutov
2019-12-16 15:49                         ` Eli Zaretskii
2019-12-18 20:37                           ` Dmitry Gutov
2019-12-21  7:53                             ` Eli Zaretskii
2019-12-21 13:22                               ` Dmitry Gutov
2019-12-21 13:31                                 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83h8248wio.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=38563@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).