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: [RFC] Add :invisible face attribute Date: Wed, 18 Dec 2024 18:52:46 +0200 Message-ID: <867c7xlyqp.fsf@gnu.org> References: <20241218160813.31108-1-mina86@mina86.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36749"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Michal Nazarewicz Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 18 17:53:15 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 1tNxIR-0009OJ-3T for ged-emacs-devel@m.gmane-mx.org; Wed, 18 Dec 2024 17:53:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNxI6-0005sR-6n; Wed, 18 Dec 2024 11:52:54 -0500 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 1tNxI3-0005rv-SC for emacs-devel@gnu.org; Wed, 18 Dec 2024 11:52:51 -0500 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 1tNxI2-0007a8-DF; Wed, 18 Dec 2024 11:52:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=OAPc8GNlhEKnatf06rbUP8wcGrusL2MMzA1coQx0hL0=; b=gaphovHfw7ARaDn8iUEF 1NH5a+Jg9ZiUPoXj6mYG9v5Eu9cvK1DPCfAy/DXSXB6AmaBxoHg5IlWZCfOSlb3BVPsqjSggjbLdN 7fDu/gVgfZ4p2TKf232vpJtPD59mazwAFE3bW3YFqZOoHuXehL9sEZfbhY9Sa/05TCC3q9Cvm1Kbk cKVRlpuklQ7yQhR4MUtVIFemxkx1O5EpGCsnzJ/uHQuQE+ar6RJ8nCNzBAoOGZKJRk3KFX1wemW1J tkFkG2kZBpOYVxkGzEAR7htw4LxTj43gXi2+XQvSSzFItdCHIzaLVsY9XkduCQ9oacOTn9+R3Z2xg 9WOMgS2e7cgswg==; In-Reply-To: <20241218160813.31108-1-mina86@mina86.com> (message from Michal Nazarewicz on Wed, 18 Dec 2024 17:08:12 +0100) 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:326668 Archived-At: > From: Michal Nazarewicz > Date: Wed, 18 Dec 2024 17:08:12 +0100 > > Introduce :invisible face attribute which makes foreground to be the > same as background rendering the text invisible; or when :invert-video > is also in effect, background is the same as foreground. > > Use it in Org mode for org-hide face eliminting the need for > org-find-invisible-foreground function. This also simplifies > auto-dim-other-buffers NonGNU ELPA package removing the need to > configure a separate hide face for org-hide remap. > > To observe the atribute in action, set ‘org-hide-leading-stars’ option, > open NEWS file and enable org-mode. The initial stars in section > headings are rendered using the new attribute rather than Org mode > needing to explicitly match foregroun to background. Thanks. A new face attribute adds quite a bit of complexity, so we should really believe this is a good idea. Given that this can already be achieved without a new attribute, I'm not sure. Is this really a frequent need/situation? But let's see what others think about this. > @@ -2911,6 +2925,13 @@ merge_face_ref (struct window *w, > else > err = true; > } > + else if (EQ (keyword, QCinvisible)) > + { > + if (EQ (value, Qt) || NILP (value)) > + to[LFACE_INVISIBLE_INDEX] = value; > + else > + err = true; > + } Does this mean that the result of merging two faces with different values for :invisible will depend on the order of the merge? That is, does the nil value override the t value? Or am I missing something? Btw, I think "invisible" is not the best name for this, because that's not really what will happen on display. It's more like "illegible" or something to that effect.