GNU bug report logs - #71883
[PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function

Previous Next

Package: emacs;

Reported by: Joseph Turner <joseph <at> breatheoutbreathe.in>

Date: Mon, 1 Jul 2024 20:43:02 UTC

Severity: normal

Tags: patch

Fixed in version 31.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #74 received at 71883 <at> debbugs.gnu.org (full text, mbox):

From: Joseph Turner <joseph <at> breatheoutbreathe.in>
To: Juri Linkov <juri <at> linkov.net>
Cc: adam <at> alphapapa.net, 71883 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>,
 shipmints <at> gmail.com
Subject: Re: bug#71883: [PATCH] Fix tab-bar-auto-width with customized
 tab-bar-tab-face-function
Date: Fri, 09 Aug 2024 05:25:21 -0700
Juri Linkov <juri <at> linkov.net> writes:

> Thanks for the patches.
>
>> -   `((,(intern (format "group-%i" i))
>> +   `((,(intern (if current-p "current-group" (format "group-%i" i)))
>
> I pushed this part to master now.
>
>> +(defun tab-bar-auto-width-predicate-default (item)
>> +  "Accepts tab ITEM and returns non-nil for tabs and tab groups."
>> +  (string-match-p
>> +   ;; (rx bos (or "current-tab" "current-group" "tab-" "group-"))
>> +   "\\`\\(?:current-\\(?:group\\|tab\\)\\|\\(?:group\\|tab\\)-\\)"
>> +   (symbol-name (nth 0 item))))
>
> In this part please remove the current group from the default implementation,
> because it looks too ugly, and it was not resized before this change, since
> tab-bar-auto-width-faces didn't contain the tab-bar-tab-group-current face.

If the simpler change offers feature parity, that sounds good to me.

>> -        (if (memq (get-text-property 0 'face (nth 2 item))
>> -                  tab-bar-auto-width-faces)
>> +        (if (run-hook-with-args-until-success 'tab-bar-auto-width-functions item)
>
> I wonder how users are supposed to handle tab-bar-tab-ungrouped now?
> Since it can't be distinguished from grouped tabs (both have tab- symbols),
> is this how users should customize this now:
>
>   (setq tab-bar-auto-width-functions
>         `(,(lambda (item)
>              (and (string-match-p
>                    "\\`\\(?:current-tab\\|\\(?:group\\|tab\\)-\\)" (symbol-name (nth 0 item)))
>                   (not (eq (get-text-property 0 'face (nth 2 item))
>                            'tab-bar-tab-ungrouped))))))

I don't use tab groups, so I don't know if anyone will want to do this.

>> +(make-obsolete-variable 'tab-bar-auto-width-faces 'tab-bar-auto-width-functions "30")
>> [...]
>> +*** The 'tab-bar-auto-width-faces' variable is now obsolete.
>> +Use 'tab-bar-auto-width-functions' instead.
>
> Actually I see no need to obsolete the variable instead of deleting it right away
> since it's not used anywhere anymore.

If it's okay to remove defvars without obsoletion, I'm in favor of it.

Thanks!

Joseph




This bug report was last modified 333 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.