all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 42552@debbugs.gnu.org
Subject: bug#42552: 28.0.50; Overlay 'face' property doesn't set the "underlying face" for 'after-string'
Date: Fri, 7 Aug 2020 02:16:12 +0300	[thread overview]
Message-ID: <7e9af86a-961e-8afd-0d62-0a1c79b96b40@yandex.ru> (raw)
In-Reply-To: <831rkl9m1e.fsf@gnu.org>

On 05.08.2020 17:58, Eli Zaretskii wrote:

>> Should the "overlay string" obey the underlying face, though? It doesn't
>> obey the 'face' property, like you explained. Seems inconsistent.
> 
> Emacs always worked this way, so changing it now is probably a big
> deal.  AFAIU, the reason for this behavior is so that overlay strings
> which specify no faces use the same face as the surrounding text.
> Which sounds reasonable.

Do you imagine creating a better consistency the other way (by having 
the 'face' property affect overlay strings) would be as likely to create 
problems?

>>> Emacs 26 and before simply extended the face of the last character of
>>> the line.  Emacs 27 doesn't do that, it examines the faces in effect
>>> anew, filtering out those which don't have the :extend attribute set,
>>> so the result is different.  This is exactly the change in behavior
>>> that was intended, not a bug.
>>
>> But it should obey :extend set to nil, shouldn't it?
> 
> It does, but :extend nil doesn't override :extend t, it just says that
> the face with a nil :extend attribute should not be considered when
> computing the face for the empty space past EOL.

BTW, are there other attributes with a similar property? For example, I 
find that I have to add (:inverse-video nil) explicitly to the computed 
face which would be appended to the overlay string's 'face' properties.

Otherwise, the newlines are still "extended" with the "inverse video" 
effect. Try this for an example:

1. Eval:

(with-silent-modifications
   (insert (propertize "abc"
                       'font-lock-face
                       '((:background "green" :extend t)
                         default
                         ( :inverse-video t
                           :foreground "yellow"
                           :extend t)))))

2. C-j

The "extended" newline is yellow.

>> That seems to work. It also has the significant benefit on working in
>> Emacs 27, so if that's the approach you recommend in the end, the fix
>> you already pushed to master might be unnecessary.
> 
> The fix I pushed might not be necessary for company's sake, but it is
> necessary for other use cases, because without it we don't behave as
> documented when :extend attribute is not present: we extend using the
> wrong background color.

All right, thank you.

I'll try to implement this all as suggested, and will come back after.





  reply	other threads:[~2020-08-06 23:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-26 18:23 bug#42552: 28.0.50; Overlay 'face' property doesn't set the "underlying face" for 'after-string' Dmitry Gutov
2020-07-26 19:02 ` Eli Zaretskii
2020-07-26 20:00   ` Dmitry Gutov
2020-07-30 14:04     ` Eli Zaretskii
2020-08-02 23:37       ` Dmitry Gutov
2020-08-03 15:09         ` Eli Zaretskii
2020-08-04 23:55           ` Dmitry Gutov
2020-08-05 14:58             ` Eli Zaretskii
2020-08-06 23:16               ` Dmitry Gutov [this message]
2020-08-07  5:42                 ` Eli Zaretskii
2020-08-10 22:27                   ` Dmitry Gutov
2020-08-11 15:10                     ` 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

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

  git send-email \
    --in-reply-to=7e9af86a-961e-8afd-0d62-0a1c79b96b40@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=42552@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.