all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Dmitry Gutov <dgutov@yandex.ru>
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, 07 Aug 2020 08:42:12 +0300	[thread overview]
Message-ID: <837dub811n.fsf@gnu.org> (raw)
In-Reply-To: <7e9af86a-961e-8afd-0d62-0a1c79b96b40@yandex.ru> (message from Dmitry Gutov on Fri, 7 Aug 2020 02:16:12 +0300)

> Cc: 42552@debbugs.gnu.org
> From: Dmitry Gutov <dgutov@yandex.ru>
> Date: Fri, 7 Aug 2020 02:16:12 +0300
> 
> 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?

That's largely orthogonal, as most overlays don't specify 'face'
AFAIK.  But yes, this could also be a problem after so many years of
disregarding it.  If we really want something like that, perhaps a
separate new property (like 'overriding-face') would be a better way.

> >> 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?

Perhaps not, I haven't checked.

> 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's expected due to face-merging, no?

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

Should we close this bug or keep it open?





  reply	other threads:[~2020-08-07  5:42 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
2020-08-07  5:42                 ` Eli Zaretskii [this message]
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=837dub811n.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=42552@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 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.