Subject: bug#76394: mouse-face property not working in tab-bar

From: Eli Zaretskii <[email-masked]>
Date: Fri, 28 Feb 2025 21:00:06 +0200

> From: Ship Mints <[email-masked]>
> Date: Fri, 28 Feb 2025 13:06:54 -0500
> Cc: [email-masked], [email-masked]
> 
>  >   /* FIXME: This should be controlled by a user option.  See the
>  >      comments in redisplay_tool_bar and display_mode_line about
>  >      this.  */
>  >   it.paragraph_embedding = L2R;
>  > 
>  > I figured let's be defensive for when this is implemented.
> 
>  What we usually do in these cases is to put an assertion there, so
>  that if the condition we assume to always be true ever isn't, we are
>  informed about that in the most violent manner.
> 
> So we'll be super duper defensive, then.  Should I leave the "future" code in place after the assertion or do
> you think it's easy enough to recreate if/when needed? 

I'd prefer to avoid testing for a condition that is always true.

>    * lisp/tab-bar.el (tab-bar-tab-highlight): New face.
> 
> I'll update.
> 
>  But I have a question: why add this face if there's no code that uses
>  it?  Or what did I miss?
> 
>  > -  bool close_p;
>  > -  enum draw_glyphs_face draw = DRAW_IMAGE_RAISED;
>  > -  int rc;
>  > +    Lisp_Object window = f->tab_bar_window;
>  > +    struct window *w = XWINDOW (window);
>  > +    Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
> 
> The idea is that now that there's mouse-face support, people can customize a dedicated face for tab-bar
> tabs.  This is in line with tab-line tabs and its highlight face.

Sounds strange to me to have a face that no other code uses.  I would
understand if this face was by default identical to the 'default'
face, and was used by the tab bar.