emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC] Add :invisible face attribute


From: Eli Zaretskii
Subject: Re: [RFC] Add :invisible face attribute
Date: Wed, 18 Dec 2024 18:52:46 +0200

> From: Michal Nazarewicz <mina86@mina86.com>
> 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]