emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 0bfa9e7 1/2: * lisp/tab-line.el: Add face for group-tab (bug#4711


From: Juri Linkov
Subject: master 0bfa9e7 1/2: * lisp/tab-line.el: Add face for group-tab (bug#47118)
Date: Sun, 14 Mar 2021 05:11:51 -0400 (EDT)

branch: master
commit 0bfa9e78602a9c37c9ebd14bef43d15f6443d17c
Author: Gabriel do Nascimento Ribeiro <gabriel.nascimento@nubank.com.br>
Commit: Juri Linkov <juri@linkov.net>

    * lisp/tab-line.el: Add face for group-tab (bug#47118)
    
    (tab-line-tab-face-functions): Add choice for 'tab-line-tab-face-group'.
    (tab-line-tab-group): New face.
    (tab-line-tabs-buffer-groups): Set alist key 'group-tab' for group tabs.
    (tab-line-tab-face-group): New function to set face for group tabs.
---
 lisp/tab-line.el | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/lisp/tab-line.el b/lisp/tab-line.el
index 903862a..c4b504a 100644
--- a/lisp/tab-line.el
+++ b/lisp/tab-line.el
@@ -44,6 +44,7 @@ whether the tab is a buffer, and whether the tab is selected."
   :type '(repeat
           (choice (function-item tab-line-tab-face-special)
                   (function-item tab-line-tab-face-inactive-alternating)
+                  (function-item tab-line-tab-face-group)
                   (function :tag "Custom function")))
   :group 'tab-line
   :version "28.1")
@@ -95,6 +96,16 @@ function `tab-line-tab-face-special'."
   :version "28.1"
   :group 'tab-line-faces)
 
+(defface tab-line-tab-group
+  '((default
+      :inherit tab-line
+      :box nil))
+  "Face for group tabs.
+Applied when option `tab-line-tab-face-functions' includes
+function `tab-line-tab-face-group'."
+  :version "28.1"
+  :group 'tab-line-faces)
+
 (defface tab-line-tab-current
   '((default
       :inherit tab-line-tab)
@@ -385,6 +396,7 @@ If the major mode's name string matches REGEXP, use 
GROUPNAME instead.")
                       (set-window-parameter nil 'tab-line-group nil))))
            (group-tab `(tab
                         (name . ,group)
+                        (group-tab . t)
                         (select . ,(lambda ()
                                      (set-window-parameter nil 
'tab-line-groups t)
                                      (set-window-parameter nil 'tab-line-group 
group)
@@ -520,6 +532,13 @@ When TAB is a non-file-backed buffer, make FACE inherit 
from
     (setf face `(:inherit (tab-line-tab-special ,face))))
   face)
 
+(defun tab-line-tab-face-group (tab _tabs face _buffer-p _selected-p)
+  "Return FACE for TAB according to whether it's a group tab.
+For use in `tab-line-tab-face-functions'."
+  (when (alist-get 'group-tab tab)
+    (setf face `(:inherit (tab-line-tab-group ,face))))
+  face)
+
 (defvar tab-line-auto-hscroll)
 
 (defun tab-line-format ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]