From: Gregory Heytings via "Emacs development discussions." <emacs-devel@gnu.org>
To: emacs-devel@gnu.org
Subject: Re: buffer-face-set changes the fringe, is it a bug?
Date: Mon, 6 Jul 2020 14:22:16 +0200 (CEST) [thread overview]
Message-ID: <alpine.NEB.2.21.2007061354540394.27901@sdf.lonestar.org> (raw)
In-Reply-To: <835zb2t1t8.fsf@gnu.org>
>
>> In fact the manual is not as clear as you think, it states (see https://www.gnu.org/software/emacs/manual/html_node/elisp/Fringe-Bitmaps.html ):
>>
>> (fringe bitmap [face])
>>
>> The optional face names a face whose foreground color is used to
>> display the bitmap; this face is automatically merged with the fringe
>> face.
>>
>> For me this means that the fringe face is used to display the bitmaps
>> in the fringe, except the :foreground property which can optionally be
>> imported from another face.
>
> Thanks, I clarified the meaning of FACE in that case.
>
Sorry to come back to this, but on a second thought the documentation is
still not correct:
The optional @var{face} names a face whose foreground and background
colors are to be used to display the bitmap; this face is automatically
merged with the @code{fringe} face. If @var{face} is omitted, that means
to use the @code{default} face.
If this were true, then the following two snippets should give the same
result:
(set-face-attribute 'fringe nil :background "red" :foreground "blue")
(let ((o (make-overlay 0 1)) (s "_"))
(put-text-property 0 1 'display '(left-fringe question-mark) s)
(overlay-put o 'after-string s))
(set-face-attribute 'fringe nil :background "red" :foreground "blue")
(let ((o (make-overlay 0 1)) (s "_"))
(put-text-property 0 1 'display '(left-fringe question-mark default) s)
(overlay-put o 'after-string s))
They do not, the first one displays the question mark in blue on a red
background, the second one in black on a white background.
To summarize, with:
(set-face-attribute 'fringe nil :background "red" :foreground "blue")
(let ((o (make-overlay 0 1)) (s "_"))
(put-text-property 0 1 'display '(left-fringe question-mark [1]) s)
(overlay-put o 'after-string s)) [2]
(buffer-face-set '(:background "yellow" :foreground "red")) [3]
value in [1]: | effect after [2]: | effect after [3]:
(nothing) | blue ? on red bg | red ? on yellow bg
fringe | blue ? on red bg | blue ? on red bg
default | black ? on white bg | red ? on yellow bg
So it seems that it's only when a face remapping takes place that an
omitted face in [1] means using the default face. Before the face
remapping takes place, the fringe face is used instead.
Gregory
next prev parent reply other threads:[~2020-07-06 12:22 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-05 8:56 buffer-face-set changes the fringe, is it a bug? Gregory Heytings via Emacs development discussions.
2020-07-05 10:50 ` Eli Zaretskii
2020-07-05 12:43 ` Gregory Heytings via Emacs development discussions.
2020-07-05 15:32 ` Eli Zaretskii
2020-07-05 16:25 ` Gregory Heytings via Emacs development discussions.
2020-07-05 16:40 ` Eli Zaretskii
2020-07-05 16:59 ` Gregory Heytings via Emacs development discussions.
2020-07-05 17:24 ` Eli Zaretskii
2020-07-06 12:22 ` Gregory Heytings via Emacs development discussions. [this message]
2020-07-06 16:41 ` Eli Zaretskii
2020-07-06 17:08 ` Gregory Heytings via Emacs development discussions.
2020-07-06 18:08 ` Eli Zaretskii
2020-07-06 18:55 ` Gregory Heytings via Emacs development discussions.
2020-07-07 12:59 ` Gregory Heytings via Emacs development discussions.
2020-07-07 14:59 ` Eli Zaretskii
2020-07-07 15:47 ` Gregory Heytings via Emacs development discussions.
2020-07-07 18:34 ` Eli Zaretskii
2020-07-07 18:47 ` Gregory Heytings via Emacs development discussions.
2020-07-07 19:20 ` Eli Zaretskii
2020-07-07 19:44 ` Gregory Heytings via Emacs development discussions.
2020-07-08 2:24 ` Eli Zaretskii
2020-07-08 6:55 ` Gregory Heytings via Emacs development discussions.
2020-07-08 7:00 ` Gregory Heytings via Emacs development discussions.
2020-07-08 14:41 ` Eli Zaretskii
2020-07-09 3:01 ` Richard Stallman
2020-07-09 7:01 ` Gregory Heytings via Emacs development discussions.
2020-07-09 17:17 ` Eli Zaretskii
2020-07-09 17:14 ` Eli Zaretskii
2020-07-10 10:24 ` Gregory Heytings via Emacs development discussions.
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=alpine.NEB.2.21.2007061354540394.27901@sdf.lonestar.org \
--to=emacs-devel@gnu.org \
--cc=ghe@sdf.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 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).