all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Gregory Heytings <ghe@sdf.org>
Cc: emacs-devel@gnu.org
Subject: Re: buffer-face-set changes the fringe, is it a bug?
Date: Tue, 07 Jul 2020 17:59:34 +0300	[thread overview]
Message-ID: <838sfvs755.fsf@gnu.org> (raw)
In-Reply-To: <alpine.NEB.2.21.2007071445470394.28444@sdf.lonestar.org> (emacs-devel@gnu.org)

> Date: Tue, 7 Jul 2020 14:59:03 +0200 (CEST)
> From: Gregory Heytings via "Emacs development discussions." <emacs-devel@gnu.org>
> 
> A (last?) note on this.  Fringes were introduced in Emacs 21, and face 
> remappings much later, in Emacs 23.  Before face remappings existed (i.e. 
> in Emacs 21 and 22), a left/right-fringe display property with an omitted 
> face meant using the fringe face without modifications.  It is only when 
> face remappings, a feature completely unrelated to fringe displays, were 
> introduced, that the current behavior (to use the fringe face when the 
> default face has not been remapped, and the remapped default face 
> otherwise) started to exist.

This is not what I see.  The left/right-fringe display property (which
was introduced in Emacs 22.1, btw) behaves in Emacs 22 exactly like it
behaves in the current codebase: if the optional FACE parameter is
omitted, it uses the foreground of the 'default' face and the
background of the 'fringe' face (because the 'fringe' face by default
doesn't specify the foreground).  Try this:

  (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)
    (set-face-foreground 'default "green"))

and you will see that the foreground of the question-mark bitmap
becomes green.  IOW, Emacs in this case merges the 'fringe' and the
'default' faces, starting from 'default' (so any color specified by
'fringe' overrides the corresponding color of 'default').  By
contrast, when you specify FACE, Emacs merges that face with 'fringe'
starting from 'fringe'.  This different order of merging is what
causes the results which confused you; the implementation didn't
change since it was introduced in Emacs 22.1.

The relation with face remapping is subtle and almost tangential: face
remapping doesn't modify the 'default' face, it creates a new face
which select Emacs features use _instead_ of the original 'default'.



  reply	other threads:[~2020-07-07 14:59 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.
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 [this message]
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

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

  git send-email \
    --in-reply-to=838sfvs755.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=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 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.