* bug#71939: tab-bar `tab-bar-show-inactive-group-tabs' feature request
@ 2024-07-04 13:41 Ship Mints
2024-07-04 16:12 ` Juri Linkov
0 siblings, 1 reply; 5+ messages in thread
From: Ship Mints @ 2024-07-04 13:41 UTC (permalink / raw)
To: 71939; +Cc: Juri Linkov
[-- Attachment #1: Type: text/plain, Size: 2689 bytes --]
I'd like to propose that `tab-bar' allow optionally showing tabs for
inactive groups when `tab-bar-format-tabs-groups' is in force rather than
the always-on policy of collapsing inactive groups.
The proposed custom variable `tab-bar-show-inactive-group-tabs' is backward
compatible for existing users and has no visible changes for people who do
not set it to t. I will occasionally set the value locally to alter frame
by frame behavior. I've also used a key binding to toggle the behavior to
nice effect.
I've been using these changes (via advice :override) under Emacs 29.3.
Thanks, again, for this package.
The proposed implementation is below with new/changed code in bold.
*(defcustom tab-bar-show-inactive-group-tabs nil "Show tabs which are in
inactive groups." :type 'boolean :initialize 'custom-initialize-default
:set (lambda (sym val) (set-default sym val)
(force-mode-line-update)) :group 'tab-bar :version "30.x")*
(defun tab-bar-format-tabs-groups ()
"Produce tabs for the tab bar grouped according to their groups."
(let* ((tabs (funcall tab-bar-tabs-function))
(current-group (funcall tab-bar-tab-group-function
(tab-bar--current-tab-find tabs)))
(previous-group nil)
(i 0))
(mapcan
(lambda (tab)
(let ((tab-group (funcall tab-bar-tab-group-function tab)))
(setq i (1+ i))
(prog1 (cond
;; Show current group tabs and ungrouped tabs
((or (equal tab-group current-group) (not tab-group))
(append
;; Prepend current group name before first tab
(when (and (not (equal previous-group tab-group))
tab-group)
(tab-bar--format-tab-group tab i t))
;; Override default tab faces to use group faces
(let ((tab-bar-tab-face-function
tab-bar-tab-group-face-function))
(tab-bar--format-tab tab i))))
;; Show first tab of other groups with a group name
((not (equal previous-group tab-group))
* (append (tab-bar--format-tab-group tab
i) (when tab-bar-show-inactive-group-tabs
(let ((tab-bar-tab-face-function tab-bar-tab-group-face-function))
(tab-bar--format-tab tab i)))))* ;; Hide
other group tabs
* (t (when tab-bar-show-inactive-group-tabs
(let ((tab-bar-tab-face-function tab-bar-tab-group-face-function))
(tab-bar--format-tab tab i)))))* (setq
previous-group tab-group))))
tabs)))
-Stephane
[-- Attachment #2: Type: text/html, Size: 3878 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#71939: tab-bar `tab-bar-show-inactive-group-tabs' feature request
2024-07-04 13:41 bug#71939: tab-bar `tab-bar-show-inactive-group-tabs' feature request Ship Mints
@ 2024-07-04 16:12 ` Juri Linkov
2024-07-29 18:27 ` Juri Linkov
0 siblings, 1 reply; 5+ messages in thread
From: Juri Linkov @ 2024-07-04 16:12 UTC (permalink / raw)
To: Ship Mints; +Cc: 71939
> I'd like to propose that `tab-bar' allow optionally showing tabs for
> inactive groups when `tab-bar-format-tabs-groups' is in force rather than
> the always-on policy of collapsing inactive groups.
>
> The proposed custom variable `tab-bar-show-inactive-group-tabs' is backward
> compatible for existing users and has no visible changes for people who do
> not set it to t. I will occasionally set the value locally to alter frame
> by frame behavior. I've also used a key binding to toggle the behavior to
> nice effect.
>
> I've been using these changes (via advice :override) under Emacs 29.3.
Thanks for the suggestion. I'll try to adapt this for Emacs 31.
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#71939: tab-bar `tab-bar-show-inactive-group-tabs' feature request
2024-07-04 16:12 ` Juri Linkov
@ 2024-07-29 18:27 ` Juri Linkov
2024-07-29 19:05 ` Ship Mints
0 siblings, 1 reply; 5+ messages in thread
From: Juri Linkov @ 2024-07-29 18:27 UTC (permalink / raw)
To: Ship Mints; +Cc: 71939
close 71939 31.0.50
thanks
>> I'd like to propose that `tab-bar' allow optionally showing tabs for
>> inactive groups when `tab-bar-format-tabs-groups' is in force rather than
>> the always-on policy of collapsing inactive groups.
>>
>> The proposed custom variable `tab-bar-show-inactive-group-tabs' is backward
>> compatible for existing users and has no visible changes for people who do
>> not set it to t. I will occasionally set the value locally to alter frame
>> by frame behavior. I've also used a key binding to toggle the behavior to
>> nice effect.
>>
>> I've been using these changes (via advice :override) under Emacs 29.3.
>
> Thanks for the suggestion. I'll try to adapt this for Emacs 31.
I adapted this for Emacs 31 and pushed to master.
Thanks for this feature.
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#71939: tab-bar `tab-bar-show-inactive-group-tabs' feature request
2024-07-29 18:27 ` Juri Linkov
@ 2024-07-29 19:05 ` Ship Mints
2024-08-05 6:56 ` Juri Linkov
0 siblings, 1 reply; 5+ messages in thread
From: Ship Mints @ 2024-07-29 19:05 UTC (permalink / raw)
To: Juri Linkov; +Cc: 71939
[-- Attachment #1: Type: text/plain, Size: 1768 bytes --]
Thank you. In my config, I've also implemented "(setq
tab-bar-inhibit-inactive-group-tab-hints t)" which suppresses tab hints on
group tabs when inactive groups are being displayed as they are generally
superfluous in that case. We could make suppressing tab hints on group tabs
when inactive groups are being displayed as the only behavior which is also
fine by me.
(defun my/tab-bar-tab-group-format-function (tab i &optional current-p)
* (let ((tab-bar-tab-hints (if (and
tab-bar-show-inactive-group-tabs
tab-bar-inhibit-inactive-group-tab-hints) nil
tab-bar-tab-hints)))* (concat
(propertize
my:tab-bar-tab-group-name-prefix
'face (if current-p 'tab-bar-tab-group-current
'tab-bar-tab-group-inactive))
(tab-bar-tab-group-format-default tab i current-p))))
On Mon, Jul 29, 2024 at 2:28 PM Juri Linkov <juri@linkov.net> wrote:
> close 71939 31.0.50
> thanks
>
> >> I'd like to propose that `tab-bar' allow optionally showing tabs for
> >> inactive groups when `tab-bar-format-tabs-groups' is in force rather
> than
> >> the always-on policy of collapsing inactive groups.
> >>
> >> The proposed custom variable `tab-bar-show-inactive-group-tabs' is
> backward
> >> compatible for existing users and has no visible changes for people who
> do
> >> not set it to t. I will occasionally set the value locally to alter
> frame
> >> by frame behavior. I've also used a key binding to toggle the behavior
> to
> >> nice effect.
> >>
> >> I've been using these changes (via advice :override) under Emacs 29.3.
> >
> > Thanks for the suggestion. I'll try to adapt this for Emacs 31.
>
> I adapted this for Emacs 31 and pushed to master.
> Thanks for this feature.
>
[-- Attachment #2: Type: text/html, Size: 2607 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#71939: tab-bar `tab-bar-show-inactive-group-tabs' feature request
2024-07-29 19:05 ` Ship Mints
@ 2024-08-05 6:56 ` Juri Linkov
0 siblings, 0 replies; 5+ messages in thread
From: Juri Linkov @ 2024-08-05 6:56 UTC (permalink / raw)
To: Ship Mints; +Cc: 71939
> Thank you. In my config, I've also implemented "(setq
> tab-bar-inhibit-inactive-group-tab-hints t)" which suppresses tab hints on
> group tabs when inactive groups are being displayed as they are generally
> superfluous in that case. We could make suppressing tab hints on group tabs
> when inactive groups are being displayed as the only behavior which is also
> fine by me.
Thanks for the suggestion. Now hints are not displayed for inactive groups
unconditionally.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-08-05 6:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-04 13:41 bug#71939: tab-bar `tab-bar-show-inactive-group-tabs' feature request Ship Mints
2024-07-04 16:12 ` Juri Linkov
2024-07-29 18:27 ` Juri Linkov
2024-07-29 19:05 ` Ship Mints
2024-08-05 6:56 ` Juri Linkov
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.