From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ship Mints Newsgroups: gmane.emacs.bugs Subject: bug#71939: tab-bar `tab-bar-show-inactive-group-tabs' feature request Date: Thu, 4 Jul 2024 09:41:42 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000013b8a4061c6c1c3c" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22664"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Juri Linkov To: 71939@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 04 15:43:21 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sPMk4-0005lW-HO for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 04 Jul 2024 15:43:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPMjo-0002on-7j; Thu, 04 Jul 2024 09:43:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPMjk-0002mC-Fi for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2024 09:43:00 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sPMjk-0007Ww-71 for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2024 09:43:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sPMjm-0001az-7V for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2024 09:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ship Mints Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Jul 2024 13:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 71939 X-GNU-PR-Package: emacs X-Debbugs-Original-To: "Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors" Original-Received: via spool by submit@debbugs.gnu.org id=B.17201005236051 (code B ref -1); Thu, 04 Jul 2024 13:43:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Jul 2024 13:42:03 +0000 Original-Received: from localhost ([127.0.0.1]:41800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sPMio-0001ZW-KB for submit@debbugs.gnu.org; Thu, 04 Jul 2024 09:42:03 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:44772) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sPMim-0001Z7-PY for submit@debbugs.gnu.org; Thu, 04 Jul 2024 09:42:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPMik-0002Cx-3p for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2024 09:41:58 -0400 Original-Received: from mail-ua1-x931.google.com ([2607:f8b0:4864:20::931]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sPMih-0007Qz-6g for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2024 09:41:57 -0400 Original-Received: by mail-ua1-x931.google.com with SMTP id a1e0cc1a2514c-8102bbc95d1so213007241.2 for ; Thu, 04 Jul 2024 06:41:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720100513; x=1720705313; darn=gnu.org; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=SsO5gcq9xg4kWKL6dAdJivyzzU9nFVWJ72bh9td64mo=; b=Fnf4qkWWfFApLooHnpRwc9+BIkES5v2x0MwWgtSxLJC8dBHc7PjtdQkrGofz3C/dGN Xxn9uv8EnbPeatMJ7o+/ECjTg4dnoOg0wosJ40rf2jQWSeN/5ug11fxTCLIF2a4ou2UK EcpoIhO0FaxMxk6nqDdZEzlk0kux0cK2Pxt4rGGdQGzx//F/drolaLVLY2k2ALAYd0FB OBnBjeb4hTMfffZs8D/BHE8VaiuVAYVwh+jjIaRHCDgoxKEBNBjAjtli29IIPHUKuTsZ zvtjUlM/mGlnpihktOApTl+wz1vLP8pBB/JCRnHT3dTv3UDwP1pwPpAI/26hbJGDHVD4 cRNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720100513; x=1720705313; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=SsO5gcq9xg4kWKL6dAdJivyzzU9nFVWJ72bh9td64mo=; b=S7mEJaSrvdarYrW/mojE4BQezdk5+xvuyV9XJw/M2v+2iCv9ICPKnmzggl8jbo9cuW p1T5U2CUB+D4Y7BK/P1jhutNyRZYE74uCmhiBvjjdl5eTXGJ9qoBvsIPtTB0Qb8/voJG dkxfIHDYMZl8CkRq53oz2kN112Wj+dbx6nqZqaep51kQXSzaNDTnBoGip5HgFbDInS66 waTRGrz3F2xGsdYjYxCLhHeJY71/HVd9VB6GigAoDkaZ8Xm/o6/1F2/mNgjTgt7zo/UC IhP83AfkFVQM8LShSPxQWfb9dXdbDr9zsU3JNaSh5d4T08fZkx1rIQ9OR1HMWqA78TGs 4ngw== X-Gm-Message-State: AOJu0YwNDOYf0l0qg/1wjsnYT3PRuQfACgCkEu3U+hMDn5+j5CQeJ5yL VWJ9H0Hd5L8AxPvbP6piOUJyWISHC08bNB5+3kOgPGm3ufbDLb8+IWjiVUowb4z8ZNvvgAwmfGK /TaDxqeng79WtjScdkJY3e19WzpvI/g== X-Google-Smtp-Source: AGHT+IHlpja9LB4XhqqXzT5nxmLbpG+UgieLqcQEeIbr5scCMD9PsNn+disZCJ2LJxDm+9rwYSv36ZQ55SgwP4QUAlU= X-Received: by 2002:a05:6122:4303:b0:4ef:6500:b6b3 with SMTP id 71dfb90a1353d-4f2f3f00be3mr1972391e0c.6.1720100513362; Thu, 04 Jul 2024 06:41:53 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::931; envelope-from=shipmints@gmail.com; helo=mail-ua1-x931.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:288371 Archived-At: --00000000000013b8a4061c6c1c3c Content-Type: text/plain; charset="UTF-8" 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 --00000000000013b8a4061c6c1c3c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I'd like to propose that= `tab-bar' allow optionally showing tabs for inactive groups when `tab-= bar-format-tabs-groups' is in=C2=A0force rather than the always-on poli= cy of collapsing inactive groups.

The proposed custom variabl= e `tab-bar-show-inactive-group-tabs' is backward compatible for existin= g users and has no visible changes for people who do not set it to t.=C2=A0= I will occasionally set the va= lue locally to alter frame by frame behavior. I've also used a key bind= ing to toggle the behavior to nice effect.

I've been using these changes (via advice :override) under Emac= s 29.3.

<= /div>
Thanks, again, for this pac= kage.

The proposed implementation is below with new/changed c= ode in bold.

(defcustom tab-bar-show-inactive-group-tabs n= il
=C2=A0 "Show tabs which are in inactive groups."
=C2=A0 = :type 'boolean
=C2=A0 :initialize 'custom-initialize-default
= =C2=A0 :set (lambda (sym val)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(set-def= ault sym val)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(force-mode-line-update)= )
=C2=A0 :group 'tab-bar
=C2=A0 :version "30.x")

(defun tab-bar-format-tabs-groups ()
=C2=A0 "Produce tabs for = the tab bar grouped according to their groups."
=C2=A0 (let* ((tabs= (funcall tab-bar-tabs-function))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(cur= rent-group (funcall tab-bar-tab-group-function
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0(tab-bar--current-tab-find tabs)))
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0(previous-group nil)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= (i 0))
=C2=A0 =C2=A0 (mapcan
=C2=A0 =C2=A0 =C2=A0(lambda (tab)
=C2= =A0 =C2=A0 =C2=A0 =C2=A0(let ((tab-group (funcall tab-bar-tab-group-functio= n tab)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(setq i (1+ i))
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0(prog1 (cond
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0;; Show current group tabs and ungrouped tabs=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((or (equal = tab-group current-group) (not tab-group))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (append
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; Prepend current group name befo= re first tab
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(when (and (not (equal previous-group tab-group)) tab-group)
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(tab-bar--format-tab-group tab i t))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; Override default tab faces to use = group faces
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(let ((tab-bar-tab-face-function tab-bar-tab-group-face-function)= )
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0(tab-bar--format-tab tab i))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0;; Show first tab of other groups with a group n= ame
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((not = (equal previous-group tab-group))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 (append
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(tab-bar--format-tab-group tab i)
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(when tab= -bar-show-inactive-group-tabs
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let ((tab-bar-tab-face-function tab-bar-= tab-group-face-function))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(tab-bar--format-tab tab i)))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; Hide oth= er group tabs
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0(t (when tab-bar-show-inactive-group-tabs
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((tab-bar-tab-= face-function tab-bar-tab-group-face-function))
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (tab-bar--forma= t-tab tab i)))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(setq prev= ious-group tab-group))))
=C2=A0 =C2=A0 =C2=A0tabs)))

-Steph= ane --00000000000013b8a4061c6c1c3c--