1

Re-edited the answer for clarity

Typically I would put my cursor over the text, and call M-x describe-face, but I can't do that with the headerline.

screenshot of LSP headerline in no-window mode with a dark background

In the above screenshot, I want to change the headerline to something contrasting. If I could change the light grey to something darker, it would do the job. So I tried to identify the base faces. So far I found these 3:

  1. lsp-headerline-breadcrumb-path-face: underlined in red
  2. lsp-headerline-breadcrumb-separator-face: the > separator, underlined in yellow (but invisible because it disappears into the background)
  3. lsp-headerline-breadcrumb-symbols-face: underlined in cyan

But I can't figure out the spaces in between. If I change the *-symbols-* and *-path-* faces listed above by adding :background "brightblack", and *-separator-* to just :foreground "black", I can only change the underlined parts (see screenshot below).

screenshot of LSP headerline in no-window mode with a dark background custom attempt

I also looked at the results of list-faces-display (without my customisation), there is no light grey background (see screenshot below). So I think something other than these faces is giving the light grey background, if I could change that, I wouldn't need to change them individually or find the face for the intermediary spaces.

list-faces-display

Follow-up to NickD's question:

header-line-format is set to:

((t
  (:eval
   (window-parameter nil 'lsp-headerline--string))))

When I try to get the value of lsp-headerline--string with C-h v, I get the message [No match].

8
  • In that buffer, what does C-h v header-line-format say? It should contain some face information I think.
    – NickD
    Commented May 19, 2023 at 16:29
  • @NickD please see my edit
    – suvayu
    Commented May 19, 2023 at 18:30
  • You say you don't see any that have the light-gray background you're looking for. But to me it seems that all of the path and symbols faces have that background. Keep in mind that the header line doesn't use the same background as your frame, so faces used there won't appear to be the same as they are elsewhere even when they're actually exactly the same (e.g., same gray in different surrounding context). If your own code is giving the faces that background, then it sounds like you're the culprit. ;-)
    – Drew
    Commented May 19, 2023 at 18:54
  • ... and what's the value of lsp-headerline--string? I guess that the above is meant to cause a refresh when the string is modified.
    – NickD
    Commented May 19, 2023 at 19:05
  • @Drew sorry, I think my initial question wasn't worded clearly. I have re-edited everything for clarity. I hope it is clearer now
    – suvayu
    Commented May 19, 2023 at 21:46

2 Answers 2

0

Use M-x list-faces-display. Use it on a frame that has the same background as the frame where you see the face you're looking for. Find the face that looks like what you see there. Then M-x customize-face.

If you find more than one face that looks the same, then check each one. Use M-x customize-face to change a face's appearance so you can see which one is the one you're looking for.

What you see can also be the result of a combination of faces that are merged at that location. Look for a face that shows you the light gray background you're looking for.

(M-x describe-face also tells you about a face, but it doesn't let you change it, to see whether that's the face you're looking for.)

2
  • Unfortunately that doesn't tell me where the light grey background is coming from. I edited my question to add another screenshot
    – suvayu
    Commented May 19, 2023 at 18:32
  • As I said, use M-x customize-face to check an individual face's attributes in detail. What you see can also be a combination of faces that are merged. Look for a face that does show you the light gray background you're looking for. (I've updated the answer to mention face combination.)
    – Drew
    Commented May 19, 2023 at 18:49
0

Thanks to Drew's hints, I found the relevant face by looking at the whole list from list-faces-display one by one. It was coming from header-line, which inherits from mode-line. But I still don't understand why this is happening, because none of the lsp-headerline-* faces actually inherit from header-line. For example:

Hide [Lsp Headerline Breadcrumb Path Face]:[sample]
   [ State ]: STANDARD.
   Face used for breadcrumb paths on headerline.
   [X] Inherit:
       [INS] [DEL] Face: [link] (sample) font-lock-string-face
       [INS]
   Show All Attributes

Maybe header line is special in some way, and applies two faces.

1
  • 1
    It's possible that two or more faces are present at the same place, in which case their attributes are combined. And there can be both overlays and text properties.
    – Drew
    Commented May 31, 2023 at 14:36

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.