From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings via "Emacs development discussions." Newsgroups: gmane.emacs.devel Subject: Re: buffer-face-set changes the fringe, is it a bug? Date: Tue, 7 Jul 2020 17:47:55 +0200 (CEST) Message-ID: References: <2E75863E-82E2-4D61-AD34-0282362C6E99@gnu.org> <835zb2t1t8.fsf@gnu.org> <83lfjwsiin.fsf@gnu.org> <83h7uksehi.fsf@gnu.org> <838sfvs755.fsf@gnu.org> Reply-To: Gregory Heytings Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18324"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Alpine 2.21 (NEB 202 2017-01-01) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jul 07 17:54:10 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 1jspv7-0004b9-8R for ged-emacs-devel@m.gmane-mx.org; Tue, 07 Jul 2020 17:54:09 +0200 Original-Received: from localhost ([::1]:39904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jspv6-0002sC-AZ for ged-emacs-devel@m.gmane-mx.org; Tue, 07 Jul 2020 11:54:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53742) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsppU-000771-LG for emacs-devel@gnu.org; Tue, 07 Jul 2020 11:48:20 -0400 Original-Received: from mx.sdf.org ([205.166.94.24]:57469) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsppR-0002o2-0T for emacs-devel@gnu.org; Tue, 07 Jul 2020 11:48:20 -0400 Original-Received: from sdf.org (IDENT:ghe@faeroes.freeshell.org [205.166.94.9]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 067Flw2u023218 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Tue, 7 Jul 2020 15:47:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sdf.org; s=default; t=1594136881; bh=uT26bQTs0M4Vu9XqHkg003YhD/vJ/k9K/AX2/nxyEMY=; h=Date:From:To:Subject:In-Reply-To:References; b=gHGGbXR8AFOYpddxBS+pgLpgJn1dhREO2Q8vZT5jLQ7QJ+tZJPAucZEy9CZ00VbpN FupMoymNRTe0SR51CpvC6e5yRhLUWEnpNk86v8yHQ9obsWMXytFS8EAQKi+l+q9L2T 3fMm1s48/grfDvlCw592LNPuYmQI/8BrIT2H1GO4= Original-Received: (from ghe@localhost) by sdf.org (8.15.2/8.12.8/Submit) id 067Flwsr011681; Tue, 7 Jul 2020 15:47:58 GMT In-Reply-To: <838sfvs755.fsf@gnu.org> Received-SPF: none client-ip=205.166.94.24; envelope-from=ghe@sdf.org; helo=mx.sdf.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/07 11:48:13 X-ACL-Warn: Detected OS = ??? X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_PASS=-0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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:252743 Archived-At: > > 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")) > Why did you change my code, which demonstrated the problem, into another one which indeed does not show the problem? 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. 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). Gregory