all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* 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

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.