Subject: Re: bug#41343: tab-bar-mode: Close tab on mouse-2 click

From: Juri Linkov <[email-masked]>
Date: Fri, 13 Aug 2021 10:24:32 +0300

>> The tab-bar could do the same, but how to support existing code
>> that doesn't add text properties to the tab-bar tab captions
>> in the tab-bar-format function?
>
> Hmm... I cannot find a function named tab-bar-format, so I don't think
> I understand the question.  In general, if existing code doesn't add
> some text properties, how can that be a problem?

'tab-bar-format' is a variable that contains functions including
'tab-bar-format-tabs' that calls 'tab-bar--format-tab'
that doesn't put special text properties on tab captions.

Without text properties, it's impossible to identify the clicked tab
in the command called by the click event.

> If you use property names that are unlikely to conflict, I see no
> problem here.  These are special properties used by Emacs for internal
> needs of handling the tab bar, so we can use any name that suits us.
> And since all of the property names are produced by Emacs itself, we
> can easily enough have a set of names without conflicts.  Right?  Or
> what am I missing?

Maybe it's not a problem to add text properties, need to test this more.