aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/faces.el17
-rw-r--r--lisp/tab-line.el17
2 files changed, 28 insertions, 6 deletions
diff --git a/lisp/faces.el b/lisp/faces.el
index 6fe94927290..97620822b88 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -3005,7 +3005,22 @@ Note: Other faces cannot inherit from the cursor face."
3005 :background "grey") 3005 :background "grey")
3006 (t 3006 (t
3007 :inverse-video t)) 3007 :inverse-video t))
3008 "Tab line face." 3008 "Basic tab line face.
3009See `tab-line-active' and `tab-line-inactive' for the faces
3010used on tab lines."
3011 :version "31.1"
3012 :group 'basic-faces)
3013
3014(defface tab-line-active
3015 '((t :inherit tab-line))
3016 "Face for the selected tab line.
3017This inherits from the `tab-line' face."
3018 :version "31.1"
3019 :group 'basic-faces)
3020
3021(defface tab-line-inactive
3022 '((t :inherit tab-line))
3023 "Basic tab line face for non-selected windows."
3009 :version "31.1" 3024 :version "31.1"
3010 :group 'basic-faces) 3025 :group 'basic-faces)
3011 3026
diff --git a/lisp/tab-line.el b/lisp/tab-line.el
index 832b2b74437..524799e445d 100644
--- a/lisp/tab-line.el
+++ b/lisp/tab-line.el
@@ -54,7 +54,11 @@ is selected."
54 :group 'tab-line 54 :group 'tab-line
55 :version "28.1") 55 :version "28.1")
56 56
57(defgroup tab-line-faces '((tab-line custom-face)) ; tab-line is defined in faces.el 57(defgroup tab-line-faces
58 ;; These faces are defined in faces.el
59 '((tab-line custom-face)
60 (tab-line-active custom-face)
61 (tab-line-inactive custom-face))
58 "Faces used in the tab line." 62 "Faces used in the tab line."
59 :group 'tab-line 63 :group 'tab-line
60 :group 'faces 64 :group 'faces
@@ -860,13 +864,16 @@ the selected tab visible."
860 (with-current-buffer tab-line-auto-hscroll-buffer 864 (with-current-buffer tab-line-auto-hscroll-buffer
861 (let ((truncate-partial-width-windows nil) 865 (let ((truncate-partial-width-windows nil)
862 (inhibit-modification-hooks t) 866 (inhibit-modification-hooks t)
867 (face (if (mode-line-window-selected-p)
868 'tab-line-active
869 'tab-line-inactive))
863 show-arrows) 870 show-arrows)
864 (setq truncate-lines nil 871 (setq truncate-lines nil
865 word-wrap nil) 872 word-wrap nil)
866 (erase-buffer) 873 (erase-buffer)
867 (apply 'insert strings) 874 (apply 'insert strings)
868 (goto-char (point-min)) 875 (goto-char (point-min))
869 (add-face-text-property (point-min) (point-max) 'tab-line t) 876 (add-face-text-property (point-min) (point-max) face t)
870 ;; Continuation means tab-line doesn't fit completely, 877 ;; Continuation means tab-line doesn't fit completely,
871 ;; thus scroll arrows are needed for scrolling. 878 ;; thus scroll arrows are needed for scrolling.
872 (setq show-arrows (> (vertical-motion 1) 0)) 879 (setq show-arrows (> (vertical-motion 1) 0))
@@ -888,7 +895,7 @@ the selected tab visible."
888 (erase-buffer) 895 (erase-buffer)
889 (apply 'insert (reverse (seq-subseq strings 0 (1+ selected)))) 896 (apply 'insert (reverse (seq-subseq strings 0 (1+ selected))))
890 (goto-char (point-min)) 897 (goto-char (point-min))
891 (add-face-text-property (point-min) (point-max) 'tab-line) 898 (add-face-text-property (point-min) (point-max) face)
892 (if (> (vertical-motion 1) 0) 899 (if (> (vertical-motion 1) 0)
893 (let* ((point (previous-single-property-change (point) 'tab)) 900 (let* ((point (previous-single-property-change (point) 'tab))
894 (tab-prop (when point 901 (tab-prop (when point
@@ -909,13 +916,13 @@ the selected tab visible."
909 (erase-buffer) 916 (erase-buffer)
910 (apply 'insert (seq-subseq strings (truncate hscroll) (1+ selected))) 917 (apply 'insert (seq-subseq strings (truncate hscroll) (1+ selected)))
911 (goto-char (point-min)) 918 (goto-char (point-min))
912 (add-face-text-property (point-min) (point-max) 'tab-line) 919 (add-face-text-property (point-min) (point-max) face)
913 (when (> (vertical-motion 1) 0) 920 (when (> (vertical-motion 1) 0)
914 ;; Not visible already 921 ;; Not visible already
915 (erase-buffer) 922 (erase-buffer)
916 (apply 'insert (reverse (seq-subseq strings 0 (1+ selected)))) 923 (apply 'insert (reverse (seq-subseq strings 0 (1+ selected))))
917 (goto-char (point-min)) 924 (goto-char (point-min))
918 (add-face-text-property (point-min) (point-max) 'tab-line) 925 (add-face-text-property (point-min) (point-max) face)
919 (when (> (vertical-motion 1) 0) 926 (when (> (vertical-motion 1) 0)
920 (let* ((point (previous-single-property-change (point) 'tab)) 927 (let* ((point (previous-single-property-change (point) 'tab))
921 (tab-prop (when point 928 (tab-prop (when point