help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I remove effects of text properties in 'before-string


From: Eli Zaretskii
Subject: Re: How can I remove effects of text properties in 'before-string
Date: Sun, 22 Oct 2017 19:50:29 +0300

> Date: Sun, 22 Oct 2017 09:33:08 -0700 (PDT)
> From: Drew Adams <drew.adams@oracle.com>
> 
> > > The string "Hi there!" is also highlighted. How can I disable
> > > that?
> > 
> > Give the string a distinct face.
> 
> Why doesn't it use the `default' face?  If no `face'
> property is given to the string, why would the effective
> face be something different from `default'?

That's the general way Emacs works: an overlay string which wasn't
specified a face uses the face of the "underlying" text.  You will see
the same if the overlay string is displayed in the text area, and
displaying it in the margins doesn't change this basic fact.

Personally, I think nothing else makes more sense, but that's me.

> Where in the doc do we say that this should use a face
> that is used in an overlay placed on some buffer positions?

The hl-line overlay produces a face for buffer text, and the
before-string is displayed with the same face.

> Is this behavior documented?  I couldn't find anything
> about it, but it might well be there somewhere.  I looked
> in the doc about overlays and the doc about the margin,
> but perhaps it is there and I overlooked or misread it.

It's indirectly documented in "Displaying Faces".

> Or is this perhaps a bug?

Not a bug: the code does this on purpose, and even has comments that
explicitly describe this.  Emacs worked like that since v21.1.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]