emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] tab-line-alternate-colors


From: Juri Linkov
Subject: Re: [PATCH] tab-line-alternate-colors
Date: Mon, 14 Dec 2020 21:37:27 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

>> 1. add tab-line-tab-face-default to tab-line-tab-face-functions by default.
>>
>> 2. remove tab-line-tab-face-default and leave its code in 
>> tab-line-format-template
>>    as before, with a supposition that it should be sufficient to customize
>>    tab-line-tab-face-functions to post-process its output face.
>>
>> What variant would you prefer?
>
> Hmm, I'm not sure which is best.  #1 might be the cleanest in theory,
> but it would seem to conflate the two types of functions: the initial
> face-determining function and the face-modifying functions.  So that
> variant would seem to require one of two approaches: a) require the
> function tab-line-tab-face-default to be first in the list of functions
> (which would be error-prone), or b) modify the function
> tab-line-tab-face-default to work as a face-modifier so it could work
> regardless of its position in the list (and it would need to be able to
> start from a nil face, which might be awkward).
>
> OTOH, #2 would minimize the diff from master and avoid the problems that
> #1 would seem to present.
>
> So I suppose I would choose variant #2, although I don't have a strong
> preference, and I might be overlooking something that would make #1 a
> better choice.
>
> WDYT?  Thanks.

The only drawback of #2 is that when the user wants to completely
override all default faces, then calculating the default faces
is unnecessary, but its performance overhead is negligible.

For more optimization we could try also to add more args to the
face-returning functions, such args as 'selected-p', but OTOH, maybe
'selected-p' is not needed in tab-line-tab-face-inactive-alternating,
because it can just check if the arg 'face' from the previous function is
not 'tab-line-tab-current'.



reply via email to

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