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: Inconsistent margin background color in minibuffer Date: Fri, 02 Aug 2024 09:54:46 +0300 Message-ID: <868qxfwh1l.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25924"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: "Nicolas P. Rougier (inria)" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Aug 02 08:55:30 2024 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 1sZmCF-0006Zq-LU for ged-emacs-devel@m.gmane-mx.org; Fri, 02 Aug 2024 08:55:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZmBk-0006vf-4E; Fri, 02 Aug 2024 02:54:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZmBe-0006k8-1G for emacs-devel@gnu.org; Fri, 02 Aug 2024 02:54:50 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZmBc-0004mR-My; Fri, 02 Aug 2024 02:54:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=54quB4PAkH/qZgofrVjFqtw/kwYdA5wBtW484UlPe6k=; b=MNxqdYjuS72h 35ONK2NRI3Zqbjz8S0CowFLQ2tNBINWZDDnmxryhMGbBTngzhSTaHYWatI32mW9HnB3GMyhXSS4YN n3/iSxd69BXbMoxfzDsX8WtsmZudBbfHjF3R7QSvdEyA/QPzMl5yz4hrxjHQJqQ8Sxm/JRjm3AuRk h2TIQAAqqRpmWlYZwV07t98W1KIW7qXTLInzuvpnPVBfr5BhdUyVapvEC5sKu+Vk1fgxTtGPnI3V/ P2v0nzFWY7sXWRZtiVxLW7gP6df0SAPVT2ohKadX5neFMRnFBXxQ/junS87zS5JY8Kk0zmt8n+mEz jLTg7lUZzk/JVh8fIqxPQg==; In-Reply-To: (nicolas.rougier@inria.fr) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:322280 Archived-At: > From: "Nicolas P. Rougier (inria)" > Date: Tue, 30 Jul 2024 16:55:17 +0200 > > > I'm experimenting with the minibuffer and I get some problem setting the > margin (not fringe) background color. Here is a simple example: > > (defun setup-minibuffer () > (setq-local truncate-lines t) > (set-window-margins nil 10 10) > (set-window-fringes nil 0 0) > (goto-char (point-min)) > (face-remap-set-base 'default '(:background "#cccccc"))) > > (add-hook 'minibuffer-setup-hook #'setup-minibuffer) > > (completing-read "Very long prompt: " > nil nil nil > "Very long line that should trigger truncation (hopefully), else, reduce window width.") > > When the point is at the start of the prompt, margin background color is > white (default bg color I guess) but when the point is at the end of the > entry, margin background color is "#cccccc". > > Is that the expected behavior? If yes, how can I force the margin > background color to use the remapped default face ? It's a bug, and a very old one. When the feature of showing truncation/continuation glyphs on GUI frames was added to Emacs, we failed to consider the case where there are display margins with nothing in them (i.e., the margin area is empty) and the default face is remapped. I have now fixed that on the master branch. While at that, I also fixed a minor related inconsistency: the truncation/continuation glyphs should use the remapped default face for their background (in your case, the truncation glyphs should have the same background color of "#cccccc"), not the default frame background.