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


View this message in rfc822 format

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: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function
Date: Fri, 09 Aug 2024 05:15:38 -0700
[Message part 1 (text/plain, inline)]

On August 5, 2024 11:59:51 PM PDT, Juri Linkov <juri <at> linkov.net> wrote:
>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 brings feature parity, go for it!

>> -        (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'm not sure.  I have never used group tabs.

>> +(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 notice, then I'm in favor of deleting it now.

Thanks!

Joseph
[Message part 2 (text/html, inline)]

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.