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: Mon, 6 Jul 2020 14:22:16 +0200 (CEST) Message-ID: References: <2E75863E-82E2-4D61-AD34-0282362C6E99@gnu.org> <835zb2t1t8.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="31569"; 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 Mon Jul 06 14:23:28 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 1jsQ9f-00083k-GR for ged-emacs-devel@m.gmane-mx.org; Mon, 06 Jul 2020 14:23:27 +0200 Original-Received: from localhost ([::1]:49326 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jsQ9e-00047K-J2 for ged-emacs-devel@m.gmane-mx.org; Mon, 06 Jul 2020 08:23:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55558) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsQ93-0003IE-AK for emacs-devel@gnu.org; Mon, 06 Jul 2020 08:22:49 -0400 Original-Received: from mx.sdf.org ([205.166.94.18]:62758) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsQ8z-00015c-Gu for emacs-devel@gnu.org; Mon, 06 Jul 2020 08:22:49 -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 066CMLTk023278 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Mon, 6 Jul 2020 12:22:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sdf.org; s=default; t=1594038143; bh=viniKWJFyIB4ySiJk1OP7kN8MVnZcvDO4NZOZKmgZQY=; h=Date:From:To:Subject:In-Reply-To:References; b=HpZGdRrsVtaIZ4BC0LaMGWDQ9eShSfs545genqtNlEkRk/pkgT42OxGs6veMuAA5Z BEqJZu/VgNTJy9nuJnO4ZdQU48B1WxtZDffJAtZNVrq7cn0BcwLcNn+aSxwnLlnbA/ cHXaiW0cN8dU0fl5Dg6QjZgjY/x30rPPXR3+NjXE= Original-Received: (from ghe@localhost) by sdf.org (8.15.2/8.12.8/Submit) id 066CMLi5001752; Mon, 6 Jul 2020 12:22:21 GMT In-Reply-To: <835zb2t1t8.fsf@gnu.org> Received-SPF: none client-ip=205.166.94.18; envelope-from=ghe@sdf.org; helo=mx.sdf.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/06 08:22:37 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:252727 Archived-At: > >> 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