emacs-devel
[Top][All Lists]
Advanced

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

Re: buffer-face-set changes the fringe, is it a bug?


From: Eli Zaretskii
Subject: Re: buffer-face-set changes the fringe, is it a bug?
Date: Sun, 05 Jul 2020 13:50:11 +0300
User-agent: K-9 Mail for Android

On July 5, 2020 11:56:00 AM GMT+03:00, "Gregory Heytings via Emacs development 
discussions." <emacs-devel@gnu.org> wrote:
> 
> Hi list,
> 
> Is the following behavior expected, or is it a bug?
> 
> (set-face-attribute 'fringe nil :background "red")
> (let ((o (make-overlay 0 1)) (s "_"))
>    (put-text-property 0 1 'display '(left-fringe question-mark) s)
>    (overlay-put o 'after-string s))
> 
> This puts a question mark in the left fringe.  At least on Emacs 26.3 
> (started with emacs -Q), after:
> 
> (buffer-face-set '(:background "yellow"))
> 
> the background of the buffer *and* the question mark in the fringe
> become 
> yellow.  I would have expected that the background of the question
> mark 
> would still be red.
> 
> Gregory

You are assuming that 'display' property that draws on the fringe automatically 
uses the 'fringe' face?  But that's not how this property works: it uses the 
'default' face (and thus is subject to face remapping).  To use another face, 
you need to specify it in the 'left-fringe' form, see the ELisp manual for the 
details.

IOW, this is not a bug.



reply via email to

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