0

Emacs 28 added the tab-line-tab-modified face to enable (for example) bolding the text of any tab corresponding to a modified buffer. I style my active tab differently from inactive tabs; my face definitions look like this:

(set-face-attribute 'tab-line-tab-current nil ;; active tab in current window
  :background "SkyBlue1" :foreground "black" :height 140 :box nil)
(set-face-attribute 'tab-line-tab-inactive nil ;; inactive tab
  :background "LightCyan1" :foreground "black" :height 130 :box nil)

So I can add

(set-face-attribute 'tab-line-tab-modified nil ;; active tab in current window
  :background "SkyBlue1" :foreground "black" :height 140 :weight 'bold :box nil)

but that results in any modified tab having the SkyBlue1 background and larger size regardless of whether it's the active tab or not. I'm pretty much a Lisp-newbie, but can anyone tell me how to modify the face attribute, presumably using a function that examines the tab, to set those properties appropriately? Or to use the function to inherit from one of the other faces and then just set the weight. (This is on MacOS, using homebrew, but I can't imagine that matters.)

1 Answer 1

1

Instead of overriding background and foreground in tab-line-tab-modified you could just disable inheritance of these face attributes by using something like:

(set-face-attribute 'tab-line-tab-modified nil
 :inherit nil :height 140 :weight 'bold :box nil)
1
  • Oh. That works great! Can't believe I didn't figure that out. Thanks.
    – rogerl
    Commented Feb 3, 2023 at 13:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.