From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: buffer-face-set changes the fringe, is it a bug? Date: Tue, 07 Jul 2020 21:34:32 +0300 Message-ID: <834kqjrx6v.fsf@gnu.org> References: <2E75863E-82E2-4D61-AD34-0282362C6E99@gnu.org> <835zb2t1t8.fsf@gnu.org> <83lfjwsiin.fsf@gnu.org> <83h7uksehi.fsf@gnu.org> <838sfvs755.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19867"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Gregory Heytings Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jul 07 20:38:57 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jssUb-00055w-Md for ged-emacs-devel@m.gmane-mx.org; Tue, 07 Jul 2020 20:38:57 +0200 Original-Received: from localhost ([::1]:37012 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jssUa-00005E-N3 for ged-emacs-devel@m.gmane-mx.org; Tue, 07 Jul 2020 14:38:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39272) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jssQC-00014b-Mr for emacs-devel@gnu.org; Tue, 07 Jul 2020 14:34:24 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:50756) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jssQA-0005QU-0H; Tue, 07 Jul 2020 14:34:22 -0400 Original-Received: from [176.228.60.248] (port=3248 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jssQ9-0005wH-Fe; Tue, 07 Jul 2020 14:34:21 -0400 In-Reply-To: (emacs-devel@gnu.org) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:252747 Archived-At: > Date: Tue, 7 Jul 2020 17:47:55 +0200 (CEST) > From: Gregory Heytings via "Emacs development discussions." > > > (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")) > > > > Why did you change my code, which demonstrated the problem, into another > one which indeed does not show the problem? Because I tried to explain something, in the text that you removed. > Try this: > > (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)) > (progn (set-face-background 'default "yellow") (set-face-foreground 'default "red")) [1] > (face-remap-add-relative 'default '(:background "yellow" :foreground "red")) [2] > > After [1] the behavior is what I expect: red on yellow in the buffer, blue > on red in the fringe. Certainly: since in this example the 'fringe' face defines both the foreground and the background colors, none of the colors of the 'default' face show. > After [2] the behavior is *not* what I expect anymore: red on yellow in > the buffer, red on yellow for the question mark in the fringe (the other > parts of the fringe remain red, and other bitmaps in the fringe, e.g. > curly arrows, remain blue on a red background). Because now what you call 'default' is not the original 'default' face, it's a new face created by face-remapping machinery.