1

I have my isearch failure face set like so:

(custom-set-faces
 ...
 '(isearch-fail ((t (:background "#660c00"))))
 ...
)

It works for the most part, highlighting text which doesn't match in that color. However, whenever I write failing whitespace, i.e. a space or a tab which has no match in the buffer, the face that is used to highlight it is a brighter shade of red which is not the same color as the rest of the unmatched text. Furthermore, this color of whitespace is replaced by my custom isearch failure color when non-whitespace characters are written after it.

Here is an example demonstrating this.

I suspect that I can solve this issue by setting some face somewhere, but I'm not sure which face is the culprit here and I've looked and looked for it to no avail.

FYI, I'm using GNU Emacs 25.1.50.2 on OS X 10.11.6.

1

M-x list-faces-display is your friend.

The face used for this is face trailing-whitespace. It highlights, well, trailing whitespace. ;-) Customize it to whatever you want: M-x customize-face trailing-whitespace. You can even make it identical in appearance to face isearch-fail.

You can see how face trailing-whitespace is used in the code by looking at function isearch-message, in library isearch.el (use M-x find-library isearch).

  • Doh, I feel dumb now :P Thanks for the tips; I didn't actually know about list-faces-display, but will definitely make use of it now. I should have thought to check out the isearch-message function as well, but that hadn't crossed my mind. – GDP2 Aug 6 '16 at 3:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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