The result buffer of occur displays the buffer name with some info:

69 matches in 65 lines for "use" in buffer: init.el

It's alright when I run occur in only one buffer.

I just started using multi-occur (rather projectile-multi-occur), thus getting multiple lines of that type, one per file with matches. I find that these lines should make a greater visual separation. Right now, these lines have the face underline (at the bottom of the result of describe-char):

enter image description here

I was expecting a face, which I could change in my theme.

Is this face underline hard-coded in the implementation of occur? Can I customize it from within my theme file?

1 Answer 1


You can change list-matching-lines-buffer-name-face to the face what your want.

(defface blue-underline
  '((t :foreground "blue" :underline t))
  "blue-underline face.")

(setq list-matching-lines-buffer-name-face 'blue-underline)

How I find it:

  1. go to source code of multi-occur
  2. search underline
  • 1
    FYI: I filed Emacs bug #54157, to alias the list-matching-lines-* option names to occur-* names.
    – Drew
    Commented Feb 25, 2022 at 17:01
  • Thanks! I tried to put this in my theme.el: `(list-matching-lines-buffer-name-face ((t (:foreground "blue" :underline t)))), but it doesn't seem to work. Am I missing something? I see that it's not the same way (not using defcustom), but all faces in my theme are done as I pasted here.
    – Gauthier
    Commented Feb 25, 2022 at 17:08
  • @Gauthier Hi, list-matching-lines-buffer-name-face is a variable not face. You should use setq to set it to some face. I have update my answer with an example. Commented Feb 26, 2022 at 4:00

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.